war crimes in programming - A thread to discuss and share horrifying programming ideas/code

  • 🐕 I am attempting to get the site runnning as fast as possible. If you are experiencing slow page load times, please report it.
Can you actually use Visual Scripting without it becoming a complete and utter mess?
Yes.
Although house-keeping will be a bit more tedious when you have things tidied away in shelves of commented sections trayed and shelved in rows of here and there for that and this... and so on.
 
  • Like
Reactions: Gender: Xenomorph
Africanism of the day:

Someone wrote a meticulously correct PImpl wrapper for a third-party C library... and then used that to make precisely one method call in one standalone command-line application, and nowhere else.
 
I don't know shit about coding other than that if you're a programmer and you don't know how to make your own compiler you're a nigger, but I saw this image and what it describes sounds pretty bad.

1733286366705.png
 
I once worked on some commercial software made by guys who found function parameters to be aesthetically displeasing, so every function input was just a global variables that you would set before calling the function. In order to make it easy to find the globals, they were all in a header file called globals.h, which was some 6,000 lines long.
 
Going back to ancient times here, but I once ported a text adventure database where the fuckhead author apparently thought it would be funny to randomize all the room numbers. So what should have taken me maybe 15 minutes to map took like 3 hours. To this day I still want to pimp slap the guy.
 
I got handed an Excel sheet with some VBA macros, and it didn't work on LibreOffice, so I opened it up to check out why not.

The answer... because it used numbered lines just like ancient QBASIC. I'm astonished that even works in the current version of MSOffice.

Code:
10 PRINT "NIGGER"
20 GOTO 10
 
SCREEN 0 : CLS 🧩
1 0 PRINT "NIGGER"
20 GOTO 10
FTFY. To be fair, even QBASIC didn't require line numbers, it was just backwards compatible with them.

This is actually hardware related but I worked on a MacBook years ago (Snow Leopard era) that a relative had gotten through school. While taking it apart I realized that it had a functional fucking DVD-RW drive that was unusable because the case covered it up. I sawed off that section with a Dremel and she was able to play and burn movies/CDs after that.

I also pwnd it by booting into single user mode and deleting one file. Upon reboot it thought it was brand new and let me set up my own admin account. :lol: :lol: :lol:
 
The OP has me curious. What's the best way to do things like:
C:
// ...
case "automobile":
  automobile();
  break;
// ...
...in C or other languages like it? I know in Python one could use getattr() to do dynamic lookup like this.
 
The OP has me curious. What's the best way to do things like:
C:
// ...
case "automobile":
  automobile();
  break;
// ...
...in C or other languages like it? I know in Python one could use getattr() to do dynamic lookup like this.
Tagged union with a function pointer or a template in c++
 
  • Like
Reactions: Nitro!
To be fair, even QBASIC didn't require line numbers, it was just backwards compatible with them.
As a side note, the old guard of Microsoft programmers who religiously maintained backward compatibility for decades mostly deserve a Semper Fi. I just think the invention of VBA was one of those times they could and should have broken it a bit.
Was anyone really pasting in old GW-BASIC code to Excel 5.0? I guess there's whoever wrote that sheet I got.

Tagged union with a function pointer
At that point I'd just do a C++ virtual function and let the compiler take care of all that bookkeeping.
 
At that point I'd just do a C++ virtual function and let the compiler take care of all that bookkeeping.
I tend to agree in principle but I usually end up using tagged unions even in c++ because it's less code you have to write, instead of a class per type you need it can be an enum case and a slot in the union if needed. But what I like about how c++ does it is that constructors can be really useful when you rely on member variables being initialized in a uniform way, so I end up using c but with the nice features of c++ mixed in
 
Back