چهارشنبه، دی ۳۰، ۱۳۸۸

The r.a.Pe of JSF - Part II: Learn how to program

If you have not read the first part of this series yet, look here.
One of the basic moral principles of Software Development is that if you don't know how to program (and by how to program I mean loops, data types and methods ... ) find another job. At least this way you would make life much easier for the next generation of developers!
There are even some assholes who don't know the basics of programming, but use some advanced frameworks like Seam. The code they produce has always hidden bugs that would not manifest themselves until deadline or demo day! (Moments of truth in our profession)
For example look at this code snippet taken from the mentioned project:
I've got a NullPointerException when the application executed this section. The reason is apparent. The checking for null reference is after calling getType() method! I speculate that the report object is not null most of the time, so the code could be executed without any problem. But I never could understand why he has put the initialization check after that!

For God's sake don't write code like this!

هیچ نظری موجود نیست:

ارسال یک نظر