Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Related Rants
My first task in my current company, a few years ago.
I had to add features to a 10 year old microcontroller-based device written in C.
There was a struct named "global", which held hundreds of other structs that held variables or even more structs.
If one would have printed the structure of this mess it would haven needed several pages.
This "global"-struct was used in every single sourcefile to store and pass data around. Obviously there was no documentation and often useless comments.
Additionally there were a few protocol stacks involved, mainly similar, only differing in one or two protocol layers.
The implementation of the protocol stack was by setting flags in the "global"-struct in every protocol layer and having the application data in a buffer.
The complete telegram with all layer specific data (header, checksums, etc.) was then build at one single point right before sending it, based on the flags and the data buffer.
As there was no chance to reuse protocol layers with this implemenation. Three protocol implementations with special telegram builder existed in parallel, although they were nearly identical.
I needed a fourth variant of the protocol stack, so I had no chance but to make another copy with some minor changes.
But there was a benefit from this task.
As I had to do the software for the successor of this device from scratch I learned for many things how not to do them :-)
undefined
wk58