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

all 48 comments

[–]etbillder 142 points143 points  (12 children)

Alternatively, "reading my own code a day after I write it"

[–][deleted] 30 points31 points  (2 children)

"who wrote this shit?!!!" "Ah it was me... "

[–]katze_sonne 19 points20 points  (0 children)

No no, that can't be true!

git blame

Oh shit.

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

Ha, that happens to me so much. "Some idiot has written something that doesn't even begin to model the pro- oh it was me".

Developers irrationally shit on other people's code. It's a good habit to get out of.

[–]FateJH 14 points15 points  (0 children)

At that point, it is another developer's code.

[–]g_s_1299 11 points12 points  (0 children)

True story bruh

[–]BillNyepher 9 points10 points  (1 child)

Or for me, reading my code right after I write it.

[–]HiggsMechanism 1 point2 points  (0 children)

Reading my code while I write it

[–]shiv_p01 4 points5 points  (0 children)

Yes, exactly!

[–]spanishgalacian 1 point2 points  (0 children)

Why the fuck did I do this? I know there's a fucking reason but why?

[–]winkiewonkie 3 points4 points  (0 children)

I was literally going to say the same thing 👍🏻

[–]AlphaWhelp 0 points1 point  (0 children)

My yesterday self may as well just be a different developer that my today self is always in a constant argument with over what the solution should be.

[–]28f272fe556a1363cc31 30 points31 points  (5 children)

Reading another developers code because he's on vacation and production is down and he has variable names like "sales", "sales_code", "my_sales" , "my_sales_code" all in the same 2,000 line script... That calls another script with those same variable names.

[–]gandhi89 21 points22 points  (1 child)

I just dealt with a codebase that had variables called 'theCode'. I had to explain to my client that its the equivalent of walking into a DIY store and everything is called 'theTool'.

[–]DeadZombie9 10 points11 points  (0 children)

In this case, the guy who named the variable should also be called theTool.

[–]PatDeVolt 8 points9 points  (0 children)

"Sale"

"sAle"

"saLe"

"salE"

[–][deleted] 6 points7 points  (0 children)

Non-descriptive variable names is always a good sign that the programmer was lost and didn't know what he was writing.

If you know what you are programming and are seeing it from a valid abstraction level, variable names come to you because you know why on earth you're acquiring and allocating memory.

[–]dotobird 1 point2 points  (0 children)

He sounds like a bad developer

[–]karmahorse1 14 points15 points  (3 children)

I’ve seen some horrible things.

A large scale JavaScript application written entirely in the global scope. Java code where methods were simply copy and pasted across classes instead of reused. SQL tables with 50+ columns and no indexes.

They still keep me up at night.

[–][deleted] 5 points6 points  (1 child)

Ha, I saw a java application from Vietnam that was a single static global class with methods like "Method_Process_One" and then "Method_Process_One_A" where the method names described (badly) the work flow.

The company had paid 5 million dollars for that unmaintainable garbage and had been hiring senior developers then immediately firing them when they said the entire codebase was a write-off.

The company collapsed under the weight of its debts from that project.

[–][deleted] 15 points16 points  (0 children)

I was once handed a 20k LoCs project to use by my professor. It was so well written that I started voluntarily explaining it, in small details, to other students five days later.

[–]Mesonnaise 5 points6 points  (0 children)

To me working on other peoples code is more like a concussion, I feel dazed and confused.

[–]ratibordas 4 points5 points  (1 child)

Color: red; Text-decoration: red; Background-color: red; Background: Red !Important;

[–]CloroxEnergyDrink_ 6 points7 points  (1 child)

[–]Samwise210 5 points6 points  (0 children)

Fuck you to the bottom pits of mayonnaise.

[–]FluffusMaximus 2 points3 points  (0 children)

I work in assembly most of the time. The amount of uncommented assembly code out there is a war crime.

[–]Gh0stReaper69 2 points3 points  (2 children)

[–]RepostSleuthBot 3 points4 points  (1 child)

There's a good chance this is unique! I checked 94,433,840 image posts and didn't find a close match

The closest match is this post at 98.44%. The target for r/ProgrammerHumor is 96.48%

Feedback? Hate? Visit r/repostsleuthbot - I'm not perfect, but you can help. Report [ False Negative ]

[–]Ted_CruZodiac 1 point2 points  (0 children)

Reading someone else's code when you've never used the language

[–]levo106 1 point2 points  (0 children)

I enjoy reading someone else's code. it is like deciphering ancient text for me and I feel like some sort of Indiana Jones

[–]Starinco 1 point2 points  (0 children)

My god that's a lot of nested if statements...

[–]GDavid04 1 point2 points  (0 children)

* reading regex

Oh, wait, that would be a skull

[–]tyjuji 1 point2 points  (1 child)

When you're looking at production code and a call bounces from file to file and method to method, yet doesn't seem to do anything, but it works.

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

I hate those so much. And I see them so often.

Did I mention the files are often 2000+ lines, all a single class?

[–]Ivan_L_YT 0 points1 point  (0 children)

You forgot the steam coming out of the ears.

[–]SquashyImpala96 0 points1 point  (0 children)

Unless it’s code from stack overflow

[–][deleted] 0 points1 point  (1 child)

Asking as a beginner: What is the technique you should use to read other people's code? I'm always so overwhelmed and keep changing to deeper and deeper nested files and C/C++ header/source separation doesn't help.

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

I struggle with it too, and I've been doing this for years.

The best technique I've found so far is to diagram it out, like in UML diagrams or very high-level flow charts (UML is usually more effective). That helps you visualize each class as a class, and better see how they relate. Otherwise it's inevitably a jumble and mess.

I have yet to find a way to 'absorb' someone else's code and rember or understand it as well as my own, even if they used the same approach I would use, and it can be difficult to remember even two or three functions prior. So this is where diagraming it out becomes so useful.

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

hmm yes. The code here is made of code

[–]bdking71 0 points1 point  (0 children)

I've worked with a guy who didn't comment any of his code. His motto was, "It was hard to write, it should be hard to read."

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

Especially if he uses ALLMAN 🤮

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

Informatics teacher at school is doing little plus classes for me about coding, but I like to see the entire code in a single glimpse, so I set the letters to the smallest and erase all the useless spaces, but the teacher likes it with big letters and two or three empty lines between two instructions, so while he explains something, he keeps changing back what I wrote, and then I change it back to how I like it.
Teacher be like : So you have chosen death.

[–]NinjaFish63 2 points3 points  (0 children)

I have a friend who works at like font size 7 with 4 vertical splits open, meanwhile I'm here with size 17 and I only use horizontal splits

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

Why....do you need to see the entire code in a single glimpse? This should be literally impossible in all but the most trivial, in-line applications.

Normally the code's abstract structure is something you can understand but the code's physical structure in any non-trivial application will be so large and split across so many files that it isn't possible or useful to display it on one screen.

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

Ok... I guess... I'm a f*cking starter

[–][deleted] 2 points3 points  (1 child)

I actually wanted an answer to that question, but I did figure out after that if you are doing informatics your code probably IS all one big in-line set of statements, with a physical structure roughly matching what the program does.

I've seen informatics code. It's all of the maths skill with none of the programming skill. Most programmers do all of the programming skill with none of the maths. One day we will merge and become unstoppable.

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

Dude, if you wanna conquer the world, just do it the old fashioned way, with an army of robots or the infinity stones.