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

  • 🇵🇦 Nuestro primer dominio localizado está en español en kiwifarms.pa. Our first localized domain is on Spanish on kiwifarms.pa.
  • Want to keep track of this thread?
    Accounts can bookmark posts, watch threads for updates, and jump back to where you stopped reading.
    Create account
also trannies use rust so by default it’s a language i refuse to learn
I only use languages that don't have a centralized community, except for maybe a mailing list. (in my FOSS projects, I use Rust at my job.) That alone rules out trannies and other mentally unwell oversocialized queers. In the best case, the "language" is just a stable specification with multiple conforming implementations.
 
You ever run into people who make a "page layout" for their code?

Código:
int
func1(
int        a,
double     *b,
char       *c
)

Imagine that whitespace is also lightly sugared with tab characters from a system with a different tab-to-space ratio from yours.
REEEEEEEE
 
People who use try/catch as part of normal flow like a variable being null or an undefined key make me something something.
I work with a client that does e-commerce and some of their business cases are implemented as exceptions. There are several services that each log ~10k exceptions every single day as a part of regular business flow. I imagine that back in the day someone would fix it because it makes the logs look like a nightmare to navigate but nowadays this stuff is in the cloud and filtering out these false exceptions using built-in tools is not a big deal, so no one gives a shit.
I won't even be the first to cast the stone because I made that mistake myself at one point when I was less experienced. The code went to production, the client got angry because it made the service a lot slower and a more experienced programmer told me to never do it again after replacing my solution with a regular if-then-else.
 
Forgive me programming warcrimes thread for I have sinned:

To drive a datagrid, I wrote an HQL query with five joins and two of those joins have subqueries in their on clause. I am not proud of what I have done, but the database schema I am forced to code against is an absolute nightmare.

I asked for an intermediary document database we could feed prebaked projections into to drive our data grid but I was told no. The foreigners are scared of elasticsearch and mongo and I'm not allowed to have nice things.
 
Forgive me programming warcrimes thread for I have sinned:

To drive a datagrid, I wrote an HQL query with five joins and two of those joins have subqueries in their on clause. I am not proud of what I have done, but the database schema I am forced to code against is an absolute nightmare.

I asked for an intermediary document database we could feed prebaked projections into to drive our data grid but I was told no. The foreigners are scared of elasticsearch and mongo and I'm not allowed to have nice things.
It's ok nigga, at least you didn't code this abomination:

1754136569863.webp

1754136587313.webp

1754136606463.webp

1754136622080.webp

1754136639764.webp

1754136657398.webp
(https://archive.is/kuGOj)
 
the cherry on top is how he uses xx as a loop variable
what the fuck is wrong with the convention that has been in place since the 60s
I always use either x, y, or z. Am I doing wrong?

It's ok nigga, at least you didn't code this abomination:

Ver archivo adjunto 7725990
He's just intilising the list to 0. Can't he just do
Código:
global.story_array = { 0 };
? Maybe that's not an option that language, but there has to be a more idiomatic way to do that without a loop. He's not even looping over the index he's assigning.
 
Última edición:
the cherry on top is how he uses xx as a loop variable
what the fuck is wrong with the convention that has been in place since the 60s
I thought any letter could be used, though I'm guessing that it's good practice to use i, j, or k as index variables.
 
The biggest war crime ever committed in programming is the invention of JavaScript. Brendan Eich is permanently hiding in the USA to avoid getting extradited to The Hague so that he can face trial and die in custody awaiting his next hearing like Milosevic did. Having said that: the entire team GNOME development team proliferating JavaScript outside of a web browser deserve to be beaten with an oar until they're unconscious and transported by black ops agents to The Hague to face trial for their crimes against humanity and technology.
As our resident JS defender, I must remind you that Javascript was not delivered unto the web by a proclamation of God, but by being the least bad option compared to every other attempt at what it did:
  • VBScript? Dead.
  • Flash? Dead.
  • XSLT? Dead.
  • Silverlight? Dead.
  • Java applets? Dead.
  • Dart? Dead.
  • GWT? Dead.
I mean, I wish we got Scheme too, but Eich had a week to implement a programming language, and he wanted one that felt "mainstream" enough. I think Javascript mostly survived because it had no licensing baggage, was lightweight, worked with the DOM instead of against it, was supported in both IE and Netscape, and was familiar enough that "normal" programmers would engage with it. As shit as our software world is, it could be worse. (I'm just glad that Microsoft failed to win the browser wars. We'd all be stuck on Windows as a consequence, and I suspect that software itself would come to be seen as an idea that Microsoft owns/invented.)

Although I still think that if computers/networks had been faster at the time, Java may well have taken over the browser, and become the de-facto "main programming language" of the entire world. My understanding is that applets took to long to download, and took to long to initialize once downloaded.
 
It's a managed strings library so it handles allocation of memory for the strings behind the scenes apart from things like *alloc. So a pointer to a managed string might not actually be null valued and it might actually be in use by the managed strings library but there's no actual string allocated by the library at that pointer currently and is therefore 'null.'

Managed strings aren't a terrible idea as memory allocation headaches and various bugs pop up with classic C-style strings all the time. For example, GLib (which is the underlying object system used by GTK) has its own special managed string stuff. However the one referenced above isn't very good.
Can't you just use shared_ptr to a string object? Even if it's pure C it's still possible to make a shared_ptr type struct that doesn't limit you by type.
 
Can't you just use shared_ptr to a string object? Even if it's pure C it's still possible to make a shared_ptr type struct that doesn't limit you by type.
sure but thats not exactly trivial either and only takes care of the memory management. you would still need to implement all the operations you might/will want to perform on the strings on top of that
 
(I'm just glad that Microsoft failed to win the browser wars. We'd all be stuck on Windows as a consequence, and I suspect that software itself would come to be seen as an idea that Microsoft owns/invented.)
google is trying to do that nowadays
My understanding is that applets took to long to download, and took to long to initialize once downloaded.
that may have been part of it, but a big issue was that the sandboxing was shit and java still has a slight reputation for being insecure as fuck
 
As our resident JS defender, I must remind you that Javascript was not delivered unto the web by a proclamation of God, but by being the least bad option compared to every other attempt at what it did:
  • VBScript? Dead.
  • Flash? Dead.
  • XSLT? Dead.
  • Silverlight? Dead.
  • Java applets? Dead.
  • Dart? Dead.
  • GWT? Dead.
I mean, I wish we got Scheme too, but Eich had a week to implement a programming language, and he wanted one that felt "mainstream" enough. I think Javascript mostly survived because it had no licensing baggage, was lightweight, worked with the DOM instead of against it, was supported in both IE and Netscape, and was familiar enough that "normal" programmers would engage with it. As shit as our software world is, it could be worse. (I'm just glad that Microsoft failed to win the browser wars. We'd all be stuck on Windows as a consequence, and I suspect that software itself would come to be seen as an idea that Microsoft owns/invented.)

Although I still think that if computers/networks had been faster at the time, Java may well have taken over the browser, and become the de-facto "main programming language" of the entire world. My understanding is that applets took to long to download, and took to long to initialize once downloaded.
All the other options trying to compete with JavaScript were all paid and property. So naturally the option that didn't cost any licencing fees and already worked on every browser won out as the standard default option.

If only in the '90s Brenden Eich has better taste then the world would have been a better place. I sort of feel screwed over having to write document.getElementById so many times because the new versions automatically put the element ids into the JS scope as DOM variables. (:_(
 
that may have been part of it, but a big issue was that the sandboxing was shit and java still has a slight reputation for being insecure as fuck
SUN'S ORACLE'S HARMONIC SIMULTANEOUS ZERO-DAY JAVA CUBE

Dukesource125.gif
I have four exploits in one Java package. You are educated stupid.

The C brainwashed mind is corrupt and cannot understand Java magnificence. No god or man can compare to perfection of casting to and from Object to store in container class. You deserve death.
 
My understanding is that applets took to long to download, and took to long to initialize once downloaded.
The problem with Applets is that the first versions of Java were incredibly slow. Like probably a few orders of magnitude slower than current JS. They were also just completely at the wrong part of the spectrum on sandboxing - so sandboxed that you didn't get native styling or keybindings or integration with the desktop environment, but not sandboxed enough to prevent near constant security vulnerabilities. The download and initializing times were long but they were often faster than a comparable flash application.

Real killer though was that we got V8 with JIT compilation for Javascript coupled with the W3C getting off their asses and ratifying standards that allowed web pages to actually do the kind of shit you'd want applets to do within the browser security model. Same reason we got rid of native code plugins for browsers - all the shit they used to do was rolled into the browser and abstracted enough to make them pointless.

No god or man can compare to perfection of casting to and from Object to store in container class. You deserve death.
This hasn't really been a thing for like two decades at this point. Not since Java got generic types.

And also I don't think Cniles really have any ground to stand on when it comes to absolutely retarded type casting.
 
The problem with Applets is that the first versions of Java were incredibly slow. Like probably a few orders of magnitude slower than current JS.
ngl that's probably not the biggest problem for early java, "a few orders of magnitude slower than current js" is more than fast enough to do most of the stuff that scripts in web browsers do, even today
Real killer though was that we got V8 with JIT compilation for Javascript coupled with the W3C getting off their asses and ratifying standards that allowed web pages to actually do the kind of shit you'd want applets to do within the browser security model.
the biggest part of this is that you can use any random browser (firefox's spidermonkey implementation has its own jit too) and you will get a reasonably quick language with access to apis that just about work on anything
instead of <insert applet plugin here> where you need to jam some eula-riddled module into your browser before you can do all that stuff
 
Atrás
Top Abajo