Magic is problematic

I deal with computers, hence I want things to work the most boring and reliable way possible, with automation, procedures, scripts, not through magic.

Hence, while I love tools such as Atuin, I've a problem with their slogan "Making your shell magical" and generally speaking with any product using such selling argument, especially AI LLM-based products.

For this reason, I'm usually against any kind of black box and one-for-everything tools and platforms that want to ease our lives by hiding the complexities. I think that the only result we get out of those abstractions is complexity, pain, and a culture of incompetence and dependability. I mean, if you want to deal with technology, at least you should understand it.

In the end, it's not all magic [1] [2], but it can feel magic for sure once we lack understanding. Magic feels shiny and appealing after all, its antonyms say it all.

Let encourage everyday users to look inside the box and understand what is happening, even if not everyone is going to switch to Linux, even if debugging is not easy.

At work, there exist an onboarding procedure targeted towards new developers in the team, and this procedure relies on scripts which were left untouched for way too long. The bad things : the procedure is broken but nobody dares to fix it, instead the old timers in the team share dirty hacks and workarounds with the newcomers.

Once you face such problem, the only solution is to address the root causes, not the symptoms. I choose to take a look at the procedure, run it again and again after each attempted improvement, cut it piece by piece, shred or rewrite what seems unreliable and suspicious.

Magic exists, but I’ve never seen any in software. Problems are logical. Nothing is impossible. You can solve this problem.1

As a software engineer, please don't fix symptoms. Don't get too used to deal with crap and unsolved problems. Don't be lazy, don't accept the status quo, make the hard work to understand and solve the problems. Set your focus on understanding things deeper. Enhance your and everyone's knowledge. Be a firefighter against ignorance, and help educate your peers to be better at understanding why things work or doesn't.

Thank you.

HN Comments.

  1. https://catskull.net/thoughts-on-debugging.html β†©οΈŽ

Prompt hacks aka make the best coding out of GPT

I've been using a paid subscription to ChatGPT Plus since May 2023 and I'm still happy with the usage. It's one of those tools you have to master to get most of the time spent with it. There are a lot of benefits to use it, of course there are also negative aspects and bugs. Some of them can be mitigated, and that's the purpose of the current post.

Disclaimer / Context of use 🧾

  • I'm ChatGPT mostly for scripts and each conversation is focused on singular topics, i.e single-file codebases if possible.
  • I don't use Open API Keys and I'm not interested to use OpenAI directly. I've been on a paid plan for OpenAI and was charged way too much for my needs. I advise anyone to use ChatGPT Plus which remain to this day worth it and good enough both for personal and professional.
  • This article was not written nor reviewed by AI/ChatGPT.

Lessons learned - Do βœ…

  • Timebox your interactions with ChatGPT. If it takes longer than you expect to reach a solution, stop and do your homework instead.
  • Test test test after each change. ChatGPT will make you lose faith by repeating the same mistakes, by removing sensitive code, by providing incomplete solutions, always verify.
  • Before running or committing anything generated by ChatGPT, always compare with the previous situation you had. Git diff the result of changes. If you have any doubt about a specific change, submit the git diff to ChatGPT for review and ask for explanations while also explaining why you have doubt (failing tests, errors at runtime, weird code removal, ...).
  • Tell ChatGPT to always decouple code in functions.
  • Instruct to use minimalist code, and avoid comments in code, respect your specific style (if you provide examples), instruct to write the code that takes the least amount of lines and space and to avoid long functions.
  • Keep one conversation per context / type of problem / flow. Once done with the problem, validate the solution (test!), commit locally, and delete the conversation to keep your Chat history clean.
  • Try to limit ChatGPT's attention to one single file or one single function at a time, to improve its speed and accuracy. I've experienced inconsistencies and code regressions when expecting ChatGPT to work with too many files and too many changes at once on too many files, as then ChatGPT.
  • If you have lot of work you expect ChatGPT to perform for you, be patient and request one change at a time, then review the outcome, and only if it's validated, move to the next. ChatGPT sucks at multitasking. Keep the rest of your TODO list somewhere else to keep track of what remains to be requested from ChatGPT.
  • You will be given better results if your tech stack relies on popular libraries and programming languages so keep that in mind and be prepared to deal with more mistakes if you pick niche programming languages.
  • Ask to only output the code that require change, e.g add this at the end of your prompt :
    just output the function(s) needing change
  • If you really want to multitask, open multiple ChatGPT sessions (browser tabs) in parallel, each focused on distinct changes, so you can multitask while ChatGPT stays focused on single tasks πŸ™‚
  • One change at a time. If ChatGPT keeps making error, step back, restart from to the latest stable version of your code, and ask to make minimal changes, step by step, while you validate each increment.
  • When happy with your changes, ask ChatGPT to improve its performance or clean the code.
  • When debugging your code with ChatGPT, provide stack traces, inputs, outputs and even complete your input with the copy of the code that seems buggy (based on the stack trace).
  • Be suspicious if ChatGPT changes your code way too much or introduce weird changes to dependencies. Review, check, investigate.
  • ChatGPT will likely be interesting to use only for writing very small and boring scripts to batch automate some tasks. But you are responsible for the whole, do not forget that. And test. And understand the code. Make it easy to understand and debug. If you can't explain it, rewrite.
  • ChatGPT could be good at documenting tasks or at writing tests.

Lessons learned - Avoid ❌

  • Don't trust ChatGPT outputs. OpenAI is known for dreaming and also tends to complexify solutions to simple problems.
  • Don't run nor commit anything generated by ChatGPT that you don't understand and always compare ChatGPT's solution with what you had before.
  • Don't ask too many improvements or bug fixes at once or be prepared to deal with many new errors and regressions.
  • Don't keep conversations for too long, as all the initial context will likely be forgotten about by ChatGPT and you will suffer, also it will cause a lot of scrolling and augment the size of the web page which will be slower to load and will likely crash your browser tab at some point.
  • Don't switch context / files / problems in the same conversation. It's a waste of time and you will suffer later when trying to source specific content or make sense of anything.
  • Don't share secrets/passwords with ChatGPT.
  • Don't waste your time when the LLM seems confused or unable to solve your problem. Either reshape your problem statement or restart from the latest known stable state, ideally in a new conversation. Be confident in your own abilities. Don't be too dependent on any LLM. I once wasted a whole evening and night trying to get ChatGPT to write the solution for me then trying to use it to fix the problems it caused, I was too lazy to code something by myself from the start.
  • Don't expect ChatGPT to be as efficient on big codebases and complex problems as it is on small scripts and simple problems. So use it more often for the latter and keep the fun of solving the big problems yourself.
  • Don't expect ChatGPT to understand a single thing you do nor why he generates his code. it's a dumb machine without creativity built in. It has to be treated as such and with caution.
  • When trying to help you fixing problems caused by its previous solutions, ChatGPT may enter and endless loop of replacing one solution with another, without understanding the context. Before copy pasting anything from ChatGPT, make your own investigation and check the logs of the apps that do not behave as expected, before touching the code. If you find interesting logs, then provide those to ChatGPT or make your own investigation. Do not depend on ChatGPT for too much grunt and research work. You are better than that.
  • Don't expect ChatGPT to run well and fast on huge bloated scripts. That should encourage you to decouple your code into functions and modules and specialized files/modules/components/...

Relevant references

  • ChatGPT could be used to address the fact that solving some problems is costly in term of engineering. This XKCD meme below should be likely made obsolete if LLMs are used to provide the programs to automate the tasks. For instance when faced with some painful work, I rather use LLM to write me a script to tackle the task. It will be faster than me on some occasions, which itself help removing the need for manual work for tedious tasks, also help removing the need to prompt LLM in the future for that same task, since the script is already provided.
Automation (by XKCD)

Legend: "I spend a lot of time on this task. I should write a program automating it!"

via https://xkcd.com/1319/

is It Worth the Time? (by XKCD)

Legend: "How long can you work on making a routine task more efficient before you're spending more time than you save? (across five years)"

via https://xkcd.com/1205/

Extras

  • If you lose focus on the ChatGPT session in your browser, it's likely the calculation process will interrupt.
  • ChatGPT seems stuck at generating the output ? Refreshing the page might be enough, in other cases ChatGPT might automatically continue the generation or will show a button you can hit to force this action.
  • I've commented on this topic and this post at https://lobste.rs/s/7a3qhh/how_s_your_experience_so_far_using_llms_for#c_igssaj
  • I recommend trying ollama so you can work offline and without feeding all your sensitive data into OpenAI.

Thank you πŸ™‚


Quick Bugs, Slow Fixes

The 🐒 engineer has good guts but often seems slow compared to the 🐰 engineer.

The 🐰 engineer is quick at decision and gives impression of progress to the product owner often disappointed with the slow pace of change of the 🐒.

The 🐒 is busy battle testing the draft he's about to integrate in the product, suddenly he finds out the new bugs were introduced recently by the 🐰, and decides to postpone his work while focusing on debugging the shit.

In the meantime, the customer complains because of the new bugs introduced in latest release by the 🐰 engineer.

The product owner is worried and decides fixing this bug is a priority.

  • The 🐒 engineer was already investigating the bug and proposes a fix.
  • The 🐰 engineer cannot wait for the 🐒 to fix the bug and already merges new changes in the stable branch so the new release will not only be bug free but also deliver new quality shit.
  • The 🐒 is busy integrating and retesting all the new changes made by the 🐰 as it seems those changes includes critical changes of the core authentication layer and library updates that had nothing to do with the features the 🐰 was working on.
  • 🐰 lacks time for testing for side effects, so his changes bring bugs πŸ’©, whatever, at least code is delivered, whether it works, that is someone else's problem (🐒 of course).
  • The 🐰 becomes impatient at the slow 🐒 and decides to create a hotfix πŸ’₯ and deliver his changes to production.

The customer is still unhappy 😠.

Ignoring the new bugs, the product owner finds it's time for 🐒 to deliver things too, but is happy the 🐰 is done.

The 🐒 will be busy with kids at home while also thinking about all new bugs caused by 🐰.
The 🐰 thinks and claims 🐒 is not delivering and working enough hours.
The 🐒 is tortured with this lack of teamwork and with all the shit πŸ’© that is being merged in the codebase by the 🐰.
The 🐰 says it's time to hire more people and he knows other 🐰 who can help and it would be nice if the 🐒 worked more like 🐰 is doing.

The 🐒 suggests to focus on quality and teamwork and slow down but the 🐰 and the product owner look at him suspiciously.

The product owner suggests the 🐒 to consider leaving the team if he's not happy with the way things are. Because in the end, speed and working long hours are important even if results are not perfect.

🀦 "fuck this shit". A few weeks later, 🐒 has left.

The 🐒 is working in a good team nowadays 🀲, where testing is a thing βœ…, quality is under control πŸ‘Œ, documentation matters ✍️, and collaboration is a foundation 🀲πŸ’ͺ.

Related

How the situation should be managed instead by the PO / Lead.

https://workchronicles.substack.com/p/comic-be-like-bob-he-works-long-hours

Don't be like the 🐰-> See broken window theory.


Reflections on Change: The Constant Shuffle

Change is a constant.

I passed 37 years recently.

In 2022 I was going freelance after 12 years of employment. Why ? Because I had been so disappointed by many years of employment, bad managers or politics, I needed to feel like I gave the credit myself deserves. I now feel after one year I would like to help and mentor other people to go freelance.

My toddler (2.5 years old) is going to school and I drive him at school by bike. The more I invest time with him that I don't spend at other crap, the deeper we connect. But crap is everywhere and trying to steal time from us. Seeing him growing so much reminds me of the time passing and the need for me to lead by example.

I learned from hundred of hours spent crafting my LinkedIn profile, sending/receiving tens of thousands of LinkedIn messages, crafting my resume, interviewing for hundred of jobs. No matter how long we play this game of finding the ideal job and finding the exact rates, conditions, etc we deserve and want, those variables keep changing a lot and are difficult to correlate with ideal job. In the end it's not about the job but about who we are, what we need from life, what we really want to do on a day to day, what kind of problems we like to solve, what kind of people we want to work with, what kind of team we want to shape. The ideal job is a rare combination of hidden variables and is a constantly changing problem that requires gut feeling and experience, like finding the perfect taste in coffee / espresso / beer is a never ending game.

As part of this I've removed a lot of my previous job criteria at to recruiters to keep things simple.

Outside of work, I also made a lot of sacrifices, at least choices that I regretted. For the sake of trying to please or do the right thing, I got in trouble a few times. In the future I have to stand for what is worth to me, and trust my gut feeling. I'm always willing to make compromises as I'm a Belgian and we excel in this ! but I also have to set boundaries and speak the truth and take distance at need. Before this post, I struggled to start writing. Speaking of which, I even thought of using ChatGPT to help with the task. ChatGPT has clearly influenced radically the way I interact with the web and the universe of problems, including code but not only. It drastically revived my interest into technology. But it also obvious there is a long way before AI can supersed us. A good tool is nothing without a creative mind and some persistence. And a good mind needs to express, otherwise it's best to just play sudoku alone.

And that motivates me to write. And I make no promises, but to write for myself πŸ™‚ and share things.

When working from home is toxic

Before the pandemic, one would regularly question whether working remotely could replace working in the office, and the lockdown helped to discover the pros and cons of each in the long term. The pandemic happened and suddenly legions of influencers advocates for work-from-home, trying to convince you that to get any work done, you should stay at home. As companies praise workers to return to the office, many employees have joined the great resignation. I'm happy that numerous workers have resigned from unsatisfying jobs and are looking for better work cultures, but I don't believe working in the office is the problem.

Recently, artist Irina Blok authored a few charts about working from home and the pandemic. And the one below really caught my attention as a parent and as someone subject to heavy mental load.

Irina Blok tweeted about remote working benefits during the pandemic. Someone else fixed it.

My concern with such a chart is that not everyone has a home office that looks as good as a traditional workplace. In addition, interruptions happen at home too and chatting with coworkers is not a problem per se. Hopefully, someone else in the internet partially fixed the chart for me. Working from home can have as much negatives as working in the office, and those can include things like :

  • Inconvenient office setup
  • Noise
  • Lack of private office
  • Mental load
  • Interruptions and distractions
  • Home office costs
  • Lack of socializing
  • Insufficient face time
  • Overworking
  • Increased sedentary lifestyle
  • Lack of room for self

Inconvenient office setup

At the office, you have your dual screen, a large desk, a comfortable chair, meeting and relaxation rooms, places for isolating yourself from your coworkers. On top of that, the internet connection is awesome and there are free snacks, drinks, fruits, and a top-notch coffee machine. If I want to mimic the benefits of working in a professional office, I'll need to invest in a bigger place and better material, or move to a co-working space.

Noise

In the last few months, our rental contract ended. It happened before the building of our future apartment could be achieved, as unfortunately the pandemic affected the whole construction sector. Our temporary solution was to rent a place via Airbnb. We are happy with the spot, however we ignored that the neighbors were renovating their place for the past 12 months. We have gotten used to it, but as hypersensitive persons, my partner and myself struggled a lot with this. We learned patience the hard way by being subject to intense noise any time of the day, any day of the week. Welcoming our new-born in this stressful environment was the last thing we wished, and often baby naps turn out to be impossible. When you need to work, it's the worst type of nuisance as you cannot focus. I simply prefer to stay muted in most Zoom meetings.

Lack of private office

In this Airbnb, I don't have any private space. I'm often working in the laundry/storage room, or at other times in the living room. It means that when the little one is sleeping in the living room, which is the next room, I have to stay silent and I'll stay muted in meetings or just skip them.

Mental load

Working at home means I'm even more aware of the household chores, and I'm thinking constantly about them from the beginning until the end of the work day, so it's harder to focus on anything else. In addition, as a new parent, I'm even more focused on others needs, i.e the constant well-being of my toddler. But while I'm trying to be 100% available as a parent and partner, I'm also very committed to my career. As a highly sensitive person (HSP), I do experience sensory overload and emotional flooding, and the home office is just too distracting for me. When I have to interrupt some work related task, I feel stressed as I tend to think that my colleagues spend 100% of their time working, which is unlikely of course, and I fear to be unproductive. And when I'm working, I feel it's unfair for the other parent to do parenting alone without any break or rest.

Interruptions and distractions

The mental load has consequences. When I leave my home office room, I become prone to be distracted by jobs to be done. While constantly switching between work and home tasks, it's harder to focus 100% on work. If I take a break and start taking care of the toddler or handling household chores, I might easily forget about the next meeting. As I'm at home, it's also easier to reach out to me for my partner, the family and other visitors. On the long run, those factors prevent any type of deep work, which is endangering productivity and motivation.

Home office costs

Who is paying the bill when you consume twice more energy for all your work devices, monitors, the light and the heating ? Who is paying for the internet connection, the coffee, extra drinks and meals, printing, writing material ? Since I've started to work 100% remotely, those costs have increased while remaining at my expense.

Lack of socializing

Among my Facebook network, 70% of my contact (excluding family) are people I've met in the office or during my studies. I'm not an extrovert, but I do enjoy social interactions. I'll likely start a discussion around the coffee machine or in the office corridor, or with a colleague in my field of view, and this creates opportunities that I'll miss while working remotely. In addition, if your company culture is not encouraging remote social interactions, you might feel as isolated as I was during the lockdown. In my last employment, the pre-lockdown era was 1 year and 2 months long, and it felt way richer and interesting than the following 1 year and 4 months period of remote working. I couldn't have the chance to meet my colleagues in person, and when you're the investigative and social type of person, you build way more energy, inspiration, satisfaction and motivation when interacting with people in person.

This period of 1 year and 4 months was a long time without any team building. It was also poor of opportunities to connect with the new joiners, the new boss and the team buddies. With a few exceptions, most of the meetings and discussions rotate only around work which is adding to the general stress of working remotely and contributed, among other factors, to ruin my motivation.

Insufficient face time

Even if face time still occurs, it's happening less often or at least with less than ideal conditions. Some tips can make it better, but video calls are a trade-off and not the solution. Zoom/Meet/Team calls will never replace the in-person interactions, especially if we take bad habits such as enabling blur effects or virtual backgrounds which give the feeling of talking to a floating face.

Overworking

The lack of work-life balance and suggested breaks are the point here. There is no emergency to close your laptop and start commute back home when you are already in your place. The temptation is great to keep working a bit more. Everyone can simply reach out to you more easily to get some work done. Of course you can find arrangements to keep yourself away from the work pressure, but it's just harder than when the physical separation was in action. It has never been easier than nowadays to connect to work from anywhere, and now you have to constantly remind yourself to resist the temptation. Reminding yourself that you are at home and not at work ? Easier said than done when both places are the same.

Increased sedentary lifestyle

It's up to me to fight this, anyway the daily commute in addition to the regular travels in and out of the office, to grab a lunch for instance, helped people like me to move way more often.

Lack of room for self

Sharing the same living and working space than your loved one is a gift but can be exhausting. In the long run, regular separation can be beneficial to having something like a reunion. Spending all your time in the same space as your life companion can be challenging as it means you have never time alone and you depend constantly on the other noises and moves. It is clearly not for everyone, especially when you are independent. The pandemic forced us to deal with this situation and we are flexible enough to survive. We even manage to give each other some time alone. However, staying at home all the time is not compatible with our need for autonomy in the long term.

Is it that bad to prefer working from home ?

Not at all. Wearing the hats of a parent and an employee, I am fully aware of the pros of working remotely, especially when it comes to productivity, flexibility, and parenting, and this will be the topic of a future post.

That being said, I'm advocating for working in the office, as I consider it has long term benefits for my career, professional network, work-life balance, socialization, productivity, teamwork and motivation. And I believe that working from home cannot beat those perks in the long run.

If you want to discuss, please comment πŸ™‚

Updates