Lazy coding done right

When performing a task, even if it's a one-off, I believe it's a mistake to approach it with a short-term vision. We might solve many problems just for one occasion, but that's the nature of any project; each one is unique and happens only once. Should we really ship it with a short-term vision and skip automation, documentation, and testing just because they require more effort? Should we be so lazy?

I believe being lazy can be a good thing, but we shouldn't be so lazy that we skip essential steps like testing, documentation, information processing and retention, automation, collaboration, asking questions, and improving processes. These efforts will surely pay off for our knowledge and efficiency, or if not for ours, then for the team's knowledge and efficiency, for maintainability, and to reduce tech debt and bus factor. Of course, that requires thinking like a chess player, calculating our moves, and doing some planning.

For example, during an infrastructure migration, we faced many integrations that needed testing from the ops side, yet we lacked internal QA expertise. We rushed to collaborate with others to gather information on testing their flows. Even though we didn't have time to write automated tests immediately, I documented all the information so we could use it for future monitoring and automation purposes.

Another instance is our workspace setups, which were initially painful, yet many developers accepted it. When I had to use their setup script, I found many outdated or irrelevant steps and undocumented instructions. I automated those steps and fixed the instructions. Now, newcomers recognize the value of this, and even people external to the project can set it up without prior knowledge, saving days of effort and enabling easier contributions.

When I have to do a task, even just once, I try to make a script and document it. If I have to do it more than once, I try to automate even more parts. Each time I return to a task I'm becoming too familiar with, I feel the urge to improve the process, document and automate it, make it configurable, flexible, shared, robust, and efficient. When performing repetitive operations, I script them, always. At least partially if not fully. If mistakes occur, the fixes are likely to be automated or documented.

When asking for help, I provide context, and when doing something useful, I share the news or update the docs so people can be aware and benefit from it. I often receive positive feedback for this approach, as people start to realize that automation is more efficient, forgiving, and less risky than repeating operations manually.

Sometimes it's more tempting and fun to spend two days automating something rather than spending an hour running an imperfect automation hundreds of times. You have to balance the pros and cons of fun versus efficiency, depending on your priorities. However, it's risky to automate something you don't fully understand. You need to acquire some level of expertise in a topic before embracing automation and contributing improvements. It's dangerous to automate something you don't know how to run, debug, or test manually.

LLMs can help automate tasks, but you should be able to code and debug without them. You need to perform a task fully without LLMs or scripting before attempting to script it. It's good practice to study the documentation, API, and man pages of the tools you use and learn to troubleshoot effectively.

I believe every second counts, and even if we're solving a unique problem for the first time, the knowledge gained is worth documenting. This way, we can extract a process or history from it, which can be helpful for us, our team, or anyone else if shared.

Real DevOps do/dont – a list

[hint: this is not a serious post, I'm sorry if you feel attacked by this]

Inspired by Google search results for "Real Devs dont" (https://www.google.com/search?q=%22real+developers+dont%22).

  • Real Devs don't use UI - they use CLIs instead (https://terminaltrove.com/).
  • Real Devs don't need an IDE like VSCode, instead they code in production using Vim (and of course real devs use Nano. No, Emacs, https://xkcd.com/378/ ).
  • Real Devs don't use frameworks, they use libs.
  • Real Devs don't comment their code, there is no time for that.
  • Real Devs don't test their code, instead they throw all changes in production to save time.
  • Real Devs don't use their trackpad, instead they do practice touch typing (https://www.typingstudy.com/) and learn every app shortcut by heart, or build their own.
  • Real Devs don't need unit tests, instead they build programming skills.
  • Real Devs don't use debuggers, instead they stare at the stack trace for hours.
  • Real Devs don't joke or laugh at work, instead they blame every failure on poor colleagues competency.
  • Real Devs don't use Website builders, instead they code in raw HTML and CSS and throw JS away.
  • Real Devs don't trust anyone.
  • Real Devs use mechanical keyboards.

Flow

  • Cannot really stop coding while in a task. Coding is fun.
  • Cannot really stop improving after solving a task. I'm in the flow and each improvement unlocks another.
  • Cannot really stop bug fixing before solving it. Interruption is frustrating and I need to kill this problem.

Related

Continuous improvement is addictive because of the desire to reach perfection and repair the broken window (cfr Broken window theory).

Thanks to Vincent L. for the thoughts that inspired this blog.

Sans

Can you live a day at work and at home "sans"?

Sans smartphone?

We used to boot a computer and even a modem and be actually productive and enjoy life without checking for news, notifications, or email every 15 minutes.

Sans version control conflicture crap due to using Git-ware conflict-friendly patterns?

We used to just work together on code and discuss code, without focusing on the version control tooling.

Sans CI/CD tools to validate your work?

We used to validate our work before committing, in the old days.

Sans markdown?

We used to be able to read and write text without non-sense formatting, HTML was even a thing.

Sans proprietary note taking digital tools (Obsidian, Notion)?

We used to take notes on paper or in our own text editors in the past and format our notes in "raw" HTML.

Sans LLM for coding?

We used to reason about code and go read a programming language book or ask for help from colleagues in case of doubt.

Sans daily upgrades and ads and other modern web crap?

We used to have nice experience with computers.

In a world that used to be simple, what other "sans" would you can think of?

The art of crafting and loving your own tools

I have learned one good lesson from tasting someone's else food, it's never salty enough and I always miss the good drink pairing or something else is missing. And I'll feel bad for making any critique or special request.

I have a similar feeling about apps, tools and platforms I don't maintain. Sure i can help fixing them with requests that will likely be forgotten in their backlog. Or I can pick an alternative product which will unfortunately lack features from the former or will have their own ux issues, bugs, weirdness...

In the end I'll flavor ones that focus on simplicity and which provide good documentation and support for data import/export and customizations through their API or through plugins and scripting.

Miniflux, Shaarli, Obsidian, Dropbox, Cloudron....are those kinds of apps and platforms I use that do a thing well yet I have customized to my taste, e.g of such personalizations:

  • Dropbox is automatically organized based on custom rules, all orchestrated through cron jobs.
  • Bookmarks in Shaarli are tagged automatically thanks to a plugin I've made available in my shaarli_plugins Git repository.
  • My apps hosted in Cloudron are restarted automatically on schedule if they stop responding, thanks to some cron jobs and Cloudron's API.
  • Music I download on-the-go from my mobile phone through Seeker (Soulseek client) is synced automatically to my storage and visible in my Navidrome and Subsonic clients; so I do not need Spotify. It is also orchestrated via cron jobs, using rsync and syncthing.
  • Notes I take on my Obsidian at work and at home are synced automatically thanks to Syncthing an Git on my personal Gitea server.
  • Miniflux is the tool I've extended the most as I've blogged in Reading RSS in peace with a few Miniflux Hacks, e.g:
    • organize the feed categories in Miniflux.
    • group items by author.
    • show stats about each feed.
    • highlight links I've already bookmarked in Shaarli.
    • add one-click buttons Add to Shaarli / Follow in Miniflux next to each link mentioned in those articles depending if it's some RSS feed or a random link I might want to bookmark in Shaarli.
    • Some of those recipes are available in my repo.
  • Email attachments related to our financial activity are archived in our Dropbox and renamed automatically based on their content, using OCR. The whole thing simplifies communication with our accountant and their software.
  • My monthly invoices are generated automatically from InvoiceNinja and I'm looking at a solution using only Python.
  • I'm also making my own RSS feeds from sources that lack one like https://indieblog.page/all and https://www.journee-mondiale.com/les-journees-mondiales.htm, I've shared the source code for indieblog and for journee-mondiale, both are orchestrated via cron jobs.
  • I keep building more, I'm working on my own tools to supplement or replace InvoiceNinja, Shaarli, Wallabag, Obsidian and Miniflux. The fewer apps I rely on, the more focused I become.

Relying on my own recipes, scheduling things though cron jobs and building my own platform saves me costs, improve my computer experience and make me more efficient about problem solving.

It also likely make me a bit lazier and annoying.

You can be more efficient too, and I can help if you like!

Contact me to learn how to master of your digital life.