Wednesday, February 02, 2005

Re: More on C# and C++

For the most part I agree with his points. The basic focus in creating C# was simplicity (not to the levels of Java, but close). So they tried to remove everything that would get in the way of that goal. Long back, in one of his posts he mentioned how when the began the design, they started off giving each (potential) feature a -10 and then tried to make arguments for it to be included in the language. This meant it need a really strong case to get in.

A couple of points where I feel I disagree with him.

Regarding Coherent Libraries... Yeah, the .NET framework includes everything but the kitchen sink. And yeah, it's very nice and convenient. But at the same time it seems to be shutting out other people from coming up with libraries of their own. MS keeps saying how they want to get the community involved with their technology. Towards that end, they have opened up quite a bit with their dev blogs. But it pales compared to the Java community. In the Java circle, a number of APIs have come out and risen to prominence (Rahul can mention them). They are not part of the standard Java API, but everyone knows about and uses them. I don't think I can even name one third party popular .NET library. Putting everything in one gigantic framework just keeps bloating it up and you have to pay the size penalty regardless of whether you will use them APIs or not.

I think I actually read it on some Sun dev's blog that this was a big difference in view points of Java and .NET. Although, Sun seems to have this overarching hold on Java, it really is quite an open thriving community. MS needs to change their attitude and let others join in.

Regarding const... In this one I completely disagree with him. There is this "Principle of Least Privilage" where you only allow the absolute lowest possible acess to get the job done. const enables you to make use this principle in C++. You can make the contract clear that you won't mess with someone else's object. Why not do the same for C#? Yeah, C# is a more "safer" language than C++ with less potential for abuse, but anything that makes the programer's intentions clear in code can't be bad. In C# most arguments are passed by reference (except for value types and even they could (unkowingly) be passed by reference through boxing). So the callee could modify it any way they want. I really think that const should have been part of the language.

As as aside, have you guys read anything on Eiffel? I've heard that it's heavily contract oriented. As in, even pre and post conditions can be specified in code.

No comments: