Product Development: Design is more important than you think

Programming is just another tool like hammer or plier the only difference is that lot of it is mental while lot of work with hammer is physical. But this doesn’t mean that we should be using U-shaped hammer, that would be really stupid. The reason behind the design of the hammer is Force that can be produced by swinging it and it doesn’t require complexity, a simple piece of wood and iron head works. Programming should also be like that, having reasonable design.

Design is not abstract. It also has rules, just not as clear to everyone.

In my early days, projects used to have messy programs but nevertheless they would just work fine. A function here and a function there with arbitrary code inside them that would just work. At that time, goal wasn’t writing the best program but to make the project work. The feeling that I have built something. As I have practiced more and more and built something for longer term made me realise that program should also have design. It should be simple and follow a pattern.

Patterns are like musical notes, once you get hold of few you can imagine what can come next.

See the picture at the top, that’s what most programs look like. We all write something which ends up looking like that. Functions getting called and written at arbitrary places, passing data and modifying at unknown places and sometimes there is a legacy code which just doesn’t let you write improved version because it’s just too much work. Hence, design is important. In programming, it is called design pattern.

Design pattern helps in structuring of code in such a way that if you know how one piece of the code works, rest can be figured out. They are inspired by real-life structures and manufacturing system. Visualising code as a physical system is of great help as brain can easily consume the information and can draw parallels. Design patterns are available for all languages (google “<language> design pattern”).

The other paradigm of programming is anti-pattern. Anti-pattern is a solution that seems to be working but is counter-productive. When working on a solution like this, it can be perceived that the solution can be easily implemented but when approached it becomes highly complex, confusing and probably inefficient. A programmer must study both aspects of the programming language, not only will this help in writing better code but in framing better solutions. The complexity of solution is often related to the design we have in our head and having structured thoughts leads to better and quick implementation.

The other reason why our programs should have a good design is the cost of maintenance. It may seem like that the cost of writing code that works is less but over the period it will end up costing more. Once there is a bad code in the system, it will continuously need fixes and rework which ends up costing more than it would have otherwise. The cost is not only money but time as well, which is far more important. But you should not go to the other extreme as well and write the great code because making it perfect is nearly impossible, it will always have shortcomings. A good code is which anyone can read and doesn’t require frequent maintenance.

To read more: Source making or Design Patterns by gang of four for languages like C++, Java, Python etc.

Languages: Best way to learn the concepts

If one wants to pioneer software engineering, they must learn languages.

Computer languages are similar to languages that we speak. People who speak multiple languages are generally good at understanding complex things because of the rich vocabulary. The more languages a person knows, wider is their horizon. It has been scientifically proven that learning languages rewires the brain and improves the memory. The same can be said about programming languages. Every language has its own paradigm and concept that its built on. Even if a person doesn’t want to use the language, I believe they must read about it. It’s the best way to understand different concepts, principles and constructs and to come up with a new one.

Every programming language is built on an idea and more often than not, it is unique. Programming languages are usually built on new fundamental ideas about software engineering and solve certain types of problem really well. That’s why functional programming languages are different from object-oriented from procedural languages. One can take principles from these languages and re-construct in the language of their choice if they want to, for example now many regular programming languages support functionalities of functional languages.

After learning few languages I have stopped thinking in terms of languages. I use my understanding of languages to map solutions of a problem. I then try to find the constructs which can help me in implementation in the easiest way. Easiest way may not be a best way but then that is a trade-off that one has to take while building a product.

More often than not, one doesn’t need to build the best product but only the product that works.

Once a person get hold of few languages, it also become easy for them to learn new languages because the major part of any language is redundant. It’s only the new concepts that take time and they are not many usually. Often the learning curve is not steep if the language is of the same paradigm that you are used to. Usually a person doesn’t need to work on more than 2-3 languages at a time and that is enough to implement the foreign concepts from the different languages. Although, it takes time to reach that stage but it is achievable. Hope to see you there!