2008-07-25

Slap your Java code hard with Maven and PMD

How good you think your code is? How can you be sure it's optimal, bug and bullet proof? Unit Tests? In case the coverage is good, they will tell if your code works, but will it tell if and where your code sucks in general? Let's get down to business.

As Maven is used de facto for Java builds, I assume you're using it. You may have heard of PMD, but have you tried it? If you have, did you know that it has a nice Maven Plugin? A quick way to integrate it:

Add the following to your pom.xml. Sadly, default check rulesets are too friendly, so you may want to try my configuration (even the "too hardcore" block):







org.apache.maven.plugins
maven-jxr-plugin


org.apache.maven.plugins
maven-pmd-plugin


rulesets/basic.xml
rulesets/braces.xml
rulesets/clone.xml
rulesets/codesize.xml
rulesets/coupling.xml
rulesets/favorites.xml
rulesets/finalizers.xml
rulesets/imports.xml
rulesets/junit.xml
rulesets/migrating_to_15.xml
rulesets/optimizations.xml
rulesets/typeresolution.xml
rulesets/unusedcode.xml
rulesets/strings.xml


true
true
utf-8
5
20
1.5








To generate a report, simply run:

mvn pmd:pmd

You may want to build Java cross reference for links to source code to work:

mvn jxr:jxr

Finally, open the report and see how naughty the code is:

target/site/pmd.html

Watch out for Cyclomatic Complexity!

2008-07-18

Best of Jargon File

My favorite definitions from Jargon File (AKA, The New Hacker's Dictionary).


brute force and ignorance
: n.

A popular design technique at many software houses — brute force coding unrelieved by any knowledge of how problems have been previously solved in elegant ways. Dogmatic adherence to design methodologies tends to encourage this sort of thing. Characteristic of early larval stage programming; unfortunately, many never outgrow it. Often abbreviated BFI: “Gak, they used a bubble sort! That's strictly from BFI.” Compare bogosity. A very similar usage is said to be mainstream in Great Britain.


BOFH: //, n.

[common] Acronym, Bastard Operator From Hell. A system administrator with absolutely no tolerance for lusers. “You say you need more filespace? Seems to me you have plenty left...” Many BOFHs (and others who would be BOFHs if they could get away with it) hang out in the newsgroup alt.sysadmin.recovery, although there has also been created a top-level newsgroup hierarchy (bofh.*) of their own.

Several people have written stories about BOFHs. The set usually considered canonical is by Simon Travaglia and may be found at the Bastard Home Page. BOFHs and BOFH wannabes hang out on scary devil monastery and wield LARTs.


buried treasure: n.

A surprising piece of code found in some program. While usually not wrong, it tends to vary from crufty to bletcherous, and has lain undiscovered only because it was functionally correct, however horrible it is. Used sarcastically, because what is found is anything but treasure. Buried treasure almost always needs to be dug up and removed. “I just found that the scheduler sorts its queue using bubble sort! Buried treasure!


code police: n.

[by analogy with George Orwell's ‘thought police’] A mythical team of Gestapo-like storm troopers that might burst into one's office and arrest one for violating programming style rules. May be used either seriously, to underline a claim that a particular style violation is dangerous, or ironically, to suggest that the practice under discussion is condemned mainly by anal-retentive weenies. “Dike out that goto or the code police will get you!” The ironic usage is perhaps more common.


cow orker: n.

[Usenet] n. fortuitous typo for co-worker, widely used in Usenet, with perhaps a hint that orking cows is illegal. This term was popularized by Scott Adams (the creator of Dilbert) but already appears in the January 1996 version of the scary devil monastery FAQ, and has been traced back to a 1989 sig block. Compare hing, grilf, filk, newsfroup.


To look for something in a mass of code or data with one's own native optical sensors, as opposed to using some sort of pattern matching software like grep or any other automated search tool. Also called a vgrep; compare vdiff.


gang bang: n.

The use of large numbers of loosely coupled programmers in an attempt to wedge a great many features into a product in a short time. Though there have been memorable gang bangs (e.g., that over-the-weekend assembler port mentioned in Steven Levy's Hackers), and large numbers of loosely-coupled programmers operating in bazaar mode can do very useful work when they're not on a deadline, most are perpetrated by large companies trying to meet unrealistic deadlines; the inevitable result is enormous buggy masses of code entirely lacking in orthogonality. When market-driven managers make a list of all the features the competition has and assign one programmer to implement each, the probability of maintaining a coherent (or even functional) design goes to epsilon. See also firefighting, Mongolian Hordes technique, Conway's Law.


Guido: /gwee´do/, /khwee´do/

Without qualification, Guido van Rossum (author of Python). Note that Guido answers to English /gwee´do/ but in Dutch it's /khwee´do/. Mythically, Guido's most important attribute besides Python itself is Guido's time machine, a device he is reputed to possess because of the unnerving frequency with which user requests for new features have been met with the response “I just implemented that last night...”. See BDFL.


guiltware: /gilt´weir/, n.

1. A piece of freeware decorated with a message telling one how long and hard the author worked on it and intimating that one is a no-good freeloader if one does not immediately send the poor suffering martyr gobs of money.

2. A piece of shareware that works.


hired gun: n.

A contract programmer, as opposed to a full-time staff member. All the connotations of this term suggested by innumerable spaghetti Westerns are intentional.


hyperspace: /hi:´per·spays/, n.

A memory location that is far away from where the program counter should be pointing, especially a place that is inaccessible because it is not even mapped in by the virtual-memory system. “Another core dump — looks like the program jumped off to hyperspace somehow.” (Compare jump off into never-never land.) This usage is from the SF notion of a spaceship jumping into hyperspace, that is, taking a shortcut through higher-dimensional space — in other words, bypassing this universe. The variant east hyperspace is recorded among CMU and Bliss hackers.


I didn't change anything!: interj.

An aggrieved cry often heard as bugs manifest during a regression test. The canonical reply to this assertion is “Then it works just the same as it did before, doesn't it?” See also one-line fix. This is also heard from applications programmers trying to blame an obvious applications problem on an unrelated systems software change, for example a divide-by-0 fault after terminals were added to a network. Usually, their statement is found to be false. Upon close questioning, they will admit some major restructuring of the program that shouldn't have broken anything, in their opinion, but which actually hosed the code completely.

A contract programmer, as opposed to a full-time staff member. All the connotations of this term suggested by innumerable spaghetti Westerns are intentional.


KIBO: /ki:´boh/<

1. [acronym] Knowledge In, Bullshit Out. A summary of what happens whenever valid data is passed through an organization (or person) that deliberately or accidentally disregards or ignores its significance. Consider, for example, what an advertising campaign can do with a product's actual specifications. Compare GIGO; see also SNAFU principle.


Macintrash: /mak´in·trash`/, n.

The Apple Macintosh, as described by a hacker who doesn't appreciate being kept away from the real computer by the interface. The term maggotbox has been reported in regular use in the Research Triangle area of North Carolina. Compare Macintoy. See also beige toaster, WIMP environment, point-and-drool interface, drool-proof paper, user-friendly.


meatspace: /meet´spays/, n.

The physical world, where the meat lives — as opposed to cyberspace. Hackers are actually more willing to use this term than ‘cyberspace’, because it's not speculative — we already have a running meatspace implementation (the universe). Compare RL.


Mongolian Hordes technique: n.

[poss. from the Sixties counterculture expression Mongolian clusterfuck for a public orgy] Development by gang bang. Implies that large numbers of inexperienced programmers are being put on a job better performed by a few skilled ones (but see bazaar). Also called Chinese Army technique; see also Brooks's Law.


nipple mouse: n.

Var. clit mouse, clitoris Common term for the pointing device used on IBM ThinkPads and a few other laptop computers. The device, which sits between the ‘g’ and ‘h’ keys on the keyboard, indeed resembles a rubber nipple intended to be tweaked by a forefinger. Many hackers consider these superior to the glide pads found on most laptops, which are harder to control precisely.


optimism: n.

What a programmer is full of after fixing the last bug and before discovering the next last bug. Fred Brooks's book The Mythical Man-Month (See Brooks's Law) contains the following paragraph that describes this extremely well:

All programmers are optimists. Perhaps this modern sorcery especially attracts those who believe in happy endings and fairy godmothers. Perhaps the hundreds of nitty frustrations drive away all but those who habitually focus on the end goal. Perhaps it is merely that computers are young, programmers are younger, and the young are always optimists. But however the selection process works, the result is indisputable: “This time it will surely run,” or “I just found the last bug.”.

See also Lubarsky's Law of Cybernetic Entomology.


pseudosuit: /soo´doh·s[y]oot`/, n.

A suit wannabee; a hacker who has decided that he wants to be in management or administration and begins wearing ties, sport coats, and (shudder!) suits voluntarily. It's his funeral. See also lobotomy.


RTFS: /R·T·F·S/

[Unix] 1. imp. Abbreviation for ‘Read The Fucking Source’. Variant form of RTFM, used when the problem at hand is not necessarily obvious and not answerable from the manuals — or the manuals are not yet written and maybe never will be. For even trickier situations, see RTFB. Unlike RTFM, the anger inherent in RTFS is not usually directed at the person asking the question, but rather at the people who failed to provide adequate documentation.


Saturday-night special: n.

[from police slang for a cheap handgun] A quick-and-dirty program or feature kluged together during off hours, under a deadline, and in response to pressure from a salescritter. Such hacks are dangerously unreliable, but all too often sneak into a production release after insufficient review.


shotgun debugging: n.

The software equivalent of Easter egging; the making of relatively undirected changes to software in the hope that a bug will be perturbed out of existence. This almost never works, and usually introduces more bugs.


space-cadet keyboard: n.

Long one, but a must-see: http://www.catb.org/~esr/jargon/html/S/space-cadet-keyboard.html

Spinning Pizza of Death: n.

[OS X; common] The quartered-circle busy indicator on Mac OS X versions before 10.2, after which it was replaced by a sort of rainbow pinwheel thingy. It was analogous to the Microsoft Windows hourglass, but OS X 10.0's legendary slowness under the Aqua toolkit made this term rather more evocative. See Death, X of.


stealth manager: n.

[Corporate DP] A manager that appears out of nowhere, promises undeliverable software to unknown end users, and vanishes before the programming staff realizes what has happened. See smoke and mirrors.


STFW: imp., /S·T·F·W/

[Usenet] Common abbreviation for “Search The Fucking Web”, a suggestion that what you're asking for is a query better handled by a search engine than a human being. Usage is common and exactly parallel to both senses of RTFM. A politer equivalent is GIYF.


suit: n.

1. Ugly and uncomfortable ‘business clothing’ often worn by non-hackers. Invariably worn with a ‘tie’, a strangulation device that partially cuts off the blood supply to the brain. It is thought that this explains much about the behavior of suit-wearers. Compare droid.

2. A person who habitually wears suits, as distinct from a techie or hacker. See pointy-haired, burble, management, Stupids, SNAFU principle, PHB, and brain-damaged.


sysape: /sys´ayp/, n.

A rather derogatory term for a computer operator; a play on sysop common at sites that use the banana hierarchy of problem complexity (see one-banana problem).


top-post: n., v.

[common] To put the newly-added portion of an email or Usenet response before the quoted part, as opposed to the more logical sequence of quoted portion first with original following. The problem with this practice is neatly summed up by the following FAQ entry:

A: No.
Q: Should I include quotations after my reply?

This term is generally used pejoratively with the implication that the offending person is a newbie, a Microsoft addict (Microsoft mail tools produce a similar format by default), or simply a common-and-garden-variety idiot.


voodoo programming: n.

[from George Bush Sr.'s “voodoo economics”] 1. The use by guess or cookbook of an obscure or hairy system, feature, or algorithm that one does not truly understand. The implication is that the technique may not work, and if it doesn't, one will never know why. Almost synonymous with black magic, except that black magic typically isn't documented and nobody understands it. Compare magic, deep magic, heavy wizardry, rain dance, cargo cult programming, wave a dead chicken, SCSI voodoo.

2. Things programmers do that they know shouldn't work but they try anyway, and which sometimes actually work, such as recompiling everything.


Wintendo: /win·ten´doh/, n.

[Play on “Nintendo”] A PC running the Windows operating system kept primarily for the purpose of viewing multimedia and playing games. The implication is that the speaker uses a Linux or *BSD box for everything else.


zipperhead: n.

[IBM] A person with a closed mind.

2008-07-16

What is Eclipse Mylyn anyway?

Since the release of Eclipse Europa, there was one new big feature - Mylyn. I was sceptic about it, besides it made the IDE slower, so I've kept removing it without getting to know what the hell is Mylyn anyway? After seeing this video I'm about to give it another try. If you're using Eclipse without Mylyn, you must see the video below:



Update
Mylin still sucks big time. Could not get used to it. It's most probably for people with ADD. Read the discussion in comments.

2008-07-10

Oracle Exception Handling - Stack Trace


Oracle PL/SQL is definitely the worst programming language I've ever encountered. Some time ago I thought that PHP was the worst, but well, things change.

I've been searching for the source of a weird CLOB related bug in a big pile of PL/SQL sh.. mess for a couple of days till I got fed up and decided to find a way to get the stack trace or at least the last line of code where the error was triggered from. Would you believe that before Oracle 10g there was no normal way to get the trace? Here's some Daily WTF material from the official PL/SQL User's Guide and Reference.

----- WTF EXCERPT START -----

Using Locator Variables to Identify Exception Locations

Using one exception handler for a sequence of statements can mask the statement that caused an error:

BEGIN
SELECT ...
SELECT ...
EXCEPTION
WHEN NO_DATA_FOUND THEN ...
-- Which SELECT statement caused the error?
END;
Normally, this is not a problem. But, if the need arises, you can use a locator variable to track statement execution, as follows:
DECLARE
stmt INTEGER := 1; -- designates 1st SELECT statement
BEGIN
SELECT ...
stmt := 2; -- designates 2nd SELECT statement
SELECT ...
EXCEPTION
WHEN NO_DATA_FOUND THEN
INSERT INTO errors VALUES ('Error in statement ' || stmt);
END;
----- WTF EXCERPT END -----

Yes, they even have a name for this. Locator Variables. Damn. I can't decide whether to laugh or to cry...

On a good note, since Oracle 10g you can use DBMS_UTILITY.FORMAT_ERROR_BACKTRACE function to get a string representation of stack trace with procedure names and code line numbers. They still forgot to add this into the "Handling PL/SQL Errors" section of their manual...

So, here's how you get the stack trace:
declare
x number;
begin
x := 1 / 0;
dbms_output.put_line(x);
exception
when others then
dbms_output.put_line(SQLERRM);
dbms_output.put_line(dbms_utility.format_error_backtrace);
end;
Output:
ORA-01476: divisor is equal to zero
ORA-06512: at line 5

And it took them only 10 versions to implement.

2008-07-09

EuroPython 2008 - Day 3



The third and final day of EuroPython 2008 started with a little bit of rocket science by Michael Meinel from German Aerospace Center. He talked about FlowSimulator, which is a Python-controlled framework to unify massive parallel CFD workflows. Interesting point was that they used SWIG to allow Python to control code written in C/C++, so basically Python was a glue code.



Second talk I attended was called "Small team, big demands? - Use the batteries included" by Jussi Rasinmäki. It was a tale of a software project which started with C, failed miserably and finally ended with Python. The outcome was twice as fast as C code with tenfold smaller code base. C can be slow if your code is really really bad.



I went there for the "Batteries Included" line, which really was as simple as this:



There was one thing that I believe you should avoid in your code, and hell, in public presentations too. I mean a function named Age_pine_hemib_h_KalliovirtaTokola. Seriously, WTF?



Next, Raymond D. Hettinger gave a good talk on "Core Python Containers - Under The Hood". Well, before that he managed to amuse the audience with the usual behavior of Windows in his laptop. Why the hell anyone would use Windows here anyway?



However, Raymond revealed some useful Python internals and told us how to make optimal use of the collections.



Here's the moral of his story:



Last talk I've attended in this year's EuroPython was called "Functional Programming with Python, or Why It's Good To Be Lazy?" by Adam Byrtek. It was a great talk that covered the concept of functional programming, which went down to Pythonic functional programming features - map/filter/reduce and lambda functions.



Sadly I had some errands to run, so I couldn't make it to the Lightning Talks...



Hopefully I'll see you all in EuroPython 2009, which is going to be held in Birmingham UK.

2008-07-08

EuroPython 2008 - Day 2


I took way too much coffee during breaks on Day 1, that kept me awake till 3AM, so it was a tough day. Nevertheless, today was better than Day 1. Let's see where I've been.

Designing Large-Scale Applications in Python by Marc-André Lemburg basically was a beginner oriented tutorial on how to do enterprisey stuff properly. It got more serious later on when he started mentioning concrete patterns and techniques. It's good that this conference has a (so so, but still) working WI-FI that kept me entertained till the next session. It's good to chew on some RSS feeds in the morning.



Then Steve Alexander from Canonical gave an inspiring talk on how they developed a very large python web application LEAN style. Launchpad to be exact. One of the greatest points was the use of pre-commit continuous integration, which ensures the developers that trunk is never broken. Also, he mentioned that canonical is hiring ~20 python developers (see their ad in my post about EuroPython 2008 Day 1).



Cool stuff with Jython by Frank Wierzbicki (from Sun) and Jim Baker was somehow boring and Jim's words "we write Java so you don't have to broke my heart, so I got back to reading RSS feeds". Frank was bragging about new hot NetBeans refactoring, which Eclipse has since.. uh.. forever? Read more on this topic in this great post. Dear pythonists, throw away your NetBeans CDs and visit eclipse.org instead.



There were a few Lightning Talks worth noticing.



Here's the full list.



I liked Jure Vrščaj's talk on Remote Module Importing where he showed us how to implement custom Python path resolvers that can seek modules from internet or source control repositories.



Mikhail Kashkin introduced a better style of Python programming - The Drunken Monkey style. Thumbs up for this one. :)



It was amazing to see how Holger Krekel unit-tested JavaScript with pytest.



Geoffrey French deserves a medal for his very alpha code editor gSym Prototype, which visualizes Python code with as AST and adds a Lisp View (with lots and lots of braces that all pythonists just love).



Here's a screenshot of gSym visualizing some mathematical functions.



Finally, a charismatic professor from Sweden, Hans Rosling, made a totally mind blowing keynote called "Code that make sense of the world". It can be basically rephrased as "Instead of letting people generate images from raw statistics in their head we should generate images in front of their heads".



It was one of the best talks I've seen in my life. This 60 year old professor knows people like Larry Page and Bill Gates, he knew Fidel Castro he's also good at GTA 2. Possibly this has something to do with Fidel Castro :).

Some more pictures from his talk...







Here's a great point on how data should be represented to the public.



And the following symptom that technical people tend to have made the audience laugh and applaud.



Most of what he presented can be seen in the following video. You HAVE to see it.



One day to go. See you tomorrow!

2008-07-07

EuroPython 2008 - Day 1

It's the end of first day of EuroPython 2008, a good time to overlook what I've seen.





Right after the keynote, which was short and uplifting, I've headed to the first session - Dynamic Compilation in Python and Jython by Tobias Ivarsson and Jim Baker. It was long and boring, but still inspiring. They looked into things like bytecode versus AST manipulation, introduced nice tools like pyassem. It's nice to see that Java and JVM is a hot topic in smart programmer communities. I consider Python community as one of the smartest people in software development.



Then I went to listen to my native speaker Ignas Mikalajūnas from Programmers of Vilnius. He told Why he Wants Us to Use Eggs. I would disagree with saying "Eggs are to Pythons as Jars are to Java...". It's more like "Eggs may some day be to Pythons as Maven is for Java". For now Eggs look scary and unstable especially with things like Known Good Set (compare it to Maven Repository). Though I would definitely want to use it for Python projects. Better than nothing.





Then I made a mistake by visiting John Pinner's "Python at Home" talk. He was going to tell how he automated his boiler at home with use of Python. I expected a lot from that, instead I've seen some photos of a boiler wired to a motherboard and some source code like "boiler.ignition(On)" and "boiler.ignition(Off)". I would recommend John (and all the other speakers) not to dig deep into source code but concentrate on big picture instead.



I didn't want to go to vendor pitch sessions or things that does not sound interesting (Advanced Searching for Plone and stuff), so my choice was the Barcamp / Open Space, where Tommi Virtanen was giving a talk on Twisted. If you want messaging in Python, do it in Twisted. The guy gave a great quote of Torvalds Linus, which sounded something like "If you have to use debugging - you already have problems. Take a step back and review what could be wrong". It definitely was a great session.



I was going to visit "Discouraging the Use of Python" next, but I was tired and didn't want to be discouraged, so I've headed home to write all this down.

Most of attendees I've spoken to admit that last year's EuroPython was way better than this. But well, two more days to go.

Now for some fun moments:
Canonical was hiring Django developers and senior engineers.



Until the epic failure of their campaign:



All pythonistas got a copy of NetBeans 6.1 and Open Solaris (go Sun! :)) along with geeky looking Bazaar T-Shirt.



And of course, loads of free coffee, snacks and socializing!






See You there at Day 2!

Update

Yesterday I forgot to mention that Guido Van Rossum did not participate in the conference like the last year. I did not participate in his video keynote either...

2008-07-02

CMS battle: Drupal vs Joomla vs Custom Programming

In modern Content Management System (CMS) world there are two major figures - Joomla (descendant of Mambo CMS ) and Drupal. They both are open source and have large comunities with enormous amounts of extensions and themes. It's hard to choose which one to use without trying them out. As usually, there are more options - home grown custom programming or even building your own CMS (which I was once stupid enough to do). Programming from scratch is always fun and beneficial for your skills, however, if you need things up and running in no time or you don't do (or don't want to do) any programming, using a CMS is the way to go.

If you are digging for CMS comparisons and trying to decide which one is best for you, here is a quick and dirty answer - go for Drupal, you won't regret it.

Why?

After test-driving them both I've came to these conclusions:

  • Joomla is bloated, Drupal is minimal
  • Drupal is easy to use and intuitive, Joomla is confusing

That was more than enough for a minimalist like me.

Here are some statistics from CMS Matrix for a more detailed comparison. It shows that Drupal is extremely modular and Joomla has a heavy core, thus a terrible architecture. That means Joomla is hard to extend and messy under the hood. Drupal, on the other hand, looks beautiful.


Product Drupal 6.2 Joomla! 1.5.3
Last Updated 4/10/2008 5/31/2008
System Requirements Drupal Joomla!
Application Server PHP 4.3.5+
Approximate Cost Free Free
Database MySQL, Postgres MySQL
License GNU GPL GNU/GPL v2
Operating System Any Any
Programming Language PHP PHP
Root Access No No
Shell Access No No
Web Server Apache, IIS Apache
Security Drupal Joomla!
Audit Trail Yes No
Captcha Free Add On Free Add On
Content Approval Yes Yes
Yes Yes
Granular Privileges Yes No
Kerberos Authentication No No
LDAP Authentication Free Add On Yes
Yes Yes
NIS Authentication No No
NTLM Authentication Free Add On No
Pluggable Authentication Yes Yes
Problem Notification No No
Sandbox No No
Session Management Yes Yes
SMB Authentication No No
SSL Compatible Yes Yes
SSL Logins No Yes
SSL Pages No Yes
Versioning Yes No
Support Drupal Joomla!
Certification Program No No
Code Skeletons Yes No
Commercial Manuals Yes Yes
Commercial Support Yes Yes
Commercial Training Yes Yes
Developer Community Yes Yes
Online Help Yes Yes
Pluggable API Yes Yes
Professional Hosting Yes Yes
Professional Services Yes Yes
Public Forum Yes Yes
Public Mailing List Yes No
Test Framework Free Add On Yes
Third-Party Developers Yes Yes
Users Conference Yes Yes
Ease of Use Drupal Joomla!
Drag-N-Drop Content Free Add On No
Free Add On Free Add On
Friendly URLs Yes Yes
Image Resizing Free Add On Yes
Macro Language Free Add On Yes
Mass Upload Free Add On No
Prototyping Limited Yes
Server Page Language Yes Yes
Site Setup Wizard Limited No
Spell Checker Free Add On No
Style Wizard Limited No
Subscriptions Free Add On No
Template Language Limited Yes
UI Levels No Yes
Undo Limited No
WYSIWYG Editor Free Add On Yes
Zip Archives No No
Performance Drupal Joomla!
Advanced Caching Yes Yes
Database Replication Limited No
Load Balancing Yes Yes
Page Caching Yes Yes
Static Content Export No No
Management Drupal Joomla!
Advertising Management Free Add On Yes
Asset Management Yes Yes
Clipboard No No
Content Scheduling Free Add On Yes
Content Staging Free Add On No
Inline Administration Yes Yes
Online Administration Yes Yes
Package Deployment No No
Sub-sites / Roots Yes Yes
Themes / Skins Yes Yes
Trash No Yes
Web Statistics Yes Yes
Web-based Style/Template Management Yes Yes
Web-based Translation Management Yes Free Add On
Workflow Engine Limited No
Interoperability Drupal Joomla!
Content Syndication (RSS) Yes Yes
FTP Support Limited Yes
iCal Free Add On No
UTF-8 Support Yes Yes
WAI Compliant Limited No
WebDAV Support No No
XHTML Compliant Yes No
Flexibility Drupal Joomla!
CGI-mode Support Yes Yes
Content Reuse Limited Yes
Extensible User Profiles Yes Yes
Interface Localization Yes Yes
Yes Yes
Multi-lingual Content Yes Free Add On
Multi-lingual Content Integration Free Add On Free Add On
Multi-Site Deployment Yes Free Add On
URL Rewriting Yes Yes
Built-in Applications Drupal Joomla!
Blog Yes Yes
Chat Free Add On Free Add On
Classifieds Free Add On Free Add On
Contact Management Free Add On Yes
Data Entry Free Add On Free Add On
Database Reports No Free Add On
Discussion / Forum Yes Free Add On
Document Management Limited Free Add On
Events Calendar Free Add On Free Add On
Events Management Free Add On Free Add On
Expense Reports No Free Add On
FAQ Management Yes Yes
File Distribution Free Add On Free Add On
Graphs and Charts No Free Add On
Groupware Free Add On Free Add On
Guest Book Free Add On Free Add On
Help Desk / Bug Reporting Free Add On Free Add On
HTTP Proxy No No
In/Out Board No No
Job Postings Free Add On Free Add On
Free Add On Yes
Mail Form Free Add On Yes
Matrix No No
My Page / Dashboard Free Add On No
Free Add On Free Add On
Free Add On Free Add On
Polls Yes Yes
Product Management Free Add On Yes
Project Tracking Free Add On Free Add On
Search Engine Yes Yes
Site Map Free Add On Free Add On
Stock Quotes Free Add On No
Surveys Free Add On Free Add On
Syndicated Content (RSS) Yes Yes
Tests / Quizzes Free Add On Free Add On
Time Tracking Free Add On No
User Contributions Yes Yes
Weather Free Add On No
Web Services Front End Limited Yes
Wiki Free Add On Free Add On
Commerce Drupal Joomla!
Affiliate Tracking Free Add On Free Add On
Inventory Management Free Add On Free Add On
Pluggable Payments Free Add On Free Add On
Pluggable Shipping Free Add On Free Add On
Pluggable Tax Free Add On Free Add On
Point of Sale No Free Add On
Shopping Cart Free Add On Free Add On
Subscriptions Free Add On Free Add On
Wish Lists Free Add On Free Add On

Hope this helps to make a choice.