Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Writing boring chores or repetitive code is amazing. Need to handle all cases in a case in pretty much the same way but changing only one thing? Write the first one, the rest is auto coded perfectly.


> Need to handle all cases in a case in pretty much the same way but changing only one thing? Write the first one, the rest is auto coded perfectly.

As someone who has suffered though inheriting a code base of excessive copy/paste with things done "pretty much the same way but changing only one thing" it's a nightmare to take it to diff and try and refactor out the common code. In my case I had to fix a bug in their copy/paste mess and found six separate copies of a whole functions worth of code duplicated.

I suspect part of the reason is for the initial developer it's a great feeling to churn out tons of code and it all kind of works without having to think how you make a block of code generic (avoiding temptation to just pass in a global state struct and dealing with function pointers in the worst cases etc) but having suffered the after effects, I implore you, PLEASE don't repeat yourself (DRY)


Sounds like a technical debt generator. I feel for the devs who will have to clean up the legacy from this in 10 years.


Sounds like a job creator :P


But isn't much better to just manually code it into reusable function and use it repeatedly, instead of letting AI generates all the boilerplate code and causes maintenance headache down the road?


> boring chores or repetitive code

> manually code it into reusable function and use it repeatedly

Refactoring every place where you do x into a reusable function that does x is a boring repetitive chore.


Can you clarify if this is from your personal experience using copilot, you are using it to do those things, successfully, in your routine work?


Sounds like a really limited programming language if there aren’t smarter ways around this in the code.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: