programming
-
🔧 Why Go Works Well for Building CLIs
The last post discussed the importance of command line interfaces (CLIs) in the AI agent stack. The next question is — what language works best for building CLIs? Consider the requirements: Often a CLI needs to interact with APIs. Easy to …
-
📏 Less code is not the ultimate goal
Less code is not the ultimate goal Consider the following byte to binary C program: int main(int b,char**i){long long n=B,a=I^n,r=(a/b&a)>>4,y=atoi(*++i),_=(((a^n/b)*(y>>T)| y>>S)&r)|(a^r);printf("%.8s\n"…
-
😊 Align the "happy path" in your code
An idiom that I learned in the Go community is to align the happy path. An example in C below: happy path not aligned int process_file(const char* filename) { FILE* f = fopen(filename, "r"); if (f != NULL) { char b…
-
⚖️ Code is a liability, not an asset
A wise developer once said: Code is a liability, not an asset. Aim to have as little of it as possible. This is perhaps the #1 rule for clean code. Some examples: Don’t implement “just in case” features. Remember YAGNI. Premature abstrac…
-
✂️ YAGNI
YAGNI - “You ain’t gonna need it!” If you don’t need it now, the chances you’ll need it in the future are small, or at least not the current implementation. Do the simplest thing that works now. Get feedback. Repeat. Iterations are the key …
-
🧩 Composing is hard, complexity is easy
We’ve recently explored the idea that composing simple things is the way to scale. But this is harder than just cranking something out. Some examples: It is much easier to create an Excel spreadsheet than write a Python script to process a…
-
🔄 Flipping the playbook for AI coding
A lot of focus these days is on “good AI prompts.” Some of the best prompts may be documentation and tests. Write your CHANGELOG.md entries first, then update the documentation, then write the tests, then tell the AI to update the code to m…
-
🧑💻 The first step in AI coding
✔️ Should be “How does this work?” ❌ NOT “Implement this feature.” Understanding should precede any work, especially in complex systems.
-
🧑💻 Will AI cause coding to disappear?
AI is not a binary off/on thing, like many of the industry commentators like to think. Many of us are already using AI to improve our productivity. For me, Perplexity has largely replaced Google search. Technology has always brought product…
-
Go for IIoT Systems
As developers, we have many options for programming languages. On one hand, it is great to have choices. On the other hand, it can be a little overwhelming. Many times in life, we need to make decisions before we have the experience to know…
-
The Humble Programmer
In 1972, Edsger W. Dijkstra published a paper titled The Humble Programmer. Dijkstra was trained in math and physics and was a university professor for much of his life. This paper is an interesting reflection on the history of computers an…
-
Why are Go applications so reliable?
Go does a lot of things well (good performance, easy to learn, very productive, extensive stdlib, excellent tooling, etc), but after programming with Go for three years (both embedded Linux and cloud applications), stability is the characte…
-
C++ callbacks to member functions
How to properly do callbacks to C++ member functions is something that has intrigued me for some time now. There are a number of solutions, none of which I really liked. But now with the std::tr1::function and std::tr1::bind functions, th…
-
Specialization or not
I have often wondered about specialization. We can often find ourselves in ruts if we specialize too much. But on the other hand, specialization can lead efficiencies in some cases. In my work as a consultant, I often find myself in new …