Long Codes vs. Short Codes: What’s Better for Your Use Case?

Posted by Pedram Mohammadi on November 7, 2016

Excellent coding techniques and programming practices are indications of a professional app developer. In order to successfully program, an application requires a developer to make an extensive number of little decisions while trying to solve a greater set of problems. How wisely you make those decisions, whether with long lines of code or short lines of code, relies more on your preferences, skills, and expected outcomes. 

Between long code vs. short code, which one is the better option for you? Here are some factors to consider before deciding whether to use many or few lines of code.

1.  Readability

Martin Fowler, an expert software developer, once said: “Any fool can write code that a computer can understand. Good programmers write code that humans can understand.”

You should ensure your short code texting is designed with other people in mind. As much as it will be processed by a machine, which doesn’t care whether you use long code or short code, your source code will evolve in people’s hands who need to understand how the code operates and what improvements are needed.

So, when building mobile apps, the readability of the source code could be more important than the number of lines of the code.
Here is an example of a code written in two different ways:

First version:

var result = planOne(planTwo(w, planThree(x)), y, z);

 

Read More

Topics: cPaaS, app development, coding