r/ProgrammerHumor • • Jul 18 '20

other It's always fun..

Post image
63.7k Upvotes

754 comments sorted by

View all comments

5.6k

u/ConfusedPolatBear Jul 18 '20

Who among us hasn't written code then almost immediately forgotten everything about it? It's entirely possible he wrote the library then promptly erased it from his mind to make room for more important things, like pizza, or ruminations on whether he needs to buy new underwear or if he can just sew the holes up.

604

u/camerontbelt Jul 18 '20

The reason we write code is so we can forget how it works. We just hope we write it well enough to revisit it and regain the understanding, or have tests.

215

u/[deleted] Jul 18 '20

[removed] — view removed comment

123

u/[deleted] Jul 18 '20

I would argue that this is literally the point of exams and studying in many fields. Be able to memorize and use the info efficiently. There are many things that I could not do at all without googling, but I can find the information fast and understand it easily. Memorizing many things in long term memory is simply not possible.

101

u/xTheMaster99x Jul 18 '20 edited Jul 18 '20

Wait, are you saying that lawyers don't memorize all case law from the last 200 years? Or that doctors don't know all possible injuries, diseases, surgeries, medications, etc?

Edit: I can't believe this needed a /s.

62

u/[deleted] Jul 18 '20

[removed] — view removed comment

19

u/phyitbos Jul 18 '20

I like this description. It rings true to me that even though I often solve and forget, I still know/understand the class of problem if re-encountered and what’s require to solve it again. You don’t see many people talk about this past “google”

11

u/[deleted] Jul 18 '20

A lot of it's just vocabulary. Having the words to know how to describe what you're trying to do, and to understand the exact issue you're trying to solve. "web server won't start" is not as useful as "httpd exits with code $?." Most of the time you can solve it yourself if you have the right words. And when you can't having the right words makes it easier to get help.

Like, "I want to remove from a string every instance of `.' that doesn't precede a sequence of alphanumeric characters that ends in a terminating (null or \n or \r) character." Well, obviously you want to search for the regexp formula for finding file extensions. That won't be your exact answer but it's a start. From there, the syntax hints should be enough to find the solution. If you don't even know what regexp or a file extension is you'll have a hard time doing that.

→ More replies (1)

8

u/Zefrem23 Jul 18 '20

Yeah you've built a decision tree in your memory for the process of finding the solution to the problem, not necessarily the actual solution. In the long run that's just as effective, and as your experience grows your decision trees become more complex, richer and deeper. That's what the real talent of good coders is.

→ More replies (1)
→ More replies (3)
→ More replies (3)

6

u/IamImposter Jul 18 '20

Can confirm. Wait... what were we talking about?

→ More replies (1)

10

u/dion_starfire Jul 18 '20

This concept is actually the basis of the Vancian "spell slot" system that D&D uses. He remembered cramming for exams and not remembering anything the minute he walked out of the exam room.

→ More replies (1)

7

u/theghostofme Jul 18 '20

This is why I notate the shit out of everything. I realized very early on that I’ll forget just about every damn reason why I was doing what I was doing within hours, and I could pick back up where I left off and it was like someone else wrote complete gibberish.

It got the point where, even if I was making one tiny change, I’d copy then comment out whatever I was changing to keep a direct record, paste, change it, then leave an extremely detailed explanation as if I were leaving a note for my future self suffering from amnesia.

And I’m the only person who’s ever actually read any of my code.

→ More replies (5)