Programming the right way.

Nikhil Bansal
3 min readDec 6, 2018

--

This blog is mostly the bi-product of a personal realization after what happened recently. It may not be relevant for experienced developers but I hope it helps people who have recently stepped into programming.

Not every line of code is correct just because it works.

Take some time. Let the above line sink in.

I have come across 3 kinds of developers:

  1. People who don’t know what their code does. It is there just because it was a verified solution on StackOverflow.
  2. People who are aware of what they are writing but they don’t consider the fact that one day that code will run on a machine which is in end user’s hands.
  3. People who know what they are doing and they do it not because it works, but it is the correct approach to do it.

Initial Stage

Initially every developer is at Stage 1 which is fine because you are excited about what you are creating and at max, you’ll show it to your friends which is fine. There is nothing wrong about being in this stage as long as you understand the potential of the technology you are using and what all you can create. Most of us get past that stage when we start working professionally.

Problem

The problem is at Stage 2. Many developers un-knowingly get stuck at stage 2 because they think that they are doing it the right way just because it is working fine on a happy path. (For people who didn’t understand happy path: series of steps that will only lead to success.)

When you are supposed to give something to client, and during the demo it stops working you are left with 2 choices, either you doubt your code stopped working or maybe some 3rd party service you are using f*cked up (maybe a server goes down). Am I right??

No! For people who are in the stage 2, the only thing that comes to their mind is the code written by them went to shit somehow. At that point, it is not just the fear, but to some extent you already know that your code created problem.

Solution

It is important to understand that if you write some code and it crashes in the test environment, it is not a big deal for anyone no matter how big the crash is. But any problem that finds it way through your testers into the hands of people may actually affect their lives somehow. You have to understand here that you don’t have to worry about the criticism you’ll have to face for that mistake but the problem it created for someone who was actually using the product made my you.

As developers it is important to understand that you are in this field because you will be creating products that eventually people will use. So it is important that you do it right way!

Conclusion

I know this may sound general and obvious thing when you read but you’ll actually understand when people will start using your product.

--

--