Wednesday, May 19, 2010

Take the plsql challenge

Well, I didn't know that learning a programming language can have the chance to win prizes at the same time. Here's your chance.

plsqlchallenge.com

Don't forget the time is ticking while you're checking/debuging the question in your editor. :P

Tuesday, May 18, 2010

Content matters than technology

I was in the train this morning and I saw a guy with his Iphone. I had a peek to his Iphone to see what he's doing with it and he was searching for his songs. Meanwhile, in my hand, I had a Nintendo DS with a training video about writing (my writing need some improvement). It came to my thought that, the guy's song can be played in my device and vice versa. Subsequently, I remember there one saying in one of the programming book I have read, "content stays, technology moves on".

For example, my name will not change as often as technology. In other words, it can be stored in different types of database and using different types of programming languages. The name will stays until I die; but technology might change to a new level. This leads me thinking about my career, whether I should stick to a programming of particular technology or move to business/functional side. Well, business process wouldn't change as often as technology and it doesn't pay lesser than technical people. Perhaps it's the thought of doing a easier job and getting the same pay?

Imagine after 10 years, will the song and training video be different? It's a dumb question but I'm sure my Nintendo DS and the guy's Iphone will be obsolete.

Saturday, May 1, 2010

Char is not equal to String

Duh! Everybody knows that.

There was bug and it was caused by the above char not equal string(varchar2) logic. Why it is still happening since everybody knows that?

The variable constants was a string 'Employee' and the database field value that suppose to match this constant also show 'Employee'. However, the process logic if-condition has failed. Everybody was scratching head until spaces are found  ('Employee    ') in the database field value.

Ironic isn't it? Looks the same, feels the same but the program has failed because of spaces.

This lesson has brought us to identifiy the when to use the char and string (varchar2). Obviously, the table field shound't be stored as char if it's going to be checked every where in the progarm. As we know, some developer are not going to trim the value before writing the if-condition check.That will cause a lot of maintenance work to replace everyone of the them, where the field is used.

In short, identify the field behaviour and use to the correct data type. Use the wrong type and bugs will be crawling all over the place.