I’m not sure why but i just flat out work better at night when everyone is asleep, pretty mutch all of the “last modified” time on my project files is from 10 pm to 3 am
no distractions…
one metaphor i heard is, holding a program in your head is like building a house of cards, every time a phone rings or something breaks your concentration, you have to rebuild the house
I was once like “🤨… what drugs was I on when I wrote this 🤨”. Comments didn’t help, I must’ve been under the influence of something, it didn’t make any sense.
Even though comments are very helpful, often it’s even enough to name variables and methods/functions really good. At least do that. You don’t want i, j and value. Believe me. You want rowCount, colCount and deliveryOption instead. You just may not know it now, but you will, when it has to be changed in a few months.
Where comments are useful most is in explaining why the implementation is as it is. Otherwise smart ass (your future self) will come along, rewrite it just to realize there was indeed a reason for the former implementation.
Comments are good when you’re doing something weird to handle an edge case or something. But yeah most of the time clear variable names, and extracting complicated code to a dedicated and clearly named function, are enough.
There are only two hard things in Computer Science: cache invalidation and naming things.
So I watched a few guides and did all that... what now? Would you think a shopping list app is doable for my knowledge after this? It looks really hard compared to NorgurOS... :(
programmer_humor
Hot
This magazine is from a federated server and may be incomplete. Browse more on the original instance.