The idea of this reading was to convey “SOLID” coding practices that all developers should strive to employ. The “STUPID” part of the article refers to: Singletons, Tight Coupling, Untestability, Premature Optimization, In-descriptive naming, and Duplication. All of these are concepts I have absolutely used many times in my career as a computer science student. I still find my self using terrible variable names such as “x” all time. The basic over view of “STUPID” is that it is a novice way to code, and pretty much how everyone starts out.
Next the article moves on to “SOLID” which consists of: Single Responsibility, Open/Closed Principle, Liskov Substitution Principle, Interface Segregation Principle, and Dependency Inversion Principle. The aim of the “SOLID” ideology is to produce code with high cohesion. In short going through the list one should strive for:
- keeping classes to a single responsibility, instead of having a class control multiple jobs. This is to keep coupling low.
- projects and classes should be open for extension and closed for modification.
- The liskov principle states that sub-classes should be replaceable by their parent class.
- Interfaces should be as direct as possible. Just like the single responsibility principle for classes, interfaces share the same idea. That is, one should not implement an interface that contains methods that are not needed.
- Finally, use the same level of abstraction at any given level, and interfaces should depend on other interfaces.
Employing these concepts will lead to a highly testable, and cohesive project.