![]() ![]() So he starts thinking wouldn’t it be better to just write a piece of code that does that for him? 2. Pretty good, huh! Except that there are dozens of these properties files throughout the app, and some are huge. ![]() This way any change in naming would result in a code that doesn’t compile anymore. So I’m gonna take a specific case where information about the code you want to write already exists in a structured format (easy to parse), such as JSON, Yaml, CSV… In this case, I’ll build the following very simple chain to generate the code. While the concept of code generation itself is widely spread among developers, I still think that people underestimate the power of it, or overestimate the effort involved in writing code generators. Since they don’t have logic they can be generated, the only constraint is that their structure should be documented somehow somewhere. We spend a lot of time writing entities and config classes whose sole purpose is to carry data. However, most of our code is just simple and void of logic. If your code executes some kind of complex logic it’s already difficult to write, maintain and make sure it does what it is supposed to do. The whole purpose of software engineering is to automate tasks that can be done by the machine, then come the question, isn’t writing code just another task that can be automated? □ While in most industries, there is fear of automation and the impact it might have on the job markets, software engineering is the total opposite. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |