Hi, again. I spent 10 years to become a Junior to an kind of Software Architecture. And I still have a lot of things to learn. So that if you want to become a better developer, let come from the principle first. In this article, we’ll look at what makes great programmers. This is Part 2 in series of “How to be a better programmer”. Let’s go.
Decompose your blob
– Reduce class complexity.
– Don’t make spaghetti code.
– Classes should be high cohesion and loose coupling.
– Try encapsulate the classes with access modifier.
– Keeping It Simple, Not Stupid
Code fixing
– Only write as much code as is needed. Anything extra is complexity that will become a burden.
– Avoid implicit assumptions in your code.
– Apply bugfixes to the root cause, not where symptoms manifest. Sticking plaster symptom-fixes do not lead to simple code.
Code Design
– Simple designs aim to prevent misuse. They may involve extra internal complexity in order to present a simpler API.
– Simple designs are as small as possible. And no smaller.
– Flexibility go with complexity , consider it.
Care about the architecture
– Clear architecture helps reduce duplication of functionality.
– Software architecture is not set in stone. Change it if you need to. To be changeable, the architecture must remain simple. Resist changes that compromise simplicity.
– A clear architectural design leads to a consistent system. All decisions should be taken in the context of the architectural design.
– Defer design decisions until you have to take them. Don’t make architectural decisions when you don’t know the requirements yet. Don’t guess.
– Every design is trade off, let find the high priority and make the decision.
Software development is art and you are artist
– A programmer needs good taste and a sense of aesthetics to write exceptional code.
– Good software development is not cowboy coding, throwing down the first code you can think of. It is a deliberate, considered, accurate endeavour.
– Good programmers work with humility. They admit that they don’t know it all.