This is a scattered post. I apologize.
In the job I had before this one, I was doing .NET programming.
Now, don’t cringe immediately. I did it for several reasons; my mortgage being a big one, of course. I did it because I wanted to see what it was all about. I was curious about the state of the art for Windows programming tools, and also because I wanted to see what Microsoft had done with C#, since I had never really had the reason or inclination to look at it.
My conclusion? C# is a lot like Java, but it is very much like a Microsoft-designed Java. There was a reason for everything they did, and I think a lot of it actually does improve on the Java stuff, but much of it was just different. One of the things that I used in C# that was new to me was Properties — variables that call the right methods for getting and setting values.
My initial reaction to Properties was that I didn’t like the hidden code. It wasn’t always clear to me that doing an assignment was actually calling code — which is one of my complaints with C++ ad operator overloading in general — it is, at times, hard to see from just looking at the code what is being called.
That being said, and at the risk of repeating myself, I find myself falling in love with Objective-C (ObjC). ObjC cannot be described as a clean language, its basic nature is that it exists as a hybrid language. In addition, the 2.0 version of ObjC includes the same Properties that I have issues with in C#. Yet they don’t annoy me as much as they did in C#, mainly because in the most common case, they are used to make instance variables behave in a safer fashion.
Tech Digression: The most common use of Properties within ObjC is to make your instance variables thread-safe and memory-management friendly. Most of the time you are going to declare your property and let the system write the code for you. My issue with C# was that much of the time, interesting code with side effects was being shoved into the getters and setters. In the vast majority of the cases in ObjC, a property is used to just safely access an instance variable. Yeah, there could be some complex stuff going on, but it is usually centered around access serialization, and making sure that the right thing is done memory-management-wise.
ObjC can be intimidating, with all of the #import, @implementation, [object method], and other stuff that doesn’t look like C… It’s definitely something built by a mad computer scientist.
But I’m falling deeply in love with it. I’m not sure why.