Re:It’s Like GPT-3 but for Code – Fun, Fast, and Full of Flaws
by josefx on Saturday March 19, 2022 @06:54PM
(#30738307)
> Sometimes 2 lines of code is just better than 6 and not worth the extra brain cycles.
I am unsure about what could possibly be better about them? Twice the chance to misspell one of the string constants? Twice the time to write the code, which in this case seems to be the big blocker? Twice the code to update in case any of it has to change? Twice the complexity per line of code?
Re:It’s Like GPT-3 but for Code – Fun, Fast, and Full of Flaws
by karmicthreat on Sunday March 20, 2022 @10:32PM
(#30749428)
This is pretty much the case. It was a quickly needed report of data from our ERP system and dumped into an excel sheet to use. I had not used Pandas before but seemed like a good fit for me t build this out. The people who needed this info were not very sure about what they needed, so being un-DRY is better. This is only a maybe 2 page Jupyter sheet. So it's not a huge deal.
In any case, DRY is just an optimization theme. And optimizing for understanding/intent is a higher priority for me. Sometimes they intersect, sometimes not.
Re:It’s Like GPT-3 but for Code – Fun, Fast, and Full of Flaws
by AnonCoward4 on Saturday March 19, 2022 @05:46PM
(#30737842)
I disagree that this is premature, but best practice. This example is actually a small lesson how this autocomplete can construct slightly less readable code. Of course not really a problem of the tool as you have to refactor anyway.
There's DRY, then there's premature optimization.