Best Practice – Leave the ego behind, Be eager to learn

We always learn from books and now a days from internet. But IT is such a field where we learn a lot from our colleagues. They are our best references, but there are software developers who either feel shy in asking their doubts or if they will ask then they are not thankful to others so ultimately when they ask next time they get zero answer.

IT is vast and nobody can have complete knowledge on any subject. Every day we come across different problems. So Ask…Don’t feel shy if you don’t know X.

I’m not suggesting you to bother someone unreasonably and asking for spoon feeding to learn anything. NO, be polite, thankful, to the point, understanding and supporting to others.

New technologies are coming everyday

If you want to sustain in the market then you would have to keep yourself updated with latest IT tools, and technologies. Following are the few sources

  • Technical Forums over the internet.

  • Technical magazines on various IT subjects.

  • Technical Bulletin Boards

  • Conferences, Trainings and workshops

  • Latest versions of old tools and packages, languages etc.

Best Practice- Keep your Commands, Tools & Techniques Handy

You might be require to test your application url time and again, now typing it every time or searching it time and again might lead to time loss and may result in incorrect urls as well. Here the best practice it to bookmark the application url in the bookmark toolbar and use it.

There are lot of common tasks like stopping the server, redeploying etc. instead of running the commands you can write all of these in a script and keep that script handy to run.

The database url, port, credentials and other important stuff, which are generally required at the time of setup, but if not kept safely, will eat up a lot of time when required again. so keep them safe as well.

Best Practice – Keep your Code and Documents Safely

Multiple copies create confusion

This is true that having backup is one of the most important best practices but it should be maintained in well managed way like you can use tags like name, date and time of the backup, version etc. otherwise if you have multiple copies of the same source code or document, then it will create confusion and it would be difficult to identify latest code or document.

When taking a local backup, if you do not give a proper name or strategy, you end up updating a different file and wonder that why it is not getting reflected in your application isn’t funny. At times older files overrides the latest code and causes trouble. So make a strategy or standard and follow it religiously.

This is strongly recommended to use proper source code version control system. There are many source code version control software freely available like (SCCS, CVS, Subversion etc.) which you can use to store different versions of the software. But while using a source code control system then following the following rule:

  • Always take source code form the controlling system.

  • Assign a new version to every change.

  • Always put source code back into controlling system.

Best Practice – Code should be written to be reviewed.

While writing your software code, keep in mind that someone is going to review your code and you will have to face criticism about one or more of the following points but not limited to:

  • Bad coding

  • Not following standard

  • Not keeping performance in mind

  • History, Indentation, Comments are not appropriate.

  • Readability is poor

  • Open files are not closed

  • Allocated memory has not been released

  • Too many global variables.

  • Too much hard coding.

  • Poor error handling.

  • No modularity.

  • Repeated code.

Keep all the above mentioned points in your mind while coding and stop them before they jump in your source code. Once you are done with your coding, go for a self review atleast once. I’m sure, a self review would help you in removing 90% problems yourself.

Once you are completely done with your coding and self review, request your peer for a code review. I would strongly recommend to accept review comments happily and should be thankful to your code reviewers about the comments. Same time it is never good to criticize any source code written by someone else. If you never did it, try it once and check the coder’s expression.

Accept criticism but don’t criticize

Poorly written source code teaches you to write good source code provided you take it positively and learn a lesson from it.

bug_free

Your target should be to stop the bugs at first place and create a BUG FREE code. Think like a tester so that you should have a challenge for the testers.

Best Practice – Follow the defined standards, don’t create it

Most of the standard software organizations maintain their coding standards. These standards would have been setup by well experienced software developers and after spending years with software development. This is equivalent to following footsteps of great people left behind them.

follow_standards

If your organization does not have any standard then I would suggest to search for internet for coding standard for different programming languages and you will find many. A coding standard would fix the rules about various important attributes of the code, few are listed below:

  • File Naming convention

  • Function & Module Naming convention

  • Variable Naming convention

  • History, Indentation, Comments

  • Readability guidelines

  • List of do’s and don.ts

But once defined, start following the defined standard instead of creating or changing them everyday. I would definitely say:

Source code is your BABY!

So keep it clean, consistent, and beautiful. When I say beautiful, it really means beautiful. If your code looks beautiful then it would be easy for others to ready and understand it. If you will keep changing coding rules everyday then after few days you, yourself would not be able to read and understand the code written by you.

If standard is not set, then create the standard but you have to follow some standard, else without any guideline or standard, it would become a mess over the period of time.