8
CptFox
7y

By Thor (not the god, the dragon), Belial and Thor (the god, this time)...

Just got the sources for the software that runs on the SDR for my project. I think I just found the mother of all legacy code:
The whole behaviour is described in a single, 4000 lines C file. Most of the code is in a giant switch with cases selected from an enumeration with names that don't match their function. All varnames are overly long, yet hopelessly unhelpful. And why three fuck would you use pointer[0].data instead of (*pointer).data or pointer->data like a sane person would !? pointer isn't even an array, so why would you use []?

Comments
  • 1
    @Bitwise the guy isn't a junior, but the poor codes I'm meeting are mostly due to the fact that I'm a research engineer, and the project I took over was built by a mathematician and an electronics engineer.
    I arrived just a few weeks ago, and the project is less than two years old, but damn am I fighting hard to teach them how to code properly (and also, how to use git rather than renaming folders for versioning)
    But even though the codes I see are terrible, I love the job: I'm free to do as I like, so that terrible code hasn't got much time left in this world
Add Comment