5 ms·
I started to like Go's code generation approach. Code generation make you very productive since IDE's auto-complete and code search works perfectly and snappy
by kbumsik 4y ago
I started to like Go's code generation approach.
Code generation make you very productive since IDE's auto-complete and code search works perfectly and snappy with the generated code.
The only complaint is that it tends to make noise during code reviews because they include autogenerated code too.
- vbezhenar 4y agoIs it considered OK to commit autogenerated code? With Java I don't do that. It's generated during build phase in output folders but never commited to the VCS. Never had any issues with that.
- kbumsik 4y agoThere is nothing wrong with committing generated code in Ent and Go. I don't know about Java but in Golang it does not create any platform-specific code in general, so committing code in the VCS would ensure reproducibility. It is still OK to commit without generated code and things won't break as long as you pinned the package versions correctly. But some people don't like to put extra burden in the build phase. So it is totally organization's decision whether to commit generated code or not.