3 ms·
Better variable names. When I started programming, it was in BASIC. The drawback of BASIC was that variable names were restricted to one letter or one letter p
by simonblack 4y ago
Better variable names.
When I started programming, it was in BASIC. The drawback of BASIC was that variable names were restricted to one letter or one letter plus one digit. So 'A', 'B', or 'A1', 'A2' and even in the same program you could have the numerical variable 'A2' and the string variable 'A2$'. Six months after you write a program with variable-names like these, it's no good trying to maintain such a program because you have no clue what 'A1', 'A2' and 'A3' are at all. And you're better off rewriting the whole program from scratch.
Then followed a stint with COBOL where I learned to use variable names such as 'WEEKLY-WAGE-TAX-LEVEL' which are eminently readable and understandable, whether five minutes later or five months later, or even three decades later. I still have some COBOL source files on my archive partition that are very clear on what the program does and what the variables are for.
Since then, I have done my best to make sure that all my variable-names (and function-names) are picked to enable ease of maintenance.