August 14, 2007

Found this list(101 ways to know your software project is doomed) while surfing this morning. My favorites:
6. Your source code control system is a series of folders on a shared drive

I have seen this a LOT of times. I did this once. We do not know version control then. The last time I saw this I installed a SVN server.

9. You start considering a new job so you don’t have to maintain the application you are building

I experienced this twice. The second time I resigned. The hassle is not worth it. I have more important things to do.

12.Your team still gives a crap about its CMM Level

Good thing they never made me do those documents.

38.FrontPage is your web page editor of choice

I still like the color of the html editor Visual Interdev over Frontpage. I  never used the designer view of FrontPage. It generates bad HTML.

44.All debugging occurs on the live server

I did some debugging on the live server. :)

58.Management can not understand why anyone needs more than a single monitor

At least they never asked why we have Elsa Gladiac(GeForce 2) on our machines. Hehehe.. :p

65.Now it physically pains you to say the word – Yes

There was this time that I got scared everytime I hear my office phone rings.

75.You bring beer to the office during your 2nd shift

Hehehe…
83.You start wondering if working 2 shifts at Pizza Hut is a better career alternative

I did think of having an isaw stall.

92.Your manager substitutes professional consultant advice for a Magic 8 Ball

To CRS team: We never used the magic 8 ball for registration decisions right?

99.You are using MOSS 2007(Sharepoint Server)

I have no love for Sharepoint. Its hard to configure and its freaking slow.

To improve the quality of our code, aside from the usual code review of the owners of our application, we ran a code checker. One of the things that it caught is the use of System.out.println. Some of the designers wanted it to be replaced with log4j then configure it to output to console.

Since the application is meant to be run in the command line, I argued that System.out.println should remain because it is not a log but a console message(i.e. “usage: program_name <arg1> <arg2>”). A log, I argued, is different from a console message. Although we can configure log4j to do the same thing, I believe that it should not be used for console messages.

One of them replied that console is only one of the different outputs. And console messages, he argued, like logs tell something about the program.

I just replied:

A console message “can” but not necessarily tell something about the program.

public class HelloWorld {

    public static void main(String []args) {

       System.out.println(“Hello World!”);

    }

}

What do you think? Am I right in asserting that log4j should not be used for things that is not log related?

Coding Blues

April 27, 2007

I have been doing designer(software design) work for the last few weeks and one of my job is to make those SQL queries. One of the things that I wanted to revise was the stored procedure to update the main table. The data will come from the temporary table. If the data is not present in the main table, insert it. Otherwise, make an update. It was implemented using cursors(yuck!). So I created the SQL queries which looked like:

update main set …..

from temp

where temp.pk = main.pk;

 

insert into main(…)

select  …

from temp left join main on main.pk=temp.pk

where main.pk is null

 

 When I showed it to the developer he said that update-from will not work in Oracle. WTF!?! MS SQL Server has it. PostgreSQL has it. I don’t know why Oracle can’t have this powerful SQL extension. One of the few things that I like with MS SQL’s T-SQL is that its easy to use. Even MS SQL Server 7 has a join keyword which makes your SQL easier to read. In Oracle at that time you need to use the + operator. I was thinking that since Oracle is the bigger company they should have a better SQL language.

I did revise the earlier query but its a bit uglier.

——————————————————————-

One error that I keep on seeing is the improper use of random number generators. If for example you have ten choices and you need to randomly choose between them you get a number from the random number generator then from that number determine your choice. You should have something like the code below:

int num = random.nextInt(10); //gives a number from 0 to 9

if(num == 0) {

//do something

}  else if(num == 1) {

//do something

} ….

 But no. What I usually found in other people’s code was:

if(random.nextInt(10) == 0) {

//do something

} else if(random.nextInt(10) == 1) {

 //do something

}

——————————————————————-

One of the WTF questions that I heard a long time ago: “What is the basis of your randomization?”

Stargazer Feisty Upgrade

April 22, 2007

The upgrade was not flawless. X did not work immediately. I need to manually update the ATI fglrx drivers(my Edgy notes came in handy). There was also no sound. After browsing in the forums I found some workaround(replaced some files).

I have not played around with it yet so I don’t know how much of an improvement Feisty is over Edgy.

Dreaming in Code

April 2, 2007

Software Engineering is something of an oxymoron. It’s very difficult to have real engineering before you have physics, and there isn’t anything even close to a physics for software.

-L. Peter Deutsch

I just finished reading Dreaming in Code and I highly recommend it. The book tries to answer the question: Why is software hard? The author followed the Chandler project in his attempt to answer the question. And I guess he succeeded in answering that question. Do not expect a solution though.

The author did not only chronicled the Chandler project but also gave some software engineering history, a little bit of what Python is and some other Computer Science concepts. A lot of software engineering literature(and people) is also quoted which I think is one of the best thing about this book. It gives you an arsenal of quotes(like the one above) when you have arguments with your pointy haired boss(PHB) or those big-M Methodology zealots.

Poetry and Software

March 29, 2007

Gabriel’s enthusiasm for the notion of programming as creative writing is not purely abstract; in the 1990s, he took three years off from his career to get an MFA in creative writing and to write a poem a day. He discovered that we ask more work of students who want to become writers and poets than those who aim to become software developers: They must study with mentors, they must present their work for regular criticism by peers in workshops, and they’re expected to labor over multiple revisions of the same work. “i think we need to be ashamed of this,” Gabriel says. “What we put forward as computer education is a farce.”

Got this paragraph from Scott Rosenberg’s Dreaming in Code. Richard Gabriel(who made the observation above) is a  Distinguished Engineer at Sun Microsystems and advocates Master of Fine Arts in Software.

There has been a lot of activities lately in the mailing lists that I subscribe to. One of the topics is the availability of senior software engineers in the Philippines. They remarked that the Philippines is becoming a country of junior software engineers. Most senior software engineers are abroad(Singapore and US being the favorite) creating a vacuum in the Philippine job market. The good news is it is raising the salaries of senior software engineers.

——————————————

The other topic that was interesting is that today less and less CS skill is being used in programming because majority of the projects today are business applications(web/db). The only fun part is creating tools or learning new frameworks.

——————————————
My friend and I were talking about the state of software engineering in the Philippines and we both agreed that instead of creating more web/database software engineers and compete with China and India, we believe that the Philippines should concentrate on niche market(anything that needs decent amount of R&D like security products). This is the Gundam Theory of Software Engineering. Why create hundreds of cannon fodders when you can create a Gundam that can wipe them all?

——————————————

My friend told me one coding horror that he experienced:

The code:

bean.setProperty(a);

bean.setProperty(b);

bean.setProperty(c);

The question: Why am I only seeing the value of c when I call the getter method of the property?

Another coding horror story from one of my friends:

The code:

for(int i = 0; i <= list.size();i++) {

}

The question: Why is there a NullPointerException?

——————————————

The project is in a bit of a pinch and the manager asked who will be responsible for the quality of the code and of the application. One of our team lead said, “we(he and the other team lead) will be responsible”. For taking responsibility they got my respect.

——————————————

Observation:

If during your first day at work and the manager gave you a wonderful presentation of their software development process(powerpoint with very nice graphics and very detailed diagram) it is usually a bad sign.

Industry experience?

January 24, 2007

 Manager: So how much increase in productivity did the new (expensive)tool gave you?

Developer: Well it helped me cover a lot more test cases…

Manager: I am asking how much productivity in terms of lines of code..

Developer: Hmm.. the advantage is not really the time but the quality. The old tool is like an ordinary gun while the new tool is like a shotgun. The bullet speed is the same but the shotgun did hit more.

Manager: I am asking how much productivity in terms of code.. 50% or 20%? Did I not instruct you to make a study comparing how much time did you spend writing code on the old tool and compare it with the new tool?

Developer:(Not knowing what to say)…

This is a typical manager trap. If you say it improved coding time by this much expect that your development time will decrease and will use your statement to the other developers as well.

If you say it did not improve coding time he will bug you to hell until you say that it did  improve coding time.

—————————————

Rommel blogged about a plan to have a BS Software Engineering in UP and while I am all for it, I am not that comfortable on importance they are giving to industry experience(2 semesters).  The problem is the industry might not be a good teacher of software engineering.

If you are an advertising student it is easy know which companies are the best. Look at the quality of the commercials and ads produced by a company and you would know. Unfortunately it is not the same with software companies. Could you walk in an office of a software company and ask them, “Can I see your code?”.

The size of the the company is also not a good indicator. The bigger a software company is, the more probable that they are still in love with the waterfall model(which we know is bad most of the time).

Another problem is authority. There is no de facto authority in software engineering. Is CMMI good because SEI recommends it? On some cases yes. But does good software companies like Google or Microsoft use it? I doubt it. But most companies like it and thinks that it is a silver bullet.

Industry experience is good if the goal is to see what is outside the academia but expecting the student to learn(software engineering) from the experience is a hit or miss thing.

I was two hours overtime for that Java class. I spent almost four hours trying to unit test that damn code. I could not cover it sufficiently. No amount of data coaxing could reach those deep nested-ifs. Not knowing what to do anymore, I set the testing timeout to more than ten minutes then went down for a snack.

Time can heal all wounds, as the old adage goes. With sufficient time all possible combinations can be exhausted and convergence will be attained. Brute force is also a technique.

July 29, 2006

It was System Administrators Appreciation Day yesterday. Sysads are the people who maintains the network, your emails and get blamed for every computer-related problems in the office/department. It is one of the thankless jobs out there.

—————————————-

For the nth week of studying I was getting bored staying at home. I wish there is a coffee shop nearby. I think I need a change of scenery.

—————————————-

With Core 2 Duo(Conroe) out, Merom(Core 2 Duo for laptops) will shortly be released. And with a new mobile processor on the horizon a slew of new laptop models will be released. Not that I am planning to buy(there is no need yet), I just find it fun looking/browsing at new generations of hardware.