Monday, November 30, 2015

R.I.P Internet Explorer 7 and 8


Last week, I received an office email that will forever change my life as a web developer. The email says that starting January 13, 2016, Internet Explorer 7 and 8 will no longer be supported by Microsoft and that means our company will also no longer support them in our future product releases. OMG, that is the best news ever!!! IE 7 and 8, let me take this opportunity to say my short final words to you.

Dear IE 7 and 8,

We had our good times and bad times (most of the time). I can't count how many sleepless nights I had trying to figure out what's wrong with my JavaScript and CSS codes and why it's working on most browsers except you. Although we had incompatibility issues in the past, I hope that we can remain as good friends. I wish you all the best in your future retirement. 

Sincerely,

Dev-Who-Waited-For-This-Moment-To-Come  

Saturday, November 28, 2015

Programming Jargon: Yoda Condition


I have been in the software development industry for almost 10 years but it was only recently that I learned about the programming jargon Yoda Condition

It all started when my code reviewer noticed an if-condition similar to the following:

if (stringVariable.equals(STRING_CONSTANT)) {

}
He pointed out that it’s not null pointer-safe so I said I’ll just change the condition into this:

if (stringVariable != null && stringVariable.equals(STRING_CONSTANT)) {

}
That was the time that he mentioned about a better way to rewrite the above if-statement using the Yoda Condition and I had a big question mark on my face upon hearing it. After asking Mr. Google, I found out that in Yoda Condition you have to place the constant on the left side of the comparison operator while the variable is on the right side. Obviously, it was named after the Star Wars character Yoda who speaks English using the form object-subject-verb (e.g. Apple I eat).