Updated: 4/29/2003; 9:28:24 AM.
Java Morning/C# Afternoon
Practical living with two modern languages


by Michael Isbell
        

Wednesday, December 18, 2002

More Reasons I'm Sick and Tired of Java GUIs

out of mem errors on complex GUIs
slow frame repaint in JBuilder IDE
buggy pane repaint in JBuilder IDE

Let's face it, the whole idea of "reading the GUI from the code" is a kluge at best. FAR better that the GUIs be precompiled binaries, as in Delphi and Visual Studio.

ToString Klugy in C#

Basically, Microsoft created the ToString method, then left all the work of implementing it to the developers. It's a method you override in ALL cases, rather than in EXCEPTIONAL cases, as with Java.

This is obviously a time-to-market kluge by Microsoft - they chose not to go through the trouble of writing all those "toString" methods, which require a great deal of detailed programming for some of the more complex classes, and just slugged in the class type. If you want any kind of intelligence from the ToString method, God Bless and good luck, and write it your own damn self.

Here's what ToString does in the two different languages:

Java
Hashtable h = new Hashtable();
h.put("key1","value1");
h.put("key2","value2");
h.put("key3","value3");
System.out.println(h.toString());

Produces: {key1=value1,key2=value2,key3=value3} (the key/values in a string)

C#
Hashtable h = new Hashtable();
h.Add("key1","value1");
h.Add("key2","value2");
h.Add("key3","value3");
Console.WriteLine(h.ToString());

Produces: System.Collections.Hashtable (the type as a string)
1:55:18 AM    comment []


© Copyright 2003 Michael Isbell.
 
December 2002
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Nov   Jan


Click here to visit the Radio UserLand website.

Subscribe to "Java Morning/C# Afternoon" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.