Tuesday, July 26, 2016

Formatting Strings in Java, a better way of logging!


As developers we should always choose the elegant way to do things.
One of them, is writing the log messages. Logging is important as it's the only way to see what your users/application has done or doing. Hence, it should be done elegantly. :-)

For example, if you need to write a log like this:

logger.info("records updated for user:"+ userId + "of org id:" + orgId) ;

Instead, you can use String.format(), and pass formatted string like this: 

logger.info(String.format( "records updated for user:%s of org id: %s",  userId, orgId) ) ;


Friday, July 22, 2016

What Agile Scrum is not? And, breaking some myths about scrum....

In the madness of selling Agile and adopting the buzz, many wrong interpretation and implementation is rampant. We need to understand and remind ourselves that,

Scrum is not:

  1. Marketing gimmick!!! Please stop fooling customers by setting wrong expectations.
  2. about doing no documentation at all.
  3. about saving cost ( in longer terms may be, but not ROI take some time )
  4. a magic wand, that will produce software in a day/week.
  5. asking customer that we would do everything for you and you sit back, relax and enjoy. Rather, scrum is about sharing journey with customer.
  6. Making developers commit to some stupid timeline, and leaving developers no choice!
  7. Is not very helpful, if don't align/improve your engineering practices to be able to ship quickly.


Will continue updating this, based on my experience. Any comments or personal experiences are welcome. :)

There is no ideal world, but, we as professionals, must be aware of what is right and what is wrong and stop saying Yes, when you want to say No.

Scrum Values

People often talk about Agile principles and Scrum but they leave the Scrum values aside, probably deliberately since they are pretty tough to achieve and practice.

But, when we are practicing Agile its only important that we keep reminding ourselves about these values and drive to achieve them.
Recently, I attended a session on Scrum. I think the most important takeaway for me was Scrum Values. It's not an official version not even the exact version that I got. But, as I remember correctly, here they go:

  • Self Organization
  • Trust
  • Respect 
  • Sense of urgency
  • Avoid Shortcuts
  • Share Journey with customer
  • Courage
Its not often that you sit in a session and talk about the values. But, recently, I was attending one of internal session and one of top leader was speaking. He said couple of interesting point about company's values, one that these are the guiding principles and secondly whenever you are in a situation where you are not sure whether I am wrong or right, please refer to these values. If your actions are aligned with them, you are good.

The same goes with practicing Agile!
For example, if you are showing some courage to say NO to something you are uncomfortable with or your gut feeling is not allowing to accept it, you are good. 

Sense of urgency, I also somewhat interpret this as ownership of a task/issue. It is very important that when you own the task you drive till it is "Done", to whatever is the definition is.

Similarly there can be various scenarios where these values can act as guiding force. 

Keep looking for the anti-pattern and allow these values and (of course principles) to do a course correction.


Tuesday, July 19, 2016

How to use Custom Perl Modules

Perl modules are easy to create and are used a library which you can reuse in another program or modules. However, for use it you need to do a bit of tweak in the environment, so that the interpreter can find the perl module.

@INC is the array, which works like CLASSPATH, in case you are familiar with Java. so, in the beginning of your code you need add the path where to find the perl modules you are using,


BEGIN {
        unshift(@INC, '/lib');


 # considering my perl module is located in /lib folder, relative to the current perl file

Now, @INC is an array which contains the paths of libraries, in case perl it is .pm files. And, unshift is used to append the path in the begining.

So, this code tweak make Perl interpreter aware of the path and you Perl code runs perfectly fine.  



Prototype

Prototype is another creation pattern. Intent:  - Intent is to create objects by cloning existing instance  - Specify the kinds of obj...