A good programmer is someone who always looks both ways before crossing a one-way street. ~Doug Linder

Working as a software developer in the IT industry, one thing that drives us daily to the workplace; is that fun and passion lie in programming. But to make that programming fun and to get an eternal elation out of it, one needs to understand and stick to some basics to make you a good programmer.

I am not writing mantras that you can follow to become a good developer, but the intention is to make a list of helpful tips which I learned and implemented in the industry to get good results. There is no definition of a good programmer, but here we are referring to the category of the programmer who has developed excellent IT solutions and helped in the overall growth of this industry.

Know your Basics

As it is true for any industry and any job, the conceptual understanding is the key to success. Unless one has a strong conceptual foundation, he/she can never be a good developer or any other specialist per says. The core conceptual understanding helps you in designing and implementing the best solutions in the best possible way. If still, you feel a gap in core computer science and your programming language specific concepts, it’s never too late to go back and review the basics. Basics are essential.

Start putting question tags (how? what?) with every set of code you write

One thing that I realized creating a clear separating line between good developer and rest is that striving to know what and how it is happening. There is a small group of people who can never leave a code without knowing exactly what is happening when it executes. I understand that in tight deadlines, we don’t get this liberty always and so have to leave the code just knowing that it’s doing what it must do. Although this is a bit different topic of how to handle such situations, as a programmer one can always try the level best to dig into as much as one can. And believe me, this becomes a habit with time and then you do it automatically every time.

You learn more by helping others

Most of us have a common tendency of turning our heads toward forums or groups only when we need help. And again a clear separation between the good programmer and the rest that the first ones visit these places more often to help others. This makes them learn more than they learn to get their problem solved by someone else. Within a team as well, help others to solve their problems. Believe me, understanding others’ problems in their context, investigating them, and providing solutions; will leave you much more professional than before.

Write simple, understandable but logical code

As in almost every aspect of life, the formula of KISS (Keep it simple and short) works in programming as well. Write more logical code and avoid complexity. Sometimes people do write complex code just to prove they can write such codes. My experience says that simple but logical codes always work well, resulting in fewer issues and being more extendable. I remember an excellent quote:

Good code is its own best documentation. As you’re about to add a comment, ask yourself, “How can I improve the code so that this comment isn’t needed?” ~Steve McConnell  

Spend more time in analyzing the problem, you’ll need less time to fix it.

Spend more time in understanding and analyzing the problem and designing solutions for it. You will find the rest of the things quite easy to do. Designing does not always mean using modeling languages and tools, it can be as simple as looking at the sky and thinking of the solution in your mind.

If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it. ~Richard Pattis 

Be the first to analyze and review your code

Although a bit difficult, try to break your own code before others can, and in time you will learn to write close-to-bug-free code. Always do a close and unbiased review of your code. Also never hesitate to take others’ views on your code. Working with good developers and taking their feedback will surely help you become a good programmer.

Don’t dismay yourself by looking at changing technology world.

Over these periods in the IT industry, I met with many people who are either disappointed by their work or even left it to search for new jobs saying they want to learn and work in the latest technologies. I don’t see any problem with these wishes but the very first incorrect word is the ‘latest technologies’. What we are hearing every day and mean here is new tools, APIs, frameworks, and other means coming up every day to make the programming easier and quicker. This anyway will continue to be in the technology world. But what needs to be understood is that the core and basic technologies change at a much lesser pace than frameworks, tools, and APIs around it. This is like the sea where the surface water moves very rapidly but the deep water is relatively calm and concentrated and most of the Aqua’s lives survive here. So, feel yourself in that deep water and close to core technologies. For example in the Java enterprise world, lots of web frameworks exist and new ones come every other week. But the core concepts of the request-based client-server communication, MVS pattern, filters/servlets/JSP, resource bundling, XML parsing, etc remain the same. So spend more time learning these core concepts rather than worrying about ever-changing frameworks and tools around them. Believe me, with the foundation of core concepts, you will always find it easier to learn new frameworks, tools, and APIs.

Workaround doesn’t work for longer time

Many times software developers implement work around solutions (may be because of lack of time, lack of problem understanding or lack of technology experience).  But over the period these work around solutions always resulted in corrupting the code, making it less extensible and maintainable and a lot of wastage of time later on. Always prefer to implement when you know the in & out of the solution. I understand that it becomes unavoidable in some circumstances, but it’s like, one should speak the truth always but you tell lie in some circumstances.

Read documents

I interacted with some excellent programmers who actually have java source projects inside their IDE all the time and read/refer to that in daily work. They do it not only to fulfill their appetite for knowing the basics but also to learn ways of writing good programs. Reading and referring to reliable and known open source code or your senior’s code, can also help you make your programming better.

You can learn from others code as well

One of the essential habits of a good developer is that they read lots of documentation. May it be specifications, JSR, API documents, tutorials, etc. Reading documents helps you create that essential foundation based on which you program in the best way.

And the last, not listed above: Don’t compare yourself with others

Your comparison of yourself with others will only result in the evolution of negative feelings and unhealthy competition. Everyone has got his or her strengths and weaknesses. It is more important that we understand ours and work on it. I have seen many times that so-called ‘fundoo-programmers’ (fundamentally strong programmers) also make silly mistakes. So, analyze yourself, list down your areas of improvement, and work on them. Don’t compare someone’s tomorrow with your today. Developing is real fun, enjoy it.

Any fool can write code that a computer can understand.  Good programmers write code that humans can understand.  ~Martin Fowler