r/ProgrammerHumor • • Nov 25 '22

Meme Coding strategies

Post image
52.2k Upvotes

385 comments sorted by

View all comments

3.9k

u/faze_fazebook Nov 25 '22

super modular code that can cope with changing requirements :

gets so complicated that it gets scrapped by the next developer

67

u/vhite Nov 25 '22 edited Nov 25 '22

Yeah, I work with something like that, large codebase elegantly divided into modules and plugins. It usually works like this.

Layer 1 - General top level function handling basic logic between several components. Calls specific component functions.

Layer 2 - Component's outer interface function, has few parameters to appear simple, does pretty much nothing but some boilerplate to call internal component function.

Layer 3 - Internal component function, takes dozen parameters with mysterious meanings, and uses dozen more private states and variables and has even more boilerplate. You think you're are finally getting to the core functionality you're trying to uncover, but then...

Layer 4 - DoTheThing function. Short and simple, the only problem is that it doesn't do the thing. Instead is calls some higher communication interface with an action flag and some data, and then shoots it into the oblivion.

Layer 5 - You have finally reached the point where the flag is being processed, at least you think so because the direct path was lost in a dozens of communication interface functions and so you just searched for the flag used in DoTheThing function. You found 6 results but this one looks closest to what you want. Here the interface notifies all the members of a mysterious array.

Layer ??? - You dig trough the origins of the array, it's type, initiation, all the instances where members are added, etc., but you only keep finding more abstractions. The name of the type suggest some higher level components, but you don't know which ones are in the array at the time it's being notified, and you don't know how the abstractions are connected to the actual components. Notify only calls an abstract function, and you have no idea where and by what it's being overriden. You're lost, cold, and you just wanna go home.

2

u/AlarmedProf92 Nov 26 '22

Plus you have to report at the daily that you still haven't solved the bug...

Like the worst thing about this for me is that there is also management layer over my head that counts my performance so it adds for extra anxiety.