3/12 The becoming of a good programmer with great habits
“A programming language is a formal language, which comprises a set of instructions used to produce various kinds of output. Programming languages are used to create programs that implement specific algorithms.” ~~~ Wikipedia
Why am I sharing the definition of the programming language with you?
Because I want you to know that the ‘sole purpose of any programming language is to generate output — not just any output but one that fits the requirement specification of its target user, to become that programmer, you need to understand the core constructs of a programming language first.
Some of the healthy programming concepts are mentioned below:
1) Store data into the code using variables and objects. Think about Facebook storing millions of user data to show you the text, images, videos, etc.
2) This will allow us to create arrays and collections so that we can place a list of similar types of items together.
3) Use APIs to connect with the external data safely and securely.
4) Instead of typing logic manually, use logical and comparison statements to differentiate and make decisions. It will decrease the size of the code and increase efficiency.
5) Use Comments wherever possible to specify what we ask the machine to do in an understandable human language.
There are two types of programmers: One who writes code so simple that there are no deficiencies, and the second makes it so complicated that there are no obvious deficiencies.
Both of them are in the race to rule the world, but the first method is a far more difficult path to becoming a bigger and better idiot-proof programmer. If you haven’t already decided on your type yet, I’d advise you to do it now!
Here is a sure-shot way to becoming the programmer who writes the code that computer, as well as a human, can understand:
1. Use more declarative documented comments in conjunction with single/multi-line comments to make the code more understandable to a human.
2. User properly structured indentation takes special care of where the code starts and ends.
3. Proper naming conventions will make your life much easier. Use the single responsibility principle for naming class, use camel case for naming variables, and avoid magic numbers.
4. Good code is well-tested. The test serves as an executable specification of the code and examples of its real use.
5. Good code does think in a straightforward and obvious way.
6. Good code is developed in small, easy-to-read units of computation. These units are reused throughout the code.
7. Instead of reinventing the wheel, use standard libraries and extensions wherever appropriate and available.
Let’s incorporate these small but vital changes in how we write code. These small things make a lot of difference, especially in code hygiene. Let me forewarn you — — good software developers don’t just code. They do much, much more…
I am cooking up the 4th in the series of 12 articles. Until then, take charge of your coding habits!