Ask HN: Tricks to integrate late coding session in current workflow?
We're under quite a lot of pressure lately to finish a project by the end of Feb. Probably like a lot of you guys, I'm at best when I'm "in the flow" which often leads me to code till 3 am - 4am.
The problem is that if in my early twenties I used to be able to recover over only a few hours sleep for the next day, it seems like it is impossible for me right now (early 30's).
1/ Do you have any tricks or tips to ease the recover and have a somehow normal day after a late coding session?
I know that this approach while somehow good for work purposes is disastrous for health on the long run so:
2/ What tricks/tips do you use during your working day to minimize interruptions (so you could go at least 1/2 way "in the flow") ?
Cheers!
[+] [-] i0nutzb|11 years ago|reply
- aim to at least 6-7 hours of (continuous) sleep in 24 hours. Don't rely on the fact that you will sleep more in weekends (you won't, and even if you do, the body doesn't work this way) - try power naps: in the middle of the day, take an espresso shot then go in bed and try to sleep for maximum of 20 minutes. The caffeine will kick just when you wake up; 20 minutes is usually less than you need to go to deep sleep (so you won't wake up cranky, dizzy or whatever). Even if you don't actually sleep, you will relax for 20 minutes :)
http://io9.com/the-secrets-of-highly-efficient-napping-16809...
As for interruptions: turn off your internet connection and put your phone to airplane mode. I strongly doubt that you will have _anything_ to distract you anymore!
[+] [-] SyneRyder|11 years ago|reply
Apparently it's now free (I originally paid $10 in 2010). There is an Android app as well, but sadly it's broken on my Nexus 5 (audio cuts out after about 3 minutes) and I dearly wish the developers would fix it, because the iPhone app has been so valuable to me.
(Mid 30s dev here who also prefers to work through the night, helped by very understanding clients.)
[1] http://pzizz.com/
[+] [-] drig|11 years ago|reply
To make this situation worse, our office is very over-crowded. It's hard for me to see how anyone gets anything done.
But, we have meetings the devs need to be at. Project scoping, standups with the stakeholders, etc. Plus, major architecture decisions are made in person. So, we have a pretty strict "work from home only twice per week" rule.
How do I let this developer work when he is at his best, without excluding him from critical decisions? And, how do I encourage him to work at his best, without encouraging the lower-performing members to see it as an opportunity to slack off?
[+] [-] drewcrawford|11 years ago|reply
In the scenario you describe, you have set of inconsistent requirements:
1. A developer that works strange hours
2. A need to get everybody in the same room
3. The "perception problem", a.k.a. snide remarks from the peanut gallery.
The first thing to do is to be a good technical manager and admit that you do, in fact, have inconsistent requirements. Something on this list must change. You cannot satisfy all three.
The next thing to look at is what is the best (or least-bad) requirement to change.
The simplest option is to fire the developer. I don't actually recommend that, but it is simple. Embedded in that statement is the implicit assumption that you will never again hire someone who works odd hours, and in my admittedly biased experience, people who work odd hours tend to be good, so there is a hidden cost to that scenario.
A more complicated option is to figure out how to eliminate or reduce your dependence on in-person meetings. For example, having discussions via email or on GitHub. I would probably argue that if your software developers are having meetings more than 0.5 times per day, they are not being productive to start with, so there are reasons independent of this particular developer to study that problem. For more on this strategy, I would recommend looking at the GitHub model. [1]
Finally, to address the third issue, you need a performance review mechanism that isn't attendance-based. For example, consider mechanisms that are feature-based or deliverable-based. Attendance-based performance is bad for a lot of reasons independent of any particular developer's situation--it motivates working hard instead of working smart, and so on.
The thing to see here is that you're either going to have to change the environment or the developers you place in it. Personally, I would recommend the former, but in any case, something's going to move. The advantage of changing something now is that you get to decide what to change. If you let the situation run its course, it will change in a manner and at a time that will be less convenient.
[1] http://zachholman.com/posts/how-github-works-asynchronous/
[+] [-] anon4|11 years ago|reply
From there, have him communicate with the rest of the team on what to do - he should be able to do it via group chatrooms, conference skype calls and emails. I'm sure there is a time that's convenient for literally everybody to meet, even if not everyone will be meeting in person.
[+] [-] zellyn|11 years ago|reply
Seems like (a) if you focus on results rather than appearances, there won't be a problem with lower-performing members getting the wrong idea, and (b) sounds like you have a lot of meetings: are they really all as necessary as you think they are?
[+] [-] jnbiche|11 years ago|reply
[+] [-] vkr|11 years ago|reply
1/
2/ Books that really helped me: [1] http://amzn.com/0307465357 [2] http://amzn.com/0142000280 [3] http://amzn.com/0307463745edit: added Rework
[+] [-] zamalek|11 years ago|reply
Solid advice. Your body learns from your habits and exercise is a great way to teach it when it needs to be awake.
Another trick is regularized sleeping patterns. I had sleeping issues when I was a teenager and had some "soft" sleeping therapy. The most important thing I learned is: don't aim for a certain amount of hours, aim for specific times. E.g. Go to bed at midnight sharp and wake up at 7AM, come hell or high water. If you do stay up late, wake up at your usual time so as to not throw your clock off any more than it already has been.
Finally, if you are sleep deprived you are stupid. You're doing everyone a disservice by being that "hero" that pulls an all-nighter. Get your regular sleep and carry on with the task tomorrow: you'll finish it faster and do a better job of it.
[+] [-] peteretep|11 years ago|reply
+1 for GTD, too
[+] [-] yourad_io|11 years ago|reply
Tell me about it. I'm 30 and I'm shocked at how drastically this has changed. I recently slept for 26 hours at the back end of a largely sleepless week. Twenty. Six. Hours.
Needless to say, I'm taking it a bit easier on myself since then.
[+] [-] MalcolmDiggs|11 years ago|reply
[+] [-] woah|11 years ago|reply
[+] [-] KohgnaK|11 years ago|reply
Usually I have one weekend where I just crash and I am utterly useless but that's pretty impressive/concerning...
What field you're in?
[+] [-] devbootcamp|11 years ago|reply
[+] [-] swah|11 years ago|reply
[+] [-] kyled|11 years ago|reply
- Less is more. Getting burnt out leads to bad code and less productivity. Avoid the situation by giving realistic expectations. Ask for additional help if needed. It's important to know when to say no and provide alternative solutions. Saying yes all the time is actually unprofessional.
- You need sleep. That's when your brain is actually making connections to different ideas you thought about during the day.
- Over working can and most likely will lead to rsi (repetitive strain injury). Don't be stupid. Make sure you stretch and take brakes. I've been coding for 16 years and last two have been he'll because of it. Actually I'm considering changing careers or taking a while off. I love computing so this is a very hard choice.
- Are you guys doing incremental changes and deploying them ? Lean development? Quick iteration cycles lead to spending time developing the right thing and less wasted time on the wrong thing. Plus, people are much happier when they get what they want in pieces.
[+] [-] KohgnaK|11 years ago|reply
Since i got an ergonomic keyboard, slowed down my typing pace (whilst aiming to do less typos) and generally try not to use my mouse at all everything's fine again but it scared me a bit.
I'm trying to have small incremental changes but it is pretty difficult sometimes as I have to deal with user support / management tasks and sysadmin tasks on top of my dev duties. Small institutions, yaaaay!
[+] [-] eswat|11 years ago|reply
So I’m not a night owl and can’t code into the evenings like you. I prefer to get up early and plow through stuff in the morning. What has helped was figure what I absolutely need to do in the morning to get myself in work mode, just do that, and leave the optional BS out the window. So that means on most days I’m working, I wake up, grab a snack, head to gym, show, then head to a coffeeshop and work my ass off (except now I guess; I’m on a quick break :P). Unless absolutely necessary (client fires) I don’t check email, IRC or SMS. I think what helps too is the routine includes something to improve my health, so I don’t feel guilty if I work for an extended period (in my case a heavy lifting session to offset whatever punishment I’m going to put myself through with bad posture afterwards). Maybe try to do something that will get you sweating before you’re getting ready for a coding marathon.
[+] [-] brudgers|11 years ago|reply
This isn't to preclude the possibility of a person going manic on a project they own, but that's a case where those doing the work have control.
[+] [-] swalsh|11 years ago|reply
I haven't reached perfection, but I've made incremental progress. Here's what I have so far.
0. Don't work at night. For me, this is a practice in necessity, when my son is born I want to spend a lot of time with him. So i've been practicing on losing that time. The benefit is it's really made me focus on packing as much stuff into my "productive" hours as possible.
1. Stop drinking caffeine at night. Sleep is important.
2. Stop drinking alcohol on weekdays. Mornings are important.
3. Eat a balanced diet (i used to live off easy to obtain tasty food) Nothing is free, that means if you save time by eating fast food you'll pay somewhere else. usually your health. Being unhealthly leads to feeling lethargic. That's unproductive.
4. Before i get to work in the morning I have a realistic to do list of what I want to accomplish. On the drive home I re-evaluate how realistic it was. Since time is important, I want to maximize the return on investment for each minute. I make that decision in the morning, and I stick to it as much as is possible. Just like investing, you need to have a strategy, and you need to stick with it. Don't throw good money after bad though.
5. I keep a detailed log of what i'm doing as i'm doing it. This solves two problems, first it let's me pick up where I left off after distractions come, and two it provides a good way to remember things.
6. Nip things in the butt early. I used to say "this item is a low priority, i'll let it go, and do it later". But when it comes up later, even if it's not a big deal, it means someone is going to interrupt you. That makes it more expensive. The cost of that issue is now <time time to fix it> + <time to track that it exists> + <talking to someone about it> + <time lost on something more important when someone comes up to you to ask about a weird issue>
[+] [-] KohgnaK|11 years ago|reply
The solution of my problem probably lies in the mix of most of your answers; what I'm thinking about doing is:
1. Start waking up earlier in the morning and power nap to counterbalance any sleepiness in the afternoon
2. Be more strict in terms of diet, eat real food + no more coffee after lunchtime
3. Stop working overtime (weekend notably), to try to reduce the procastrination on small tasks
4. Talk with management and try to find some possible arrangements (maybe get a minion?)
5. Find a position where I would have only one major job, not 3 or 4.
Cheers!
[+] [-] larrybolt|11 years ago|reply
[+] [-] known|11 years ago|reply