So, as I’ve been teasing (for like 2 years at this point…) I am working on a text editor. Originally it was going to be based in the terminal, and using the Aquila virtual machine, then using Blæst, finally using Crow and not in the terminal. So here are some things I learned.
Keep it simple stupid
First of all, make everything easy on yourself if possible. It’s not always a good idea to reinvent the wheel. Case in point is the text editor interface itself. For so long, I was hung up on how the interface should work. Usually I figure this stuff out and start work, but for the obvious reason of “hey a gui library is pretty freakin huge” I really wasn’t able to get any work done on the project. Especially too since the more I stalled it, the more ideas I got. So eventually it turned from “let’s have it in the terminal” to “let’s have a library to create guis that seamlessly convert from the terminal to literally any ui toolkit and seamlessly integrate into the system they are running on. Needless to say, eventually it just became “what if the text editor was actually an operating system”, and magically that’s where I stopped. So for one, know your limits and keep within them. Now the editor is being written in Qt 6, mostly just because Qt in my experience has the best cross platform ability, and it is really easy to theme from within an application itself. But maybe Qt wasn’t the best option…
Do NOT use Qt
So this might or might not come as a surprise, but I really hate Qt. Always have and always will. The main reason I dislike Qt just mostly has to do with it’s weird licensing problems. Like “is Qt really free software”? If questions like that have to be asked, you probably shouldn’t be using the software in free software projects. Pretty big coming from a guy who uses Mac OS now, but hey, software freedom is something I still really care about, and I want my text editor to be enjoyed and used by all, so picking a UI that was FOSS was an important thing for me. So what do I mean exactly for “is Qt really free”, well for one, now you have to download their (probably proprietary) Qt installer, which requires that you make a Qt account. If you want to have an offline installer, or god forbid just download the headers and libraries, you need to pay for enterprise to do so. So you have two options: embrace freedom by proprietary software, or empty your wallet. If you can, build Qt yourself, or get builds from your distribution or operating system, I just needed mainline Qt so I could make sure it works with what most people will probably try building with… Big mistake.
Make sure things you say are “embeddable” are actually embeddable
Is it a coincidence that a whole boat load of changes came to crow the minute I picked the text editor job back up? Crow got a whole lot of things, including CMake support (hmmm… doesn’t Qt use CMake…) and in general just refining the structure of how things are stored and accessed to allow for crow to be built much easier into a shared or static library for use in other platforms. Eventually when I start making AIs and robots in crow (when I finally make the move away from the dreaded JavaScript abomination), you’ll probably see a multitude of fixes and changes in those as well. Funny how that works.
Just don’t make a text editor in 2022
Now this one may seem anticlimactic, but just don’t do it. Text editors are a dime a dozen now, and chances are you can pick up and maintain one that is exactly what you’d like and maybe more with less time commitment than doing it from scratch. Now I say this with compilers, that there is a great deal to learn from making a text editor, but to be honest, you can create far more useful applications, such as a rich text viewer or chat client, and use the same skills a text editor would use, and maybe even expand on them. Personally I have hated writing a text editor, but I’m doing it for completion at this point. I’ve said I’m going to do this for years now, and I’m damn well going to do it.