Little bad habits

Programming will eventually create little bad habits. Some coding habits that make the readability of the code bad, but improve speed when coding, some other habits like not adding comments whenever you are coding something. The worst of the bad habits I have seen so far on any developer is related to quality. The developer will create a excellent logic but very rarely will check the output against what it was supposed to be. This habit is usually fixed with PHPUnit testing that usually points out very well what is expected against what the method has returned.

A little example of this habit can be described as: The method should return the birthday date of the user created and it returned the created date.

A simple issue like this goes on to a production environment without being noticed. The coding has no output errors (it returns a date). The QA team will look at it and most likely will approve the code (not saying that all QA teams will pass this, but a simple error some times are rarely seem). The OPS team will not notice the error, the server doesn’t have any log entries for errors, warnings or notices. In the end one small bad habit could have became a huge production issue.

The example above covers a date, which in most of the cases will never be an issue to anything, but consider that the issue was a floating point error of $0.01 in every transaction made. This could have became a huge mess.

Regardless of the fact that all developers should pay more attention to little details, even when you don’t have much time you can still be safe from bad habits and avoiding coding errors just by having a good unit testing in place.

My bad habit, is not having unit testing in all of my apps (at least this one I can still fix :D)

Advertisements

About mcloide

Making things simpler, just check: http://www.mcloide.com View all posts by mcloide

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: