Live data from Hacker News

Ask HN: How do I program with more discipline and less emotion?

news.ycombinator.com

1–10 of 15 posts

Ask HN: How do I program with more discipline and less emotion?

#1
I'm used to being a hacker. I like doing 48 hour programming "binges". These were incredibly effective and I could often build more in those 48 hours than most people would build in a month.

It worked great when panicked, but as I get more senior and used to the heavy pressure, it doesn't work any more. I have a more comfortable life now and failing projects is not as bad as they used to be. So it's hard to dig up the emotion I used to hack long hours. Now I just end up staring at the code for 2 hours at 2 AM.

Besides, exhaustion kicks in and makes me less effective in the long run. And it doesn't scale as well with a team.

I find disciplined techniques like Scrum and XP appealing. I know I should start adopting them. But a part of me worries that my hacker spirit would die out.

So how would I go from being a code berserker to being a more organized, disciplined, professional programmer?

Re: Ask HN: How do I program with more discipline and less emotion?

#3
post #2

You have the opposite problem. You need more emotion. It's the emotional connection to your work which enabled you to go on those binges. With no emotional connection, you wouldn't be driven to do any programming at all, let alone in binges.

I mean I'm reaching the jaded, cynical senior programmer attitude where I just can't muster up the emotions. There will be a few, but not quite the extreme, startup mindset. So I'm looking for a way to migrate to a style where I can do without them.

Re: Ask HN: How do I program with more discipline and less emotion?

#4
post #3
post #2

You have the opposite problem. You need more emotion. It's the emotional connection to your work which enabled you to go on those binges. With no emotional connection, you wouldn't be driven to do any programming at all, let alone in binges.

I mean I'm reaching the jaded, cynical senior programmer attitude where I just can't muster up the emotions. There will be a few, but not quite the extreme, startup mindset. So I'm looking for a way to migrate to a style where I can do without them.

Look for a different job? Work with a different team? Change your mindset from programming focus to a customer story focus? Start your own business?

If you don't feel driven within the environment that you're in, maybe it's time to look somewhere else. Or maybe it's okay not to go on these binges. Maybe it's best to scale back and put some of that energy into something else, like family, hobbies or whatever else might capture your interest.

Since we only get one shot at this, I think it's more interesting to change things up. We don't need to walk the same tired ground. There's always new territory to operate on. New challenges. Maybe your current situation is your gut telling you that you need to start working on different metrics rather than raw programming output.

Re: Ask HN: How do I program with more discipline and less emotion?

#5
I also used to love "binge programming", a kind of hyper-focused/obsessed productive phase, but I totally agree that it gets exhausting with age and not sustainable in the long run. In fact, for me it creates occasional but fairly regular cases of burn-out. I'm still learning to become a more disciplined programmer.

These days I'm trying to "stretch out the binge", so it's less extreme ups (and downs), rather a more long-term sustained focus and interest.

I'm in no position to give advice, but part of your solution may be emotional and intellectual engagement with the process of programming, the tasks at hand and the problems to be solved. Also, as a programmer, you might enjoy building such a system as Scrum/XP/etc. that suits your situation best.

Re: Ask HN: How do I program with more discipline and less emotion?

#6
post #5

I also used to love "binge programming", a kind of hyper-focused/obsessed productive phase, but I totally agree that it gets exhausting with age and not sustainable in the long run. In fact, for me it creates occasional but fairly regular cases of burn-out. I'm still learning to become a more disciplined programmer. These days I'm trying to "stretch out the binge", so it's less extreme ups (and downs), rather a more…

Actually, I might just end up building my own system. I'm surprised that solution never occurred to me, as I've been trying hard to squeeze existing methodologies into my life and it doesn't work.

I've had a lot of admiration for military techniques and how they train people to get past fear and drop bad habits. I'll probably adopt a mix of XP and some military techniques.

Re: Ask HN: How do I program with more discipline and less emotion?

#7
Productivity isn't about writing lots of code.

For example: if you spend 48 hours writing 10,000 lines of code, and then I produce same functionality in a normal 16 hours of work, with just 1,000 lines of code. Who is more productive?

So instead of focusing on writing lots of code, focus on solving problems. The less code it takes to solve a problem, the better off you are, because that's less code to maintain.

This attitude (explained in more detail here: https://codewithoutrules.com/2016/08/25/the-01x-programmer/) then leads inevitably to the idea that working long hours isn't actually useful, nor is working at 2AM a good idea. The best way to be productive is to think, and that is easier when you are well rested, and works better if you take breaks and go do something else (https://codewithoutrules.com/2016/11/10/work-life-balance-so...).

Re: Ask HN: How do I program with more discipline and less emotion?

#8
post #7

Productivity isn't about writing lots of code. For example: if you spend 48 hours writing 10,000 lines of code, and then I produce same functionality in a normal 16 hours of work, with just 1,000 lines of code. Who is more productive? So instead of focusing on writing lots of code, focus on solving problems. The less code it takes to solve a problem, the better off you are, because that's less code to maintain. This…

I quite like the point of the article but I have one issue with it.

It begins by focusing on "producing times ten" and then goes on to equate that with "lines of code times ten".

The issue with that is lines of code isn't production. The real production is the value behind that code. If you do the same thing with a tenth of the code, you _are_ producing ten times more.

Re: Ask HN: How do I program with more discipline and less emotion?

#9
Emotion is what makes you strive to do a good job. Caring is an emotion and caring about your work is an important quality to have.

Which would you prefer? A programmer that knocks out am untested Italian food stuff thousand line function or a programmer that takes care to structure the code such that it's well tested and factored?

Re: Ask HN: How do I program with more discipline and less emotion?

#10
One of my main complaints about cs in university is that they didn't teach how to put their effort and energy into their projects in a healthy and sustainable way. Many students ended up learning the 'magic binge' approach you're talking about.

It depended on that seemingly random lightning bolt of inspiration combined with almost manic mental energy to work crazy hours to get it done. If you've ever worked through the night, met someone who _expects_ future crunch times (aka. binges), or put off working on something important because you just weren't feeling it right now, then you know what I'm talking about.

The closest analogy I've found is writing. Experienced professional authors most commonly give out the advice to work on it consistently, every day, whether you're feeling it or not. I feel like that heavily applies to programming too. If you care about a project, for work or for your self, you've got to make it part of a routine. Pick your days and time that you're going to work on it, then sit down and work whether you're super excited and have 'flow' or not. I think that after a short amount of time each session, you'll find you are creating the inspiration rather than waiting for it to find you.

Post reply on HN