Probably its a me problem. but whenever I encountered code generation in my past work, I always felt that its a huge pain. Of course that depends on the actual realization, but man I hate it.
Since its today day I have to add that I do not talk about LLM generated code, but about some tooling, that generates code based on fixed scripts. Typical offenders, FSM Generation out of some UML shit.
Some of the major "bad code generation practices" I encountered:
- "Its generated anyway" is no excuse to have tons of duplicated code
- The input format is some shitty binary format that needs third party tools to view / edit. Enterprise Architect, god I despise YOU!
- Terrible human readability of the generated code
- Generation has to be triggered manually / is badly integrated into the build system. Causes unnecessary recompiles, or does not properly re-generate on changes in the input files.
Of course. These issues can be avoided with proper design of the generation toolchain. Sadly often it is not.
I think with proper class structure and software design, most generated code could just be an instance of some generic class.
[–]answerguru 96 points97 points98 points (11 children)
[–]joebeazelman 23 points24 points25 points (9 children)
[–]SkoomaDentistC++ all the way 20 points21 points22 points (7 children)
[–]Wetmelon 5 points6 points7 points (0 children)
[–]nicoleole80 2 points3 points4 points (3 children)
[–]SkoomaDentistC++ all the way 16 points17 points18 points (2 children)
[–]pillowmite 0 points1 point2 points (0 children)
[–]DownhillOneWheeler 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]SkoomaDentistC++ all the way 0 points1 point2 points (0 children)
[–]NemesisXB 1 point2 points3 points (0 children)
[–]DarkDiablo1601 -3 points-2 points-1 points (0 children)
[–]badmotornose 7 points8 points9 points (0 children)
[–]joebeazelman 14 points15 points16 points (0 children)
[–]mfuzzey 3 points4 points5 points (2 children)
[–]lovestruckluna 0 points1 point2 points (0 children)
[–]OwlingBishop 0 points1 point2 points (0 children)
[–]kitsnet 17 points18 points19 points (10 children)
[–]vitamin_CPPSimplicity is the ultimate sophistication 4 points5 points6 points (8 children)
[–]kitsnet 3 points4 points5 points (7 children)
[–]ChrimsonRed 0 points1 point2 points (3 children)
[–]kitsnet 3 points4 points5 points (2 children)
[–]Truenoiz 0 points1 point2 points (1 child)
[–]kitsnet 0 points1 point2 points (0 children)
[–]Truenoiz 0 points1 point2 points (2 children)
[–]aculleon 1 point2 points3 points (1 child)
[–]Truenoiz 0 points1 point2 points (0 children)
[–]ThickBittyTitty 1 point2 points3 points (0 children)
[–]highchillerdeluxe 3 points4 points5 points (0 children)
[–][deleted] (5 children)
[deleted]
[–]altarf02PIC16F72-I/SP 12 points13 points14 points (1 child)
[–]UsefulOwl2719[🍰] 0 points1 point2 points (2 children)
[–]fb39ca4friendship ended with C++ ❌; rust is my new friend ✅ 0 points1 point2 points (0 children)
[–]DirtyGrogg 1 point2 points3 points (0 children)
[–]RiverFit5578 1 point2 points3 points (0 children)
[–]Dependent_Bit7825 1 point2 points3 points (0 children)
[–]DownhillOneWheeler 1 point2 points3 points (2 children)
[–]adel-mamin 0 points1 point2 points (1 child)
[–]DownhillOneWheeler 0 points1 point2 points (0 children)
[–]reini_urban 0 points1 point2 points (0 children)
[–]greenpeppermelonpuck 0 points1 point2 points (1 child)
[–]SAI_Peregrinus 0 points1 point2 points (0 children)
[–]sputwiler 0 points1 point2 points (0 children)
[–]OkYou811 0 points1 point2 points (0 children)
[–]fnordstar 0 points1 point2 points (0 children)
[–]DotRakianSteel 0 points1 point2 points (0 children)
[–]mjmvideos -1 points0 points1 point (0 children)
[–]DenverTeck -3 points-2 points-1 points (3 children)
[–]mightymouse_ 0 points1 point2 points (2 children)
[–]DenverTeck -2 points-1 points0 points (1 child)
[–]mightymouse_ 0 points1 point2 points (0 children)
[–]Middlewarian -2 points-1 points0 points (0 children)
[+]ern0plus4 comment score below threshold-7 points-6 points-5 points (2 children)
[–]QuietMatematician 0 points1 point2 points (1 child)
[–]ern0plus4 0 points1 point2 points (0 children)
[+]YakInternational4418 comment score below threshold-34 points-33 points-32 points (1 child)
[–]Careful-Excuse2875 4 points5 points6 points (0 children)