Sign in to follow this  
HugosHoH

[.net] Sharp the C, or coffee

Recommended Posts

Hello I'm new to .NET and some of my IT mates advised me to start learning the C# and get rid of the low level things I have been into since very long. My question is, what makes C# worths learning instead of say Java? Both offer a huge bunch of services...both are dynamic...both are VM...both share the same language features... Except for one thing that C# is not portable. Mono is still under development and not supported by MS. Java gui sucks. And both languages suck for speed. Huh?

Share this post


Link to post
Share on other sites
Quote:
Original post by HugosHoH
And both languages suck for speed.


Hasn't been true with Java for about 3 years. JIT compiling makes Java apps extremely competitive with native apps. IIRC C# is similarly good speed-wise.

-me

Share this post


Link to post
Share on other sites
Quote:
Original post by HugosHoH
My question is, what makes C# worths learning instead of say Java? Both offer a huge bunch of services...both are dynamic...both are VM...both share the same language features...

Comparison of C Sharp and Java

Quote:
Original post by HugosHoH
Except for one thing that C# is not portable. Mono is still under development and not supported by MS.

Your first statement is just wrong. Your second statement is just a bad argument, Microsoft owns the "C#" just as little as they "own" C++. Mono is not complete, this is true, but it has come a very long way and many would probably say that it's stable enough to rely on.

Quote:
Original post by HugosHoH
Java gui sucks.

Ok... ? And your arguments for this are?

Quote:
Original post by HugosHoH
And both languages suck for speed.

Really? Where did those statistics come from?

Share this post


Link to post
Share on other sites
Omid, you just quoted my words and commented on them by repeating the same statements in a different way...well my question again, what makes C# worth learning, or what makes companies rush on it like mad? what makes it favourable over java if it's?

Share this post


Link to post
Share on other sites
Quote:
Original post by HugosHoH
Java gui sucks.

And both languages suck for speed.


Pretty bold statements for never having used either of the two.

Java and C# are rather similiar syntactically. Really, the decision on which to use should probably be based on the type of application you plan on building and what you plan on doing with it - and of course, your preference. Google will produce a nice comparison of the two. If you're already a good programmer it shouldn't take much investment to learn one, the other, or both.

Java GUI doesn't necessarily "suck." The default look and feel might be ugly, but that can easily be worked around. Swing serves its purpose. I've written large GUI's with swing and a few excellent third party tools and they've come out as good as a GUI written anywhere else. Swing is far from perfect - but I wouldn't generalize it as "sucking."

Saying both languages suck for speed is a mis statement, I think. Alot of people who don't have much experience with the two say this. Using the .NET libraries and good coding practices, C# is plenty fast. Just look at some of the graphics and game engines that people have written in C#/.NET. Are they bleeding edge? No, of course not - but some of them really are excellent. What are you doing that requires such intense speed? C# doesn't "suck" for speed, and if it isn't fast enough for whatever computationally intensive algorithms you're implementing, use C++, dont bother with Java or C#.

Share this post


Link to post
Share on other sites
Quote:
Original post by HugosHoH
Hello

I'm new to .NET and some of my IT mates advised me to start learning the C# and get rid of the low level things I have been into since very long.

My question is, what makes C# worths learning instead of say Java? Both offer a huge bunch of services...both are dynamic...both are VM...both share the same language features...

Except for one thing that C# is not portable. Mono is still under development and not supported by MS.

Java gui sucks.

And both languages suck for speed.

Huh?


You make quite a few statements for someone that inexperienced. An attitude mostly disliked by peers, esp. if these peers know a good deal about the subject.

First of all, Java does run inside a VM, .NET does not. Any .NET code being executed is being executed ON the CPU. Sure, every .NET language compiles into MSIL, but once the MSIL code reaches the point of being executed, it will get compiled, stored and then executed on the CPU. In comparison, C# is capable of attaining around 95% of the speed C++ can do, and is generally faster in memory allocation(Unless you're using custom made allocators).

What makes Java / C# excellent for application development is that they support a widerange of features, such as garbage collection, reflection, hooking of OS specific libraries(Shared Objects / DLLs / etc.).

What makes C# more used by companies than Java(Or rushed), is the fact that it integrates perfectly with Windows, all GUI widgets are in the standard windows look(No extra libraries / coding needed), a better event model than Java offers and the .NET distro's can be grabbed off the Windows Update site.

C# also comes with one of the best IDEs out there: Visual Studio. Also do languages like Java / .NET speed up development rapidly. Instead of me writing low-level code to(For instance:) make sure all my memory is properly cleaned up, C# does it for me, and I can focus on writing what I do need to write: An application that does what my client wants(My client also wants the app to not have memory leaks, but he doesn't like it when you schedule a complete week to make sure it's all safe).

Also, C# offers what Visual Basic couldn't: A Rapid Application Development(RAD) environment that allows you to write code that doesn't end up in a huge spaghetti of horrific code with good exception handling and also suitable for writing applications that run as webservice, website or even on a PDA.

Toolmaker

[Edited by - Toolmaker on October 9, 2007 1:39:27 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by HugosHoH
Omid, you just quoted my words and commented on them by repeating the same statements in a different way...

No, I quoted your words and said that they were plain wrong. The only statement I agreed with was that "Mono is under development".

Quote:
Original post by HugosHoH
well my question again, what makes C# worth learning, or what makes companies rush on it like mad? what makes it favourable over java if it's?


C# is a good language, as in designed in a way which many programmers find pleasing, has features which most programmers agree are great features for a general purpose programming language, can be used for web application development as well as for client applications, and is very powerful and fast (yes, fast) whilst allowing relatively short development times, just to name a few reasons.
As for a comparison to Java, I already gave you a good link.

Share this post


Link to post
Share on other sites
Personally, the reasons I like C# over Java are the fact that C# supports properties, delegates, events, operator overloading. C# also gives the programmer the ability to define stack allocated types, as well as the ability to write type unsafe code using pointers.

Share this post


Link to post
Share on other sites
One thing to keep in mind that C# is better able to address the faults and issues concerning Java because it came out relatively recently. So where you may have issues with the Java language and its design, you will probably not find them in C# as the designers set out to fix the flaws they saw in the other languages around them, including C++ and Java.

Share this post


Link to post
Share on other sites
Quote:
Original post by Toolmaker

In comparison, C# is capable of attaining around 95% of the speed C++ can do, and is generally faster in memory allocation(Unless you're using custom made allocators).

Toolmaker


I have a question concerning that. Does this mean that a C# beginner vs a C++ beginner the C# program would maybe even run faster? Considering that even a novice C++ programmer may not even be able to optimize the speed of C++?

Thanks

Share this post


Link to post
Share on other sites
Quote:
Original post by dillscon
Quote:
Original post by Toolmaker

In comparison, C# is capable of attaining around 95% of the speed C++ can do, and is generally faster in memory allocation(Unless you're using custom made allocators).

Toolmaker


I have a question concerning that. Does this mean that a C# beginner vs a C++ beginner the C# program would maybe even run faster? Considering that even a novice C++ programmer may not even be able to optimize the speed of C++?

Thanks


That depends on the program. C#'s standard class library is larger and generally more accessible. The likelihood that the beginner will find a well written piece of code to help them rather than write the code themselves is larger, and thus the program is likely faster.


Most importantly, the C# beginner is going to produce a mere fraction of the bugs because the language is designed in such a way that there's less ways to do something wrong.

And I personally think that any C# beginner will be able to write the same code in less time due to better IDEs available, the afore mentioned larger standard library, and the generally better, more consistent naming and documentation... though that's at least debatable.

Share this post


Link to post
Share on other sites
As one who uses Mono heavily, I have to say: Mono is under development, but it works pretty well for a lot of things you might be trying on it. I've written a couple of games using it. I haven't finished them, but that isn't because of the language, that is because I don't finish games well. :)

If you use the Tao framework, things are pretty universal across both platforms. I've had no trouble compiling stuff over on Microsoft's .NET and using it on Mono and just the opposite. I've even seen some Mac OS X stuff running Mono. I've done some pretty decent things with the SDL, OpenGL, and FreeGlut things for Tao. Thought it is under heavy development (i.e. no release package), the Moonlight/Silverlight stuff is actually very nice. Moonlight working under Mono, Silverlight under Microsoft's.

And, if you stick with C# 2.0 stuff or less, chances are that Mono already supports it.

Now, the reason I program in C# is mainly some of the aesthetics and some additional features. I like the event/delegate stuff, I like the ?? operator, and the attributes are nice (though I heard Java has/is getting those). I disagree that it isn't a VM, it has a VM, it is just a much different type of VM than Java's. Loads faster on my computer too. Also, at the time, Java didn't have features that I really liked in C#, though I've coded both.

A GUI for C# is kind of generic though. There is System.Windows.Forms, which works wonderfully on Windows and decently under Mono. There is also Gtk# which works on both, if you like the Gnome side of things. I know the Gtk# is... okay for animation in games, I wrote a sprite library for Gtk# that ran fairly well under Linux, but the limitations were in gtk there, not Mono. There is also a Qt#-like project going on, but the name escapes me (Q-something). All that doesn't include the Xna (there is a Mono.Xna to make it crossplatform) stuff or the pure graphical stuff. CeGui# for making windows on Linux/Windows, it's okay but a tad complicated and more of a copy instead of a proper library.

So, Mono is under development, but it very usable for a lot of games.

I'm also biased, I wrote the csharp-mode for Emacs so I could program C# on Linux. :D

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this