So, I work at a company that uses Java for all its server-side technology (~2 million lines today), but we don't use annotations for code-gen. Can someone explain to me why I would want to do that instead of a hypothetical IDE feature/plugin?
* DRY for cross-cutting concerns, like database transactions, logging, dependency injection, serialization, validation, web controllers/endpoints... basically, macros for Java.
* Less code means less chance for error - even if that code was generated at some point in the past, it will need to change in the future, and the future developer may do the change manually and might introduce mistakes. Using annotations can help enforce patterns.
Another advantage of using annotations to generate code at compile time, is that any (simple) errors get detected at compile time instead of runtime. So, potentially less tests you need to write.