3 ms·
When I was in college I once wrote Java code while drunk late into the night. I reviewed it the next morning (afternoon, really). The good news was that the cod
by IgorPartola 6y ago
When I was in college I once wrote Java code while drunk late into the night. I reviewed it the next morning (afternoon, really). The good news was that the code worked exactly as expected and produced correct results. The bad news was that it was completely incomprehensible. As in my sober self could not construct a mental model of how the code worked.
Then again, I also sometimes write code in my sleep if I left a problem unsolved during the workday and then I implement that solution when I wake up. Does anyone else also do this?
- spiritplumber 6y agoDid it make sense next time you got drunk? :P I had to update some code that a more talented coder than I, wrote while stoned. It was an adventure.
- IgorPartola 6y agoHah. I didn’t try, but that’s a good question.
- rotifer 6y agoOne time at university I was up late working on a math assignment, but couldn't figure out one of the problems. I fell asleep and had a dream in which I came up with the solution. I woke up briefly, wrote down the answer, then fell asleep again. When I got the assignment back from the TA I had gotten everything correct, except for that problem, which he had marked up with red question marks and exclamation points. I looked at what I had written and found it to be incomprehensible nonsense...
- swiley 6y agoThis is my experience coding drunk as well. I also really hated the experience. As someone who enjoys getting lost and getting drunk and programming I thought I would love doing both together, it turns out for me drinking just maximizes the magical transient errors when coding caused by false assumptions which are always the hardest to debug.
- thesz 6y agoThese magical transient errors are exactly why one should choose language with immutable values. You have old value and you compute new one (with sharing if possible). You can continue to use old value or throw it away. The mutation operation can be seen as resource management optimization, premature (and thusly evil) more often than not.