Amateurs
Right... I don't understand why you wouldn't want to have all your functions and logic pathways somewhat memorized. Maybe this is some programmer form of self depreciation BDSM kink I don't understand. 🤔
Dude, I’ve got 20k files and hundreds of thousands of lines of code. I’ve touched at least 40% of it. And the moment I finish a dev cycle, the first thing I do is flush it all the fuck out of my head. Because I don’t need that info anymore — and there’s just way too much of it.
def function_doing_y(parameter_a, parameter_b)
I wonder what my code is doing. Might it be doing y and using a and b for that?
Naaah, impossible, but because I haven’t added the comment
I guess I will never know what it does
//Howdy future me
This is present me
Eh it happens, it's even funnier when your reviewing some code with a peer and your like "Who did this?!" and git blame points the finger back to you. Very humbling moment.
That's what I said to my team lead today morning when he asked me what I coded 2 weeks ago
And yes he did ask the question again
The biggest lie ever told is self documenting code.
Fun thing, event though I write comments a lot, problems usually occur in the places not covered by comments. So they are useless anyway.
Wdym I need to write documentation?
For my serious answer:
handle_keypress... // like no shit
...
// ======= ACTUAL TEXT INPUT ======= ... ``` 3. cleaning up after yourself and not making a convoluted mess (which often happens right after I solve some problem)
...works well enough for me.
Also, I personally, find that code is more skimmable when aligned vertically (works only sometimes and not that impactful)
Later...
Jr. Dev: "Help! I forgot what my code does!"
Sr. Dev: "No comment."
The trick is not to touch it again until you advanced to be a senior dev. And then it‘s another juniors problem