CodeNewbie Community 🌱

jake
jake

Posted on

The Pragmatic Programmer: A Pragmatic Approach

Don't Repeat Yourself! Don't Repeat Yourself! Don't Repeat Yourself!

I have personally experienced the difficulty involved with modifying repetitive code, some being my own and some being left behind by previous programmers. It is horribly annoying, in any of its forms. But I must admit it is difficult to avoid if I am not taking the time to think about my code, rather than simply making it work.

On the topic of orthogonality - my lack of experience once led me to believe that different components of an application were inherently orthogonal. The UI is the UI, the database is the database, and so on. Until I worked with a system that was completely inaccessible when the database went down, because pages were rendered with html stored in a database table (correct me if I am wrong in assuming this is not orthogonal).

The last topic from this section I would like to discuss is estimating. Probably one of the simpler concepts in "A Pragmatic Approach", but includes a pro-tip I had never considered before that I will share with you all.

If you are giving your boss/customer a timeline on a project, choose your language based on the duration:

1-15 days, use the word days

3-6 weeks, use the word weeks

8-20 weeks, use the word months

20+ weeks, use something like "About x months"

Happy Coding all!

Top comments (1)

Collapse
 
jacobvarney profile image
jacobvarney • Edited

Until I worked with a system that was completely inaccessible when the database went down, because pages were rendered with html stored in a database table (correct me if I am wrong in assuming this is not orthogonal)

Since you asked, I tried to learn about the orthogonal principle and I believe what you're describing is a non-orthogonal application. If I were to try to suggest a more orthogonal design, the component serving HTML and the component managing the database would not be so coupled. I may just also be thinking of a simple MVC as the only example I can draw on right now ¯_(ツ)_/¯

I don't think the rest of the elements in your paragraph have to be non-orthogonal. Some of them may be "cohesive" enough that they constitute a single component. I think the key part would be that you could internally change how a component works (e.g. modify the implementation of a database, perhaps to optimize it) without impacting another component coupled with it (e.g. a software application does not depend on details of the implementation of the database). I also may be wrong!