Live data from Hacker News

Developer's block

underlap.org

41–50 of 106 posts

Re: Developer's block

#41

Sleep. Best side task for your brain. How many times has this happened to me? You struggle with a feature or a bug, you think about it, you weigh the pros and cons for hours... because you don't want to start something that will set you back. You're tired, but you don't want to go to sleep until you've at least made a decision for tomorrow. Go to sleep. Now. Then you wake up knowing immediately what to do. You hardly…

I just take a hot bath… best ideas happen in the bathtub for me.

Douglas Adams was a big proponent of baths to help his writing

Re: Developer's block

#42
post #4

There's so much good advice in this article. My number one point that i learned the hard way during two decades of writing software: take breaks when your body tells you to. It's an absolute killer if you force yourself to work on your projects just because there's stuff on your to do list, new issues on Github, or whatever. Just stop working if you don't feel it.

I feel like that's great advice for people working on their own side projects. But... I'm employed? I mean surely it translates to "go on vacation" but it's pretty useless advice for days where you simply have to work and can't just... not?

I take your point as I'm retired. But I had my previous working life squarely in mind when writing the post.

"Sustainable pace" helps, which in my case came down to 37 hour working weeks, not working at weekends, and taking all my vacation (and some extra when my employer let me buy it). I know this might sound like madness to Americans, but as a Brit employed mostly by American companies, it worked fine for me.

I found that taking plenty of breaks during the working day helped. Coffee breaks with colleagues, a decent lunch break (ideally including exercise), and plenty of tea breaks. So many times I've had a good idea or solved a problem during a break, so they are actually productive.

Then there's finding other useful things to do which aren't as taxing as the thing that's blocking you (e.g. the next large feature). Fixing bugs, writing docs, and doing preparatory investigations about the upcoming work are all productive ways to give yourself a bit of a mental break. (This was hardest when working in teams with continual short sprints or doing XP and pairing, but if I allowed myself to start to burn out, my productivity started to decline - essentially my brain was forcing me to take things a little more slowly in order to recover.)

Re: Developer's block

#43

The Oxide and Friends podcast [1] did a whole episode on this: Coder's Block (25 Oct 2021) [2]. It had some good stuff in it, the best of which (for me) was: when stuck, write debugging infrastructure. [1] https://oxide-and-friends.transistor.fm [2] https://oxide-and-friends.transistor.fm/episodes/coders-bloc... Edit: punctuation

Nice - thanks.

Re: Developer's block

#44

Sleep. Best side task for your brain. How many times has this happened to me? You struggle with a feature or a bug, you think about it, you weigh the pros and cons for hours... because you don't want to start something that will set you back. You're tired, but you don't want to go to sleep until you've at least made a decision for tomorrow. Go to sleep. Now. Then you wake up knowing immediately what to do. You hardly…

I just take a hot bath… best ideas happen in the bathtub for me.

I design board games and almost all of my ideas come while walking or driving. Sometimes we just need to give our brain a minimal task to occupy it and then we can more easily get into flow. This is also the same result of the Ballmer Peak / 1 Beer Buzz method. [https://xkcd.com/323/]

Re: Developer's block

#46
If I’ve had a break, gone for a walk, left it overnight, worked on something else simple for a bit and tried the other usual ‘fixes’ and am still stuck then I find ‘just do it’ really helps me. I find if I just write some code even slightly related to the goal, even if it’s complete garbage that gets deleted later, then I get unstuck. Although unfortunately even getting to that point takes a couple of days sometimes. We can’t always perform immediately on demand.

Re: Developer's block

#47
post #2

Rolled my eyes on "For experts only: don't do it yet". Shut-up already. I will do it right now because it will nag me forever and then surface will grow, and every time the new code interacts whith what-could-ve-been-optimized I will spend 5min thinking if I should already optimize it

If there's a definite performance problem and a simple solution, then sure, go ahead. But applying every optimisation that comes to mind can produce a dog's breakfast of unmaintainable code and then when a real performance problem comes along, it can be really hard to fix.

Re: Developer's block

#48

If I’ve had a break, gone for a walk, left it overnight, worked on something else simple for a bit and tried the other usual ‘fixes’ and am still stuck then I find ‘just do it’ really helps me. I find if I just write some code even slightly related to the goal, even if it’s complete garbage that gets deleted later, then I get unstuck. Although unfortunately even getting to that point takes a couple of days sometimes.…

I definitely resonate with this. Getting to the point where you can just write and try things can be a little tough sometimes, but some of my best work has been done the second time around (i.e. the first pass was just doing whatever hacky, exploratory code I needed to do in order to get the feel and shape of the thing, and then the second pass was doing it for real once I had figured it out)

Re: Developer's block

#49

> A new project and it’s going to be your best ever A good defense against this is borrowing stuff from your prior projects, alongside eventually creating templates for the most common stuff. For example, in new side projects I start, I can borrow the web server (ingress) configuration from the prior ones, same for CI pipelines and a large part of the previous Dockerfiles, sometimes even entire services with all of t…

Fair point. I often copy stuff across from one project to the next. But this point is most relevant when I'm using another language etc. for the first time and I'm tempted to try to retrofit all my previous best practices.

For example, I used to work on a mainframe product that dumped the address space to disk on a crash. Then it was possible to build all sorts of fancy tooling to analyse the dump. When I moved to a different platform, without those kinds of dumps, it was tempting to try to reinvent all this stuff, but it would have been a massive time sink (and would have failed too).

Re: Developer's block

#50
Perhaps switch languages/paradigms for a few days. If you are used to using "text-based" languages such as golang, python, c++ or java, try something like Smalltalk to freshen you up. Pharo https://pharo.org/ is a nice implementation.
Post reply on HN