Search This Blog

Loading...

February 1, 2016

A Day In The Life Of An Enterprise Programmer

It starts with investigating a reported bug. 

More often than not his/her hunting for the source of the said bug results in discovering more bugs to bug him/her.  ::facepalm::


Still can't empathise with him/her? Check out the visual metaphor below



#DebuggingLegacySystem #Fragile #FAIL

March 26, 2015

Blocks not Parameters for logging debug information in Ruby

Okay, it really matters if you've got to log your debug information that is more than a plain dumb string without any concatenation.

Let's take our typical habit of writing a debug like below:
logger.debug("This is a " + potentially + " expensive operation")

The above snippet could be better written as below:
logger.debug { "This is a " + potentially + " expensive operation" }

The block form is recommended because the code in the block is evaluated only if the debug log is to be written/logged. 

Reference:
[Ruby Doc] How to log a message?

March 9, 2015

The Bad Developer

"Discipline.. do I look I care?"
It takes one rotten apple to spoil the entire cart of A-grade apples. And it takes one, just one #BadDeveloper to spoil the spirit and works of the entire team and hurt the project beyond anybody's imagination - no pun intended here. It thus becomes imperative to quickly identify the behavioural traits of the #BadDeveloper to save the team, project and the business from sinking.

Here is a quick list of How-To(s) to find out the #BadDeveloper (or the rotten apple in your development team). How to deal with him is for the other post. How to identify him in your team is the focus of this post.

By the way, the list in not comprehensive and I'd appreciate your participation in growing the list by commenting your experience in the comment section of this post. It helps and indeed matters!

February 14, 2015

How to check whether a string contains a substring in Ruby?

Typically, one would expect (at least I end-up trying this first, almost everytime) a method by name contains? to be available for use. Unfortunately, it isn't present.