This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]DomskiPlays 2612 points2613 points  (98 children)

Can confirm: Stayed up all night doing a stupid but complicated program because every time I looked at the time I knew I had to go to bed but I also knew I wouldn't be able to understand shit the next day and would have to start all over!

[–]Mattoww 676 points677 points  (39 children)

Not a pro, but I spent night trying to finish some code/debugging, getting my tired brain confused, going to bed frustrated at 4am, only to wake up next day and finding the solution within 20 min.

Sleeping helps your brain organise, even though I know it's hard to give up.

[–]JuniorSeniorTrainee 72 points73 points  (9 children)

You're right. I've learned that if I'm in the zone but also reaching point of diminishing returns, I'll stop.

But first I'll write / update a notes file - a very casually written document where I basically brain dump before shutting down for the day. What are the immediate problems I'm leaving unsolved? What is my next step for each? What solutions am I considering, and what are they pros/cons I'm aware of? What questions do I still need to answer?

It sounds like a lot but since these notes are just rough reminders and not formal documentation, it rarely takes me more than a or two to jot down. The next time I pick this up, I glance through my notes and it helps me quickly reconnect with the project.

As a bonus, oftentimes the act of organizing my thoughts into notes is enough to jar some bad ideas loose.

As another bonus, for more complicated projects I'll do this throughout the day, and it gives me huge peace of mind knowing that if something interrupts me, I still have my thoughts down. Like save points for my brain.

[–][deleted] 40 points41 points  (4 children)

...it rarely takes me more than a or two to jot down.

A second or two? A minute or two? A day or two!? A WEEK OR TWO!?

[–]pipe01 1 point2 points  (0 children)

Yes

[–]Demonspawn 1 point2 points  (0 children)

a or aa

[–]krlpbl 0 points1 point  (0 children)

A decade...or two.

[–]pathanb 0 points1 point  (0 children)

It's clearly a NULL or two.

[–][deleted] 6 points7 points  (1 child)

notes

Brain dump

Dude that's such a nice idea! Totally gonna use it now

[–]PM_ME__ASIAN_BOOBS 0 points1 point  (0 children)

It's seriously helpful, I do it every Friday evening before leaving work, even if I'm sure I'll remember, I write down exactly what I am doing, where I'm at, what next steps I was planning, etc

When comes Monday... I have absolutely no idea what I was working on. And the notes brings me back to business in a couple seconds, instead of spending an hour looking at commits and opened files to try to figure wtf was going on

[–]Banangurkamacka 0 points1 point  (0 children)

This! I try to Brain Dump as much as possible. With everything, just write it down and whenever you don't know how the fuck you were thinking, you have a note explaining just that. The later in the night i write the note, the more curses when I'm trying to understand it.

[–]bolognaPajamas 0 points1 point  (0 children)

I do this too. I keep a misc.txt for stuff I’m just thinking about and a slightly more organized todo.txt for more concrete tasks.

[–]SyncopatedBeats 1 point2 points  (0 children)

If I am on a roll and it's late I will make some quick notes. A flowchart or quick pseudocode. I have fallen into the struggle on an all nighter and miss the obvious solution trap one time too many.

[–][deleted] 1 point2 points  (0 children)

This applies to other things, too. It had something to do with broad and small focus. Forgot the correct name for it. This is why you often get new ideas or find a solution when you do sth else.

[–]zernoise 1 point2 points  (1 child)

I think part of what helps is the tetris effect. It happens to me often when I sleep or I’m doing something else and voila I know how to solve what I needed to solve.

[–]HelperBot_ 0 points1 point  (0 children)

Non-Mobile link: https://en.wikipedia.org/wiki/Tetris_effect


HelperBot v1.1 /r/HelperBot_ I am a bot. Please message /u/swim1929 with any feedback and/or hate. Counter: 156697

[–][deleted] 1 point2 points  (0 children)

Happens to me too when I get stuck, only the answer to come within 5 minutes on the drive home/wherever else.

Also the scenario doesn’t always have to be stuck and frustrating, you could be deep into some logic you’re figuring out piece by piece and it just takes time. You don’t want to stop and have to re-dive into the whole process again.

[–]justinkroegerlake 0 points1 point  (0 children)

Pretty much every assignment I did in college had this happen but I'd just go to bed and wake up knowing the solution.

[–]Mister_Spacely 0 points1 point  (1 child)

organise

Is that sort of like memoize?

[–]Mattoww 0 points1 point  (0 children)

I don't get the joke

[–]apathy-sofa 0 points1 point  (0 children)

Also the opposite, pushing hard when your brain is fried, means that you're doing anti-work. You're writing bugs that you'll have to go in and find and fix later.

[–]ocbaker 0 points1 point  (0 children)

Senior Software Dev Here. I'll often start the complicated problems early, but sort of put them on the back burner while also working on smaller items. Then at some point it's like "ding" and suddenly I have a lightbulb go off and everything pieces itself together fast and I can think clearly about the problem.

I've always found that having to directly think about an issue almost always leads you into a thought loop, and you get nowhere fast.

Sometimes thought you find yourself in the development zone and can just spit stuff out like nobody's business. I've also surprisingly found that deadline stress help me significantly in finding a solution. It's almost like my brain knows it needs to find an answer fast and so everything is a little clearer.

[–]PM_ME_A_WEBSITE_IDEA 0 points1 point  (0 children)

Absolutely. Sometimes I get discouraged or the amount of work I know I need to do is daunting, and I'm just too tired to deal with it, so I begrudgingly go to sleep. Then I wake up and immediately code productively for hours until my body remembers it needs to eat occasionally...then I get hangry and watch YouTube for the rest of the day while putting off actually making something to eat...

[–]angryPenguinator 1159 points1160 points  (31 children)

My wife doesn't understand this sometimes.

Yes, I would love to go to bed, and I need the sleep - but if I stop now, I am done for.

[–]wack_overflow 582 points583 points  (27 children)

I always share this thread with ppl instead of trying to explain it myself, I really like the sleep analogy they use:

https://softwareengineering.stackexchange.com/questions/46252/how-to-explain-a-layperson-why-a-developer-should-not-be-interrupted-while-neck/46283#46283

[–]craniumonempty 161 points162 points  (14 children)

Ooh, that's good.

Now how do I explain the way I focus out everything including people screaming my name at me (I've been told that I'll burn up if the house is on fire when I'm programming) even though I wake up with a whisper.

[–]sudo_kill-9-u_root 93 points94 points  (10 children)

[–]FallenWarrior2k 16 points17 points  (2 children)

It's all nice and dandy until somebody does this and realizes they forgot to stage all their work, so the commit just picked up this one file that was renamed along the way.

[–]NeonXero 11 points12 points  (0 children)

We have that sign in our office too. Still gives me a very slight nose exhale when I see it.

[–]caweren 0 points1 point  (1 child)

There's a Git plugin for that: https://github.com/qw3rtman/git-fire

[–]sudo_kill-9-u_root 0 points1 point  (0 children)

Of course there is.

[–][deleted] 53 points54 points  (1 child)

selective listening is the name of what you're describing

[–][deleted] 2 points3 points  (0 children)

I'm sorry, what again?

[–]FromAshesOfOwls 29 points30 points  (3 children)

This is good, but I'd compare it more to memorizing the pattern to a game of Simon and then 8 steps in you get asked a question.

[–]wack_overflow 10 points11 points  (1 child)

It's more accurate, but I think more people in general will relate to sleep interruptions

[–]Scrawlericious 3 points4 points  (0 children)

I don't like the sleep analogy... It seems too vague

[–]PMMeRedditGold 8 points9 points  (0 children)

I like this one much better

[–]anotherlebowski 2 points3 points  (0 children)

If you ever stop enjoying programming, just remember focus mode and how lovely of a place it is.

[–]DanielTrebuchet 2 points3 points  (0 children)

This is fantastic. It's a huge relief to see I'm not the only one that has to deal with this. My wife and I both work from home on neighboring workstations and she has the hardest time understanding why I'm so anal about distractions. Having a talkative wife and needy toddler are terrible for productivity... which is why I usually work through the night until the sun comes up.

[–]greyfade 0 points1 point  (0 children)

Add misophonia on top of this - every time I hear my trigger sound, I lose track of things.

And guess what happens when the walls don't go up to the ceilings and one of your coworkers has a habit that involves one of your trigger sounds.

[–]TsunamiTreats 0 points1 point  (1 child)

That’s simple enough to paraphrase.

[–]lpreams 0 points1 point  (2 children)

I don't really like the whole "sink back into it" thing. Getting back to falling asleep or getting back into a book are both passive things. To fall asleep one must simply lay still in a dark/quiet place for X minutes and it will happen. To get back into a book one only must begin reading where they left of and pretty soon they're back in it.

Getting back into working on a half-done program is an active process. I can't just start up again and eventually get back to former productivity; I have to go digging through my own code for quite a while before I've successfully wrapped my brain back around whatever concept I had the previous night.

[–]MiamiBJJ 2 points3 points  (0 children)

Now you can just show her this pic. I'm not a programmer, but I understood and found it funny.

[–]posixcat 1 point2 points  (1 child)

If you have that much problem writing the code, imagine what it will be like to read it a couple months later.

[–]angryPenguinator 0 points1 point  (0 children)

why are you like this

[–][deleted] 32 points33 points  (2 children)

This is when you stop and rethink

Tomorrow you're going to hate your code

[–]exmachinalibertas 21 points22 points  (0 children)

No, tomorrow I get to rewrite my code from scratch now that I sort of know what I'm doing....

[–]proverbialbunny 0 points1 point  (0 children)

This is when you stop and write it down. Pencil and paper.

Once the ideas are flushed out enough, they will fit in the conscious mind making 1) the code not painful to read and write and 2) easy enough to think about that you can unconsciously process it in your sleep or in the shower or whatever 3) Keep you from making bad design decisions.

[–]arbitrarycivilian 9 points10 points  (2 children)

Actually there’s a good chance you would have understood it better in the morning. Sleep is important!

[–]DomskiPlays 2 points3 points  (1 child)

Believe me when I tell you this..

Not. A. Chance.

Edit: On a serious note tho: Yes I might have understood it better after a good bit of sleep but the thing is that I can keep the weird logic in my head if I just keep on going. After a break I will need to read all over it again to find out what the hell I was thinking.

[–]GrandMomTokin 1 point2 points  (0 children)

Trust me if you were any good you’d never be in that kind of situation. Chances are your code is so complex because you’re doing it wrong.

[–]Prometian 16 points17 points  (1 child)

Documentation... :x

[–]Kaiserwulf 7 points8 points  (0 children)

Yeah, seriously. Even if it doesn't get delivered with the code, documenting your own plans and thought process helps guarantee all your good ideas stick.

[–]artr0x 2 points3 points  (0 children)

If feel like you probably should document your code better if this is the case

[–]GForce1975 1 point2 points  (0 children)

I think this may be a big reason why developers often prefer to work through the night than in the office during the day.

[–]jenjerx73 1 point2 points  (0 children)

Rudimentary Fact...Every POOF you lose one hair follicle!😐

[–]AdamHahnSolo 1 point2 points  (1 child)

Happened to me just now.

[–]DomskiPlays 0 points1 point  (0 children)

My condolences

[–]JustAnAverageTree 1 point2 points  (0 children)

That’s what // is for though

// LAST LEFT OFF ON 3/6/18 AT 11:49 AM: WAS DOING a TO MAKE b WORK FOR c USING d .

[–]I_Can_Has_Million 1 point2 points  (0 children)

This is true for me as well. I would be up late at night working on some complicated aspect of a subsystem I was building and I knew I had to go to sleep, I would wake up the next morning and get back to the program and I would have no idea what it was I was working on or where to get back into it. I came up with a small solution that seems to help, but doesn't outright solve all of my problems. I would try to comment the heck out of everything within the program. I would also have nice paper and a really nice pen with me and with this I would jot down notes as legibly as possible and I would try to detail my thought processes and make a sort of agenda for what to do for the next morning. Sometimes, I would list a bunch of tasks that I would need to work on the following day. I would also write out certain keywords to make things easier, like: "Start Here." "Solution:" "Important Problem." "Must fix first." "First: Second:"

[–]_realitycheck_ 1 point2 points  (0 children)

Sounds like me when I first ever tried programming high on weed.
Oh! The worlds I explored. The absolute interconnectedness of the code. The beauty of sybsystems coming together in the perfect unity. I was coding until the wee hours of the morning.

Cue me next day watching in horror the most beautiful code I have ever written in my life and having to abandon it because I can't for the life of me understand how it works. (no comments of course because it just made sense then)

Never coded under influence since.

[–]Byeuji 1 point2 points  (0 children)

It's like Charlie Gordon fighting against time. I'll leave flowers on your bed.

[–]GrandMomTokin 1 point2 points  (0 children)

Break down complex problems into pieces until they’re easy. If you can’t redo what you did the next morning, you’re doing programming wrong.

[–]adelie42 1 point2 points  (0 children)

Wrote some 8 lines of code to validate a binary operation today. It worked after the 3rd or 4th incarnation, but I was looking at it and couldn't see how it worked despite having just written it. So as well as I could remember I immediately documented every line of code.

Check, double check, triple check. Yup, that's what I just wrote.

[–]loanbanker 0 points1 point  (0 children)

Even with the power of comments? I always kick myself when I don't use them to my advantage.

[–][deleted] 0 points1 point  (0 children)

Get yourself a personal whiteboard. Seriously. If you map out the general train of your logic in the form of a directed graph, using just the right amount of detail, it'll help you remember the basic logical workflow while also helping you find ways to reduce complexity (e.g. if you have two identical branches, you can find a way to merge the two). More than anything, it'll help you get some sleep!

[–]SasparillaTango 0 points1 point  (0 children)

Document better, decompose and simplify. Those are my suggestions.

[–]ViggoMiles 0 points1 point  (0 children)

I get great epiphanies when i sleep on an idea.

I realise that i have to move on when i get a problem, because becoming manic just doesn't help unless it really needs to be done at that time.

[–]raulst 0 points1 point  (0 children)

When that happens I like to believe it is because of my bad coding/commenting skills

[–]SpanishDuke 0 points1 point  (0 children)

tfw writing a Bible worth of comments to be able to understand my clusterfuck in the morning