27 points

Then you realize your code is undebuggable because half the functions and variables have single-letter names or called foo, bar, baz, etc.

permalink
report
reply
5 points

I was learning python as a wee scientist in training, and my variables were beyond dreadful. I tried naming a list “list” and the interpreter told me I couldn’t, so I opted for “listy”. When I needed to name a new list but listy was taken, I’d often resort to “listyy”.

Scientists who work with computers without having much (if any) targeted training on how to code can write the most horrendous programs.

permalink
report
parent
reply
13 points

I have a somewhat related real world story. I had a client that was convinced that tons of people were going to decompile their application and sell their own version of the program, so they insisted that they needed their code obfuscated to protect company secrets and make it harder to reverse engineer. I tried explaining to them that obfuscation wasn’t that big of a deterrent to someone attempting to steal code through reverse engineering and that it would likely cause some issues with debugging, but they were certain they needed it. Sure enough, they then had a real user run into an issue and were surprised to find that their custom logging system was close to useless because the application was outputting random obfuscated letters instead of function and variable names. We did have mapping files, but it took a lot of time to map each log message to make it readable enough to try to understand the user’s issue.

permalink
report
parent
reply
4 points

This is why you obfuscate after you code. Just obfuscate the release build. And logging may at that point be thrown out of the window anyway

permalink
report
parent
reply
8 points
*

It was obfuscated only in the release build. The issue is that they have a system to send certain logs to an API so they can refer to them if a user has an issue that needs further investigation. Unfortunately, their target audience is not very tech literate and have a hard time explaining how they got into a situation where they experienced a bug, so the remote logging was a way to allow us to try to retrace the user’s steps. Some of the logs that get sent to the API have JSON values converted from class data, will refer directly to class names, etc, and those logs had the obfuscated names.

permalink
report
parent
reply
7 points
*
Deleted by creator
permalink
report
parent
reply
3 points
*

^- triggered

permalink
report
reply

Was just talking about gaming genre names being kinda lame (roguelike? Souls-like? Where’s the originality?!) and this just furthers my point as programming and video games are intrinsically linked.

permalink
report
reply
18 points

floats, doubles, etc are decimallikes. object-oriented programming languages are c++likes. a string that is just the word “false” is a boollike. any language easier to learn than c++ is a pythonlike. any language harder to learn than c++ is a asmlike. don’t like it? then you’re a naglike. you don’t want to be known as a naglike, do you?

permalink
report
parent
reply
2 points

Haskell, my favorite pythonlike!

permalink
report
parent
reply
6 points

Javascript is all about them boollikes (or as we sometimes call them, booleish).

permalink
report
parent
reply
16 points

How to write spaghetti code:

permalink
report
reply
23 points

There are only two hard things in computer science: cache invalidation and naming things.

permalink
report
reply
37 points

And off by one errors

permalink
report
parent
reply
3 points

And DNS issues

permalink
report
parent
reply
8 points

Yeah, there are 2 hard things.

0: off by one errors 1: cache invalidation 2: naming things

permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 8K

    Monthly active users

  • 1.2K

    Posts

  • 41K

    Comments