Posts

Showing posts with the label best practices

Code Hygiene in the Age of AI Pair-Programming: Lessons from a Real Codebase Review

  Why "hygiene" and not "quality" Code quality is a big, fuzzy word. Code hygiene is the practical subset of it — the small, mechanical habits that keep a codebase healthy over time: consistent naming, sane file organization, dependency discipline, and the humble but critical CI gate that catches mistakes before they ship. None of it requires deep architectural genius. All of it requires consistency . This matters more than ever now that a growing share of code is scaffolded by AI copilots and written by developers early in their careers. AI-assisted code is often locally excellent — a single function, a single file, will look clean and idiomatic. What it doesn't automatically give you is global consistency across a hundred files written over many sessions. That's still a human job. I recently reviewed a FastAPI backend built almost entirely this way — a junior engineer, working with GitHub Copilot, building a conversational AI product. The architecture ...

What most programmers need to learn - Basics of Programming

The main thing programmers need to learn is self discipline. The discipline to always write the clearest code you can, the discipline to re factor code if it becomes muddy through changes later in development, the discipline to remove unused code and add comments. What you think is important in being a good programmer and the usual answer is code should be clear, understandable and maintainable. But it is very rare to actually consistently follow through with that. Keeping this in mind requires self discipline, because it means not stopping "when it works". If all the variables would have the wrong name the code could still function perfectly, but the code would be super confusing. The step from functional code to clear code brings very little reward in the short term: it worked already and after cleaning it up it still works. That is why discipline is required to take this step.  Let me give a few examples of the kinds of things I often see in code written by starting progra...