

8·
21 days agoI try to write comments whenever what the code isn’t obvious on its own. A “never write comments” proponent might argue that you should never write code that isn’t obvious on its own, but that doesn’t always work in practice
- Sometimes you have to write cryptic code for performance reasons
- Sometimes you have to deal with unintuitive edge cases
- Sometimes you have to work around bugs in 3rd party code
- Sometimes you are dealing with a problem that is inherently complex or unintuitive, no matter how you put it in to code
If you find yourself writing regexes often enough that speeding up that process would increase your productivity by “a lot”, then you should get good at writing them yourself which means practicing without an LLM. If its something that you don’t do often enough to warrant getting good at then the productivity increase is negligible.
I think the main benefit here isn’t really productivity but developer comfort by saving them from having to step out of their comfort zone.