development stack
How I write code
I hope two write two posts today. I need to set things up for you all before I dive into code. I don’t know if others call the developer environment they use a stack, but that’s my term.
The reason I do this is that when I learned C#, I used what was good for me. I had Microsoft’s VS Code running on a linux machine with Dotnet Core . I was watching some learning tutorials on YouTube and discovered things didn’t work like the presenter showed them. After much frustration and arguing with the presenter, we both discovered that while I used Dotnet Core and VS Code, he used Microsoft Visual Studio and .NET. The two were not the same, though now they finally are the same. Since then, I am careful to note what I am using so that others will know beforehand.
OS – Linux
First, I use Linux. I am not totally averse to Microsoft Windows, but I find that my style of development does not do well on that OS. No, I am not a Mac person. Apple is not better, it is only a bastardized Unix in disguise. I have used Ubuntu, Redhat, and Fedora in the past. Right now, I am running Almalinux . It is also not better than other distributions, just my choice right now.
Editor – Neovim, heavily altered
I have used several different editors over the past few years. I started out using VS Code around 2020. It was simple and easy to install on Linux and it had a good ecosystem for most jobs. However, the deeper I got into using it for Java, I discovered that it couldn’t handle the load and would bog down severely.
I switched to Intellij for quite a while, even through my coursework in Java. I ceased using Intellij when they decided to turn on JuliaAI for everyone and I couldn’t get the AI to stop. More about AI in a minute. I knew about Vim , but I didn’t see the need for just an obtuse way of writing. I liked my mouse.
However, I finally broke down and installed NeoVim . It wasn’t easier, but the ecosystem seemed better. I modified it according to one person’s set up for Java, but it was quirky. I put it down for some months, but then found a YouTuber named Vhyrro . He had a set up for NeoVim that worked much easier. He also spent more time explaining how to set it up.
After getting his setup going, I found NeoVim equal to any IDE out there, and I know how and why it works. Since then I have modified it even more. I have all the features I need: syntax highlighting, intellisense ( a little trickier to use than others ), and LSP’s for my languages that are usually spot on for mistakes.
Compiler - gcc
What can I say. You dance with the one that brung ya. GCC is installed on nearly every linux distribution as a default. It has everything one can use. It compiles C and C++, can cross compile for ARM, links to standard and installed libraries and will help you build your own. It can even take in object code from an assembler and link it to an executable, with or without standard C libraries.
I only code to C99 ANSI standard. The only reason I don’t use C89 ( original ANSI C ) is that I like declaring loop integers in the for loops. I also use most of the error checking that gcc provides ( -Wall -Werror -Wpedantic ).
Build system – Make, Gradle
Yes, I can already hear the complaints. Too old. Too antiquated. But, I find that it is easier to learn and remember. It is no more complicated than bash and I know everything it does. In addition, make can do many more custom things such as setting up installs, handling clean up, and logging what happens.
If I need something more, I write a bash script to handle it.
For Java, I use gradle, but I use the command line for my tasks. I have a custom gradle settings file that does what I need, handles tests, test reports, and supplies me with a ready to execute jar file.
Make and Gradle can be installed from any linux distribution repository. Rarely would one want to download and install separately. Though, I did for Gradle.
Testing
Despite even my own lack of motivation on writing tests, you need to learn to write tests. Tests aren’t as scary as they sound or look. Nor are they really to prove your program works. They serve two primary functions, prove most edge cases won’t catch you sleeping and ensure future you ( or someone else ) doesn’t write something that breaks your hard work.
I use JUnit in my Java code and I wrote my own test framework for C. You can get it here . I’ll do a whole post on it soon.
Version control – git and codeberg.org
There is nothing more frustrating than all that hard work disappearing because of a mistyped rm -rf or a bad hard drive. Git will save your bacon. Git commits pushed to codeberg is even better. I will be writing on both of these as well. You can use Github, or any other of several if you wish.
Honorable mention – tmux
In the world of larger monitors and multiple monitors, this becomes a toss up for many. I have only one external monitor and my laptop screen. I don’t really like typing and looking left. I prefer to use my laptop monitor to code. But, I often have other needs. I have neovim up editing, but I may need to compile or check something in the file system, or ssh into my server, etc. Tmux helps me do that. It’s a multi-screen, split-screen wonder. Though, on my smaller monitor, I usually stick to multiple windows. It can also be customized and I have some of that, too.
Tmux is usually available in the linux distribution repositories if it isn’t installed on your system.
The big question – Artificial Intelligence
Ok, I saved this for last. Yes, I do use AI in helping to code. I do not “vibe code”. As I stated earlier, it’s expensive and not helpful since I still consider myself a learner.
Writing your own code from scratch is not that hard. And, I find ways to limit some of that with personal libraries and templates. I don’t repeat inventing the wheel each time.
I use the free chatGPT. I have used the same context for over a year. It is tuned to what I wish and it will not just dump code at me. I also use Gemini some. Mostly, I’m using Gemini to find out the simple ( “How do I do x?” ) and I use chatGPT for ideas and direction ( “What is the best way to accomplish this?” ). Keeping them separate means I don’t corrupt chatGPT’s context for things that I might want a code dump given to me.
In reality, I have come to learn that the LLM’s we use, trained on much of the Interweb’s data can summarize and pull together information much better than myself just randomly searching.
The sum of its parts
The main take-away from this post is twofold: do what makes you code well and easily, and realizing that writing software is more than just writing code and compiling. The editor, compiler, build system and many things make up how one writes software. Each part of the whole needs to be thought out and, you, the writer needs to know how it all works.
It is easy to develop a friction point in your developing that makes you have to figure out how to reduce the friction. You are a problem solver and not all problems exist inside the code. Finally, never think that you have to find someone else’s solution to your problem through another IDE, build tool, or language. Doing it yourself is very often the best, most satisfying solution. Once again, happy coding!.