News for hackers. Stuff that matters.
Re:Python is becoming the world’s most popular programming l... by paulie_a on Wednesday October 10, 2018 @08:32AM (#18184210)
I frequently use code generation in python. why write thousands of lines of boilerplate code in any language when you can just generate it? Maybe I'm just lazy but the results are better and more consistent to get something done.
Re:Python is becoming the world’s most popular programming l... by andybak on Thursday October 11, 2018 @08:40AM (#18192970)
I would regard anything other than tiny amounts of boilerplate to be a code smell in most languages.

Code generation has so many downsides and Python is so dynamic I can't think what you're doing that couldn't be done better without code generation.

Re:Python is becoming the world’s most popular programming l... by AstralStorm on Wednesday October 10, 2018 @11:58AM (#18186115)
Weird, typically you can use metaclasses or mixins to remove such boilerplate.
Re:Python is becoming the world’s most popular programming l... by paulie_a on Wednesday October 10, 2018 @07:26PM (#18189834)
I utilize that too but why not generate new models with forms, cbvs, drf endpoints, serializers, etc? You can pick and choose what you need, add the mixins and move on. Plus initial project using cookicutter to generate the original project in a much more fitting and featureful structure.