5 ms·
I've seen this where I work all the time. I've also seen code where the developer created 25 different structures named structure_type_X where X is 1-25, the si
by alttab 17y ago
I've seen this where I work all the time. I've also seen code where the developer created 25 different structures named structure_type_X where X is 1-25, the size of the structure's internal buffer.
How do you deal with 25 different structure types with nothing different but the name and buffer size? Why, a switch statement of course...
- CamperBob 17y agoIt's pretty common for Verilog developers to think they're writing C code, but that's the first time I've heard the converse.
- alttab 17y agoThe guy does some pretty interesting stuff - writes scripts to automatically generate structures so class variables are byte aligned and within cache lines and all that. But he has made some of the dumbest use of C++ I have ever seen. Verbs as classes, sometimes making it obvious that inheritance escapes him, and an entire cpp file over 10k lines long that does nothing but assert the mass amount of assumptions his code makes. The one method is literally called 'check_assumptions.' I'm not bitter though.
- bradtgmurray 17y agoSounds like a problem for C++ templates.
- lanstein 17y agoNow you have two problems.
- nostrademons 17y agoSounds like Pascal...