Good Code - A small walkthrough !
What is Good Code ? Even if I say nobody cares about your code the quality nonetheless does influence a project. Functional correctness reigns supreme, but if we put that aside what should we look at next? Cohesion and coupling are the two most significant aspects of code impacting software quality. Cohesion Cohesion is how well the bits of a module fit together. A set of functions, an interface, is considered cohesive when each function is closely related to another. For example, drawLine and drawCircle are closely related and belong nicely together in a single Draw module. If functions differ in their behavior a module becomes less cohesive. For example, drawLine and calculateBalance don’t seem to be related at all, So putting them into the same module doesn't make any sense at all. We can roughly measure cohesion by how simply and pre...