November 2018
Intermediate to advanced
346 pages
8h 12m
English
Simply put, high readability means being able to read the code and understand it. Code that is not readable will slow you down and could lead to mistakes, where you assume it does one thing but in fact it does something else.
Let's look at an example, shown in the following code:
type House struct { a string b int t int p float64}
In this example, the code has a problem with its naming. Short variable names seem like a win; less typing means less work, right? In the short term, yes, but in the long run, they are hard to understand. You are forced to read the code to determine what the variable means and then re-read the code within that context, whereas a good name would have saved us from the first step. This does not indicate ...
Read now
Unlock full access