Efficiency is Key

29 Nov 2018

Coding Patterns

Have you ever gone over to your friend or colleague’s computer to help them with their code and it is poorly laid out and basically unreadable? You could probably chalk that up to them not having a coding standard or general design pattern. Having good design pattern can aid this situation from coming up or at least help mitigate some of the pain. Some common design patters in regards to computer science are indenting, where a user puts their opening brackets, or how a user comments their code. Other patterns could include how the user names their files and how they break up their functions in the code. As long as the creator is consistent enough with their work a good design pattern will help anyone coming across the code understand it faster and just make it cleaner in general. I personally I prefer the starting bracket on the same line as a function, method, or class. I also don’t like giant comment blocks but rather I prefer little comments along the way to guide me.

More Than Code

Design patterns don’t just apply to the end product, it could refer to the process to get there. Workflow is a design pattern as the creator normally will consistently work a certain way. The pattern that I design in tends to be what I would consider the worst. I am a last minute man, I tend to work a little harder when I have a fire under me however I do blame college for some of it considering I need to do other work on top of it so I tend to get to things the day they’re due and later rather than sooner.

To Sum it All Up

The idea of a design pattern is good but it must be adhered to in order to achieve a good end goal. I know when I code I tend to get lazier as it goes on. Some of that could be due to the fact that I will work later and later and end up being more tired but other times it just happens. Sticking to a routine in life is important and so should sticking to a design patter in computer science. Now obviously its not as life changing or important but the little things add up.