The road to hell is paved with copy paste

The road to hell is paved with copy paste

Schneider Electric
Tijana Lalošević 3 min read
The road to hell is paved with copy paste Sounds h

Sounds hypocritical, doesn't it? But this time I don't mean our everyday small programming sins when we "steal" code from stackoverflow or adapt some old algorithm to a new problem. I mean those much worse things that we routinely do, totally unaware of the fact that we are producing bugs.

As software developed and those who are not from our world of programming, began to accept it as part of their everyday life, there was a sudden expansion of the software market. Computer science used to be limited to programming things of general public importance, but today we literally live with the software. With the growth of the market, and thus the demand, the price of software has increased significantly, and programmers have become a scarce workforce.

Developing a completely unique solution for each client is economically unprofitable and it is almost impossible to produce that amount of software in the foreseeable future. Because of this, the companies decided to create a unique product that they will adapt to new clients, who have a similar business process. So, instead of programming from scratch each time, they overlay the new solution on top of the base code. This approach is called a software product line. Such products are economical, but also very challenging. The process itself has been around in the industry for decades, commonly known as the conveyor belt process, but has only been used in software engineering for just over a decade. The implementation of SPL has led to increased productivity, but is this process optimized? Are we really using all resources to their full capacity?

Once the practice of extending the model is established, it is not deviated from. With the arrival of new projects, after a couple of similar extensions, we all unconsciously start copying the previous project. And that brings us to the point, over time people start to get tired of the non-creative part of the work and by constantly copying old code they often create some small bug, which is difficult to catch later because, for example, there is a wrong archiving of a certain field or bad mapping to the graphical user interface and the like. You will agree that we encounter this in college and that we often ask ourselves: Why do I have to do this? After that, when we finally get to the creative part, we will be exhausted from the heavy copying and rewriting and we will not be the best concentrated, so we lose the quality of the code. And not only in terms of quality, time itself is the most valuable resource that a person has, therefore, if we spend two or three programming days copying old code, we have not only wasted the company's resources but also our own. We didn't learn anything new in those two days.

How to get out of this vicious circle of good intentions? The answer is simple. The very fact that we see a template, that is, an established practice, the solution is imposed on us - a model-driven methodology. That is, writing code that writes code.

Author: Tijana Lalošević, Software engineer, Schneider Electric Development Center

I invite you to the PowerIT online conference organized by the Schneider Electric Development Center where I will tell you more about how to write good basic code or adapt existing code. As well as how to write your own code generator and what different programming languages ​​offer.

[10:27 AM]