Databasics

Breaking Up Is Good To Do

Take a look at the line of code below:
In this single line of code, six different operations are being executed in order to return a line of text that reads “INVOICE TOTAL ₹127.50”. And while this line of code works from a technical perspective, it’s

unnecessarily complex from a practicality perspective. And this unnecessary complexity means we could spend way too much time debugging the code and/or trying to figure it out when we come back and look at it later in our project.

Let’s break this line of code down according to all of the different transformations and calculations that are included as we see below:
Now, let’s consider the code block below:
The result of the five lines of code above is identical to the single line of code before it. The difference is,
these five lines of code are much easier to debug and understand because each line of the code block is responsible for one calculation or transformation with the final line – line #5 – returning the string display that we want.
The five-line code block will not run any slower or faster than the single line of complex code and it will not result in a Ninox database file that is materially larger in size. Given this, consider BREAKING UP YOUR CODE so that you spend less time trying to decipher and debug it and more time getting the job done.
Breaking up is good to do when you have to execute a number of calculations and transformations
(formatting instructions) in order to get to a final result
en_USEN