3 ms·
Metaprogramming can do the opposite: make obscure, complicated and lengthy code much more readable and easier to maintain. It’s clear when it does this. Agree
by 2devnull 3y ago
Metaprogramming can do the opposite: make obscure, complicated and lengthy code much more readable and easier to maintain. It’s clear when it does this.
Agree that “clever code” is silly but also important to remember that people need to entertain themselves and “grow professionally.” People get paid more if they write the 15 line pipe and it’s job security. Maybe gpt will help since it’s a lot better to have gpt write easy to debug for loops, but then programming will be less fun. People need to entertain themselves.
- cookieperson 3y agoI hear you, that's why I said "most". But there's also a flipside where someone tries to tweak a language feature or implement a missing language feature with an inhouse macro. That macro goes on to be defunct but a major chunk of mission critical code is now glued too it. After all we can't expect languages to not fill in missing gaps in an opinionated way. The only way out is to wall off a code base for a month for a treacherous refactor. I am pro have fun screw up and grow. But macros present a certain kind of danger a lot of other tools don't. If you are playing with them be careful of their scope is my only real warning.