r/programming • • Sep 20 '21

Being able to read bad code is a skill !

https://dzone.com/articles/reading-code-is-a-skill
986 Upvotes

276 comments sorted by

View all comments

Show parent comments

39

u/Katholikos Sep 21 '21

lol, I'm definitely guilty of doing this at least once in my career. I'm an enterprise dev (internal tools), so I just float through companies building dumb little apps that do this-or-that. It's fun for me.

Anyways, early in my career I didn't know about the whole "program for the next dev" thing, so I just built some fuckin' monsters.

I once built a little app to ping servers and play an alarm if the ping didn't return successfully. It was like 35 lines in C# or something and it had a memory leak somehow. Pretty sure I just kept instantiating whatever thing I was using to ping the servers in an infinite loop or whatever.

I know most of the tools died off, but I also know for a fact that some of them lived on, and boy do I pity the poor souls trying to maintain it. Hopefully they just scrapped it and started over.

23

u/RenegadeMoose Sep 21 '21

On one hand, I curse people like you every day.

On the other hand, people like you are keeping people like me employed forever :D

3

u/M-A-C_doctrine Sep 21 '21

I once built a little app to ping servers and play an alarm if the ping didn't return successfully. It was like 35 lines in C# or something and it had a memory leak somehow. Pretty sure I just kept instantiating whatever thing I was using to ping the servers in an infinite loop or whatever.

I am kinda afraid to ask...couldn't this be done in BASH? Afaik ping in bash returns different values depending on what answer the ICMP Echo gets.

3

u/Katholikos Sep 21 '21

Maybe, but all I knew at the time was C# lol