Archive for March, 2004

Russell Beattie slams Java, pushes PHP for web development

Wednesday, March 31st, 2004

Russell Beattie talks up web development in Java and PHP. I know he’s tried Cocoon, so it’s funny seeing him talk about URL abstraction and all sorts of other stuff that Cocoon already has.

He also points out flaws in Java’s APIs:

Ever used the Calendar API? It’s written by a monkey. Ever check out the code under the JSTL? Those guys have to be on crack.

But then he also admits PHP code he’s seen is crappy as well:

I loaded up my first PHP application the other day (dotProject) on a test server and dived into the code, you know what? There’s no secret! The code was ugly and embedded and duplicated and horrible. But it was done, and being maintained and being documented and basic enough so that everyone could understand it.

The last time I checked, the Java API code worked just fine, so with respect to “working”, Java and PHP both work just fine. The problem I have with his argument is that when PHP is concerned, crappy code is acceptable, but if it’s Java, forget it brother, you’re crazy! I can write bad working PHP code and be OK, but if I write bad working Java code, there’s something wrong with that? He’s the crazy one!

Any language can be hard to read. I’ve seen some really really bad PHP code that is impossible to maintain. I’ve seen bad Java code, too. Anybody can overarchitect a program. The fact that Java is more OO than PHP would tend to have people going Object Crazy. Perl’s syntax that allows special magic variables would tend to have people going Magic Variable Crazy, causing more unreadable code. PHP’s syntax which allows code embdedded inside markup lends itself to people who write pages that require a templating system to retain any sort of maintainability.

Code that just works, but is impossible to maintain is the first code to get replaced when someone new comes in. The syntax of Perl also lends itself to using obscure magic shortcuts.

People brawl over which language is the best fit for a job, but I think the argument is worthless, and it’s as timeless as Emacs vs. vi. Use what works best to solve your problem. If it’s Java, use it. If it’s PHP, use it. If it’s Perl, use it, but please be careful ;)

That COMDEX panel was bogus, too. Having Rasmus, who freakin’ invented PHP, attacking Java, while having some random guy (who didn’t invent Java) try to defend it is like shooting fish in a barrel. Completely unfair, but oh well, what are you going to do?

Ethics of the Responsible Open-Source Developer

Tuesday, March 23rd, 2004

I am currently working on writing a program to decode METAR reports. Being curious to see how other people did it, I did a little bit of research. I ran across Jeremy Zawodny’s Geo::Metar Perl module, and even some crazy-ass Scheme code from the Navy.

I was going to tear apart Jeremy’s code, but then I noticed that it was licensed under GPL. Unfortunately, I didn’t realize this until I had looked a second time at his site, and he did have a link saying that the code is GPL. I didn’t realize this because I had found the link to the source before the link to his site, and I had already started to look at code.

Then it dawned on me, the GPL requires a person to include a copy of the license with the software (Taken from the GPL FAQ) :

Why does the GPL require including a copy of the GPL with every copy of the program?

Including a copy of the license with the work is vital so that everyone who gets a copy of the program can know what his rights are.

It might be tempting to include a URL that refers to the license, instead of the license itself. But you cannot be sure that the URL will still be valid, five years or ten years from now. Twenty years from now, URLs as we know them today may no longer exist.

The only way to make sure that people who have copies of the program will continue to be able to see the license, despite all the changes that will happen in the network, is to include a copy of the license in the program.

I sent Jeremy a gentle reminder telling him he needs to include a copy of the license with his software. It’s the responsibility of the open-source developer to fully understand the license they choose to distribute their software under. Not doing so not only causes problems (such as in my case, since I want to release my code under the Apache license), but also weakens the notion and nature of open-source code. If a developer doesn’t realize the code he’s looking at is licensed a certain way (or not), it can cause problems later on… not only legally, but ethically as well.

Budding Entrepreneurship

Monday, March 15th, 2004

I know this is generally a Java.blog, but this right here is a great little blog article about starting a business for the budding entrepreneur.

Beware the Ides of March

Monday, March 15th, 2004

3 years ago to the day, I quit my old stressful crappy job at the ad agency and decided to come back to school, forever altering the course of my life.

Party!!!

Tim Bray gets a job at Sun, why can’t I?

Monday, March 15th, 2004

A while back I applied for an internship at the Minneapolis office of Sun. The requirements were that you were a Computer Science student (check) who is scheduled to graduate December 2004 or later (check). Skills required were Perl (check) and other web development experience (check). I never heard back from them. So sad. Does anybody know anybody that can get me in the door there, or better yet, at a place like Meteorlogix or Digital Cyclone ?

Comments are disabled, so drop me a line to tony[at]apache[dot]org if you know of a good hookup. My only requirements for the job is that it’s in the Minneapolis/St Paul area, and it would interest me. Heh.

Traffic Reports + XML + RSS

Friday, March 12th, 2004

Well, it’s been a great morning so far, and I’ve only been awake for a couple hours. This morning I stumbled across the Traffic Data from the MN Department of Transportation. Real-time traffic level and incident reporting in XML. Jackpot.

This will appear as one or more RSS feeds on openWeather soon.

More openWeather Progress

Monday, March 8th, 2004

Alright, I was just out of town for like 4 days, and I took my laptop with me and pounded out some openWeather code. It’s not a lot, but considering my past output, it’s a ton.

Things working:

Zip code search works. Type in a zipcode, and it will tell you what city it is, and what cities are near it. It’s not perfect, but it seems to be working:

90210 is Beverly Hills, CA.
Cities near Beverly Hills:

Santa Monica, CA
Thousand Oaks, CA
Encino, CA
Malibu, CA
Los Angeles, CA

My next thing to work on it fixing the data in my gigantic database of metar stations. The zipcodes database has decimal latitude/longitude, and the metar database has it all in Degrees/Minutes/Seconds. To top it off, not every metar station has a lat/long listed. I might narrow the database down to CONUS (continental US) for now and then expand later. Besides, I don’t have weather reports from other stations anyway.

Oh yeah, and here’s a sneak peak at the working logo:

Form Hell

Wednesday, March 3rd, 2004

A wise man once said, “Hell hath no fury like a developer scorned for processing forms in PHP.”

I miss the elegance and simplicity of CocoonForms… unfortunately, I can’t have access to Cocoon here at work… oh well… must keep the hope alive…