3 ms·
>Instead of considering that something should be written encapsulated into an object to maintain state, it will instead write 5 functions, passing the state as
by coldtea 11mo ago
>Instead of considering that something should be written encapsulated into an object to maintain state, it will instead write 5 functions, passing the state as parameters between each function.
Sounds very functional, testable, and clean. Sign me up.
- the_sleaze_ 11mo agoI know this is tongue in cheek, but writing functional code in an object oriented language, or even worse just taking a giant procedural trail of tears and spreading it across a few files like a roomba through a pile of dog doo is ... well.. a code smell at best. I have a user prompt saved called clean code to make a pass through the changes and remove unused, DRY and refactor - literally the high points of uncle bob's Clean Code. It works shockingly well at taking AI code and making it somewhat maintainable.
- boredtofears 11mo agoCare to share the prompt? Sounds useful!
- the_sleaze_ 11mo agoSure. Please improve it and come back around to let me know. https://gist.github.com/prostko/5cf33aba05680b722017fdc0937f83ec https://gist.github.com/prostko/5cf33aba05680b722017fdc0937f...
- zx8080 11mo agoDoes its output follow the "no comments needed" principle of the uncle Bob?
- KptMarchewa 11mo ago>I know this is tongue in cheek, but writing functional code in an object oriented language, or even worse just taking a giant procedural trail of tears and spreading it across a few files like a roomba through a pile of dog doo is ... well.. a code smell at best. After forcing myself over years to apply various OOP principles using multiple languages, I believe OOP has truly been the worst thing to happen to me personally as engineer. Now, I believe what you actually see is just an "aesthetics" issue, moreover it's purely learned aesthetics.
- coldtea 11mo agoNot so much tongue in cheek, but a little on the light side, sure. I'd argue writing functional code in C++ (which is multi-paradigm anyway), or Java, or Typescript is fine!