Skip to Content »

Tech Life of Recht » archive for July, 2009

 Properties: No Thanks

  • July 31st, 2009
  • 3:03 pm

Via Reddit, I just read an article about how much better C# is than Java. As a language, this might be true, the platform is another thing. However, one of the things many people think is missing from Java is properties, presumably so you don’t have to write those getters and setters all the time.
First of all, I don’t know who actually writes that stuff – all modern IDEs can generate them automatically. Secondly, how do you actually know when to implement something as a property or as something which looks like a setter/getter? I haven’t done much C#, but I have seen quite a lot of classes containing both properties and getters and setters without any obvious reason. Isn’t this an indication that properties somewhat violate OO encapsulation? Why do I have to know if something is
a special property or not?

However, the main reason why I dislike properties is that I’m lazy. If I need to set a property on an object, but I don’t know which ones are available, I will type obj.set and hit the autocompletion key like Ctrl-space in Eclipse. This will then give me all writable properties. Likewise, I can do obj.get and hit the key and get all readable properties. I know, “real” properties are displayed as being readable and/or writable, but they’re then mixed with all the methods on the object too, and I’ve already seen way too many attempts at setting a read-only property, exactly because of this.

 Two events

  • July 23rd, 2009
  • 11:38 am

Just a short notice about two events you might want to attend – they’re free, and I’ll be presenting at both of them.

First, there’s the first Google Wave Hackaton in Denmark, arranged by Tommy from Miracle. At this hackaton, we will explore the features in Google Wave and do some experiments. All suggestions are welcome, if you have any, go to the Google Group, and if you want to sign up, send an email to tpe (at) miracleas dot dk. It will be held in Århus on August 25th and in Copenhagen on September 10th, although I might only make it to the one in Århus. Oh, and everybody will receive a Google Wave Sandbox account.

The second event is with the Danish Spring User Group. On September 8th in Århus and September 17th in Copenhagen, I will be talking about the new features in Spring 3.0. Spring 3.0 is available in milestone 3, and contains some nice new stuff, summarized nicely here: http://blog.springsource.com/2009/05/06/spring-framework-30-m3-released/

To attend, join the Spring User Group DK on LinkedIn, where the complete schedule for the event can also be found.