I do not doubt you have good ideas but sometimes some other people also have them. Why don’t you give them a try?
When it comes to software development, innovation is a core concept. Especially when you are competing with many other programmers and you want to show that you are the best and you deserve that dream job. After you know the basics of a programming language you want to start creating things very fast. You deploy your firsts applications but you don’t take care about scalability and good programming principles. You may think, «I will never use it, that is old fashioned, I can do it faster».
You may be right but then the problems come. It is true that you can develop amazing apps with spaghetti code but maybe that app won’t be able to scale properly or maybe no other engineer will understand how it is supposed to be working. That’s why you need some programming principles to follow. Don’t think about originality. You didn’t create them but you are going to use them because they will help you to write great code.
Of course these principles are Object Oriented based (our entire course is about OO). Here you have a few of the principles:
- Open Close Principle (OCP). Classes should be open for extension and closed for modification
- Don’t Repeat Yourself (DRY). Avoid duplicate code by abstracting things that are common
- Single Responsibility Principle (SRP). Every object should have one single responsibility
- Liskov Substitution Principle (LSP): Subtypes must be substitutable for their main types.
For the first one the main idea is that you think about inheritance and never try to destroy the actual behavior of a class. The second one, DRY, is quite clear because it saves time and make your code cleaner. Regarding the third principle, it leads to another programming truth: each of your objects should have only one reason to change.
LSP has an exotic meaning (who is Liskov?) but in general terms it says that you should use delegation instead of inheritance when you want to use some functionality on another class but you don’t want to change that functionality. Some other times the answer will be to use composition, it’s hard to define and only with practice you will acquire the expertise.
Also, we had covered some other basic principles that are easier to understand but very powerful in practice:
- Encapsulate what varies
- Code to an interface rather to an implementation
- Each class in your application should have only one reason to change
- Classes are about behavior and functionality
Remember, the objective is to make your programs maintainable, flexible and extensible. Use the tools you have.
Here is a video that explain the principles in a clear way:
References:
Head First Object-Oriented Analysis and Design: A Brain Friendly Guide to OOA&D. A McLaughlin, B, A Pollice, G, A West, D. 2007. O’Reilly Media, Incorporated.










