14 ms·
Developing, debugging, using an annotation processor is opposite of productive. Not recommended.
by specialist 9y ago
Developing, debugging, using an annotation processor is opposite of productive. Not recommended.
- wzsddtc 9y agoIt really depends on the annotation processor and what kind of code you are trying to generate. In the author's case it shouldn't take that long nor would it be hard to develop and debug.
- flukus 9y agoI think it depends more on your IDE playing ball with the code generator and custom build steps. Most do an awful job. I'd love one that I could just point to a build tool/script instead of creating it's own.
- quickthrower2 9y agoAlso I've worked places with this magic and no induction or documentation or time for anyone to explain anything. The more behind the scenes hard to discover stuff you implement the better the docs and onboarding needs to be. It can't just be done to fulfill a architect astronaut fantasy.
- flukus 9y agoI don't care so much about the documentation, as long as it's part of the build script (it's own documentation) and not checked into source control. By not checking it into source control it won't be edited, there won't be a mix of generated and custom code. By being part of the build process you avoid the generation tool and scripts being lost to the sands of time.
- quickthrower2 9y agoI like the build process to be committed personally for build reproducibility. It can be in a seperate more secured repository though.
- cel1ne 9y agoI wrote an annotation processor for [0]. If you use Kotlin instead of Java it's way better because no nullability-issues and it's super-useful standard-library. And once you've figured out how to hook it into gradle, IDEA etc., which admittedly cost me an hour or so, you can reuse that knowledge for every annotation-processor to come. I made it a habit to set myself a time-limit EVERY time I start touching the build-process. After the limit has passed it must be faster, more automated, or in any other way more useful, or I will revert the changes. [0] https://medium.com/@spitzwegerich/generated-json-serialisation-for-kotlin-4470dabe40b8 https://medium.com/@spitzwegerich/generated-json-serialisati...