Tuesday, October 24, 2006

C# Trolls vs. Java Trolls. (wikipedia wars)

A month ago when I added the different release names for Java in wikipedia, I saw that there were quite a few troll edits in the page. (Troll edit = people adding/changing wikipedia pages for no good reason) Then I went over to the C# page in wikipedia, and just looked over the history very quickly and it seemed that there were less troll edits on that page. That got me thinking of the "war" between Java and C#; a war that developers loves to fight "What programming language is the best?" Uncanny similar to the youth discussion on whos dad could kick the other dad butt.

Anyhow, this evening I had 30 mins to spare, so I did a very unscientific investigation to see which faction that had entered the most troll comments into the other factions wikipedia page. So I went through all the latest 200 changes for each page. Thanks for Firefox excellent tab support, I could do it quite quickly with Ctrl+Tab and Ctrl+W. What I found was this:


The Java wikipedia page had been troll edited 12 times. Some examples of the changes:
  • "Java Database Connectivity" was changed into "help me groe Connectivity"
  • "IAN Hitchcox is a BIG qeer" - Whatever that means...
  • Changing the name of James Gosling into "Giant Lava" or "Michael Adolf Gow"... Giant Java would be more appropiate, but that Adolf guy is unknown to me.
  • "The entire java language centers around a single concept, IF Loops." - Hmm, I think I have used a switch statement once in java.
  • "Influenced by = ....C sharp C#" - Well, that is not really true is it?
  • "Mr. Youngpradit - A acclamed computer science teacher teaching Java to high school students he also heads the extreme sports club and botball" - A computer science teacher that do extreme sports, that is a little far fetched.
  • Some made an incorrect note that Java's performance is really bad
  • And someone replaced all content on the page with "XXXXXXXXXXXXXXX"

The C# wikipedia page has been troll edited 4 times. Some examples:

  • "A good example of this is the "Chad Rocks" program." - Seems like that Chad managed to write a good program with C#
  • Self advertising as ''This article is being presented by Rakesh.S, Bangalore'', with email adress and all. Thanks, I probably won't contact this troll.
  • "C# is intended to be a '''simple, modern, general-purpose''', object-oriented programming language that does not work." - I don't think that was copied from the MS requirement spec?
  • "The language is very facist and Fleury can't program it for shit!" - Apparently someone was tired of both Fleury and C#.

So what does this mean? I have no clue, but it seems that the C# Trolls won this round as they did manage to get in twice the number of troll edits into the Java page.

Java Trolls - C# Trolls
0 - 1

Yes, I was bored and no Im not serious, but the investigation was...

Friday, October 20, 2006

Open source is not your enemy

The last weeks, I've seen an emerge of Open Source (OS) critical blogs. Those blogs most of the times talk how OS either provides no business opportunity, low quality products, steals our jobs, are expensive, is for communists only or the participators are thiefs.

I don't get it. Why is open source so terrifying? Why is it so hard to understand that some people wants to collaborate on mutual project? Isn't it more fun to do stuff together than doing them yourself?

Communism?
Most OS projects are developed together with other people, every one has a say. To me that sounds a lot more like Democracy, and definetly not communism. Has nothing changes since the McCarthy era?

Expensive?
Sure, OSS don't have a support hot line which you can call, and it takes time to get used to ask your peers for help through mailing lists, or finding the information youself. But then, companies that charge for their commercial product can have bad support as well. How does it feel when you paid for it and don't get any help at all?

Stealing because they are incompetent?
Well, that was one of the stupidiest comments I've read in a while. Is it a problem if someone else is using your code? Is it a problem that you are no longer the only expert of your code? There is a huge amount of projects that produce tools that I can't imagine how to code. If someone is an expert on something else, why not utilise them; instead of doing it yourself? OSS is the opposite of the "Not invented here" idea.

No business opportunities?
I'm sorry, but isn't MySQL, RedHat, JBoss successful companies? Don't they make money?

Steals our jobs?
Open Source Software (OSS) is not going to make all developers unemployed. You need to see it from the other side, OSS helps us produce better quality products. We no longer need to implement a LinkedList, a String class or a web server every time a new project is started. Building on top of OSS will get us to the goal quickier. Then if I make an adjustment to an OSS, I give something back to the community. I'm tired of re-inventing the wheel every day. But sure, if I'm a crappy developer, then I should be worried.

Thursday, October 12, 2006

.NET lacks action; can't keep up with Swing

Microsoft has really not understood the concept behind the GUI design pattern Model View Control (MVC). As I understand .NET can not connect GUI controls to functionality (logic) objects (that would be linking View to Control). I've asked this question on common .NET sites, usenet groups and it seems that they missed out on this part totally. To me, it shows that the .NET Forms project was really rushed and misses major parts that Swing has had for 8 years.

What I am talking about, is that Java Swing has Action classes that can be linked to GUI controls, which means that the GUI control uses the Action object when it has been activated (clicked for buttons, menu items, combo boxes, lists and even tree controls) . This Action class contains only the logic (Control) and nothing else; when activated from a GUI control it will perform it's functionality. The drawback with this approach that every major action needs their own class, which generate many more classes. But the benefit is that you can have several buttons/menu items, that uses ONE class to do a certain functionality. It helps during maintenance, where I am right now. This is nice, when a certain Action is disabled (for instance Save is disabled when the user doesn't have an active document); because it will notify ALL controls that is connected to the Action object. So the developer does not have to care which dialogs/forms/menu that are visible and must be disabled, etc. It is just one simple method call, and that is the beauty of it.

Another nice thing with it, is that the Action class contains most of the important properties for a control:
* A name (for buttons) (can be localised)
* A short description (read tool tip) (can be localised)
* A key accelerator, for short cut keys
* An icon (next to the text in buttons and menu items)
* An mnemonic key

So when I need to create a button and menu item, all I do is:
anAction = new FileSaveAction();
JButton button = new JButton(anAction);

mainFramePanel.add(button);
JMenuItem menu = new JMenuItem(anAction);
mainFrame.getJMenuBar().getMenu(0).add(anAction);
anAction.setEnabled(false);
//.. user opens a new document
anAction.setEnabled(true);

The above code will create a button in the main frame panel, and a menu item. They will have the same text, the same icon, the same tool tip AND both are disabled at the same time. When the user opens a new document it is just one method call to enable both controls. Magic, isn't it? Or is it just properly designed?

At my current project, which is a huge .NET project, they have many menu items and buttons that each of them needs to be enabled/disabled when some functionality is disabled. That generates alot of excess code that isn't needed and is hell to maintain. Since the application is localised in 5 different languages, the developer needs to code enable/disable functionality for least 2 GUI controls. And this means that each control needs 5 different localisations which needs to be set. Talk about unnecessary and unwanted work.

Sunday, October 08, 2006

MVP Paul Yao can't code (or is .NET too hard?)

For more than a year ago, I visited the head quarter of my previous company's in Everett, Washington, USA to meet up with some colleagues and our new boss. One evening there was a WE.DIG (User group for MS, .NET) meeting and me and my friend wanted to participate. So we signed up on a website for that meeting, went to it and enjoyed the free pizza. This user group is run by Mr Paul Yao, a well known MS book writer and MVP.

Apparently the sign up included adding us to the mailing list from hell. For more than a year, I've tried to unsubscribe from the newsletter for WE-DIG. As I live in Sweden, I'm no longer interested in events in Seattle. So every month when I get a newsletter, I click on the "Unsubscribe" link; get a nice "You were unsubscribed from the list", and every next month I get a new newsletter. This grows old on me quite quickly. I've multipled times unsubscribed from it, emailed Paul Yao and the board for WE-DIG to be removed from the list. But no such luck.

So my conclusion to this is, either Paul Yao is an evil person that never implemented an unsubscibe functionality; or he can not code diddly squat. I mean how hard is it to implement a mailing list functionality, there must be tons of reference implementations out there? Or is it just to hard to implement a mailing list in .NET? Is it .NET that throws an unhandled exception when someone tries to unsubscribe?

For you how don't know who Paul Yao is, he has been writing books about MS tech for more than 20 years, so he should know what he is doing. Or perhaps he doesnt..... And this is my last attempt to be removed from the mailing list.

Thursday, October 05, 2006

Spell checking localisation files??

Is there any tool that spell checks localisation files? In a current .NET project, which is translated to 4 different languages, there are too many spelling errors that should have been caught before release. (Some of them are really obvious)

So I wonder if there exists such a tool for .NET or Java? If so, does it support Ant/Nant? (Preferably open-source or free)