I agree. One of the biggest sources of errors for me is copy-pasting multiple lines of code and then failing to adjust some of the variables or numbers. If I do that it's guaranteed that I lose 2-3 times 15 minutes a day because of stupid bugs.
Don't be too smart, don't copy paste more than a word. The time it takes for typing is well worth the reduced error rate. Don't let your laziness get the better of you. Don't create circumstances that allow you to make additional errors.
Application-specific macros make code unreadable, while common and standard ones might as well be a language feature. A well-designed language should offer suitable extension points in a structured way, rather than just allowing code to perform completely arbitrary transformations on the AST.
Comments
I agree. One of the biggest sources of errors for me is copy-pasting multiple lines of code and then failing to adjust some of the variables or numbers. If I do that it's guaranteed that I lose 2-3 times 15 minutes a day because of stupid bugs.
Don't be too smart, don't copy paste more than a word. The time it takes for typing is well worth the reduced error rate. Don't let your laziness get the better of you. Don't create circumstances that allow you to make additional errors.
Hence, languages with a proper macro system.
Application-specific macros make code unreadable, while common and standard ones might as well be a language feature. A well-designed language should offer suitable extension points in a structured way, rather than just allowing code to perform completely arbitrary transformations on the AST.