View Single Post
Old Dec 15th, 2006, 11:34 PM   #30
lectricpharaoh
Caffeinated Neural Net
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,010
Rep Power: 5 lectricpharaoh will become famous soon enough
[edit] Sorry. It's a little more than a 'sentence or so'. [/edit]
Quote:
Originally Posted by Scatman View Post
My apoligies, as I said before, me=noob. While we are talking C, would you mind giving me a quick (sentence or so) overview or explanation of what C# is?
DaWei's definition is sound; C# resulted when Microsoft tried adding extensions to Java, was sued by Sun, and settled the suit. This is the main reason MS doesn't offer their own Java VM any longer; one must now get it from Sun, which is as it should be.

That said, I myself prefer C# over Java. The syntax is virtually identical, but there are a few differences. In particular, there are some features that Java's designers opted not to implement (operator overloading, properties, and pointers, for example) in order to 'keep things simple' (at least, this is the rationale I most frequently encounter). However, at least in the case of operator overloading and properties, they can help a lot in making the code easier to work with. For example, look at the following code examples, and decide which is more clear to you:
// Java
objectA = objectB.add(objectC);
value = objectA.getValue();

// C#
objectA = objectB + objectC;
value = objectA.Value;
Another thing I like about C# is the runtime library seems a bit richer in terms of features, and more user-friendly in its design (though both of these are strictly my opinion). The fact that (at least on Windows) there is a very capable visual designer for making GUIs in C# doesn't hurt either (and yes, I know there are similar designers for Java, but I've never used them).

Java does have an edge in the web development market, both in server-side code (ie Java Server Pages) and client-side code (ie applets). Due to the cross-platform nature of java and its API, C# is hard-pressed to compete here. Even though the C# specification is open, and .NET has been (at least in part) ported to various platforms, Java is still the tool of choice here.

On the other hand, if you're wanting to write Windows applications, I would submit that C# is a much more suitable alternative. In my eyes, not only is it easier to work with, there seems to be less variance between versions of the .NET framework between versions than there is between versions of the Java SDK. I still remember how the Tetris clone I wrote in Java worked fine when I developed it, but upon 'upgrading' to a more recent Java SDK and building it again, it was exceedingly slow to respond (read: no longer playable). There also seem to be more deprecated classes and methods in the Java API than in the .NET framework.

One last issue is that, if using C#, you will be using the .NET framework. This means that you can take advantage of any language that uses the framework. For example, if you have two developers, and one is fluent in VB, and the other in C#, they could each write portions of the same application in their preferred language, and the two pieces could operate seamlessly together.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
lectricpharaoh is offline   Reply With Quote