Welcome to Dream.In.Code
Getting C# Help is Easy!

Join 136,113 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 1,746 people online right now. Registration is fast and FREE... Join Now!




Pros/Cons of the C# Language

 
Reply to this topicStart new topic

Pros/Cons of the C# Language

Videege
8 Jun, 2007 - 07:28 AM
Post #1

rêvant.toujours
Group Icon

Joined: 25 Mar, 2003
Posts: 1,406


Dream Kudos: 150
My Contributions
Hello everyone!
I'd thought I would try and kick things off a little here in the C# forum with a discussion of the language. What is C# good for? What's it not so great at?

Here's my little try:

PROS:
  • For many, C# has a familiar syntax in that it follows C.
  • Fully integrated with the .NET library, providing access to a great repository of functionality and support.
  • Safer than its namesakes (C/++) in that pointer types are not permitted.

CONS:
  • Obviously less efficient in execution than C/++ because it is ultimately interpreted.
  • Still allows pointers in 'unsafe' blocks.
  • Loses any cross-platform capabilities because of the integration with .NET.

So what do you think? Feel free to add, subtract, multiply...or correct me on anything I've been dumb on smile.gif.
Gogogo!
User is offlineProfile CardPM
+Quote Post

Amadeus
RE: Pros/Cons Of The C# Language
8 Jun, 2007 - 07:55 AM
Post #2

g++ -o drink whiskey.cpp
Group Icon

Joined: 12 Jul, 2002
Posts: 12,226



Thanked: 37 times
Dream Kudos: 25
My Contributions
For me:

Pros: .NET Library - ever expanding, lots of predetermined classes.

Cons: No multiple inheritance (although there is a work around).
User is offlineProfile CardPM
+Quote Post

spullen
RE: Pros/Cons Of The C# Language
8 Jun, 2007 - 02:18 PM
Post #3

D.I.C Regular
Group Icon

Joined: 22 Mar, 2007
Posts: 330



Thanked: 1 times
Dream Kudos: 50
My Contributions
I like that it's like java and c++ combined, and that makes it a very powerful language, and since I know both of those two language I find it very easy to create applications. Also the .net library is really good.
User is offlineProfile CardPM
+Quote Post

SMcLellan
RE: Pros/Cons Of The C# Language
9 Jun, 2007 - 11:44 PM
Post #4

New D.I.C Head
*

Joined: 9 Jun, 2007
Posts: 2


My Contributions
QUOTE
* Obviously less efficient in execution than C/++ because it is ultimately interpreted.
* Still allows pointers in 'unsafe' blocks.
* Loses any cross-platform capabilities because of the integration with .NET.


my 0.02 on the cons is this:
1) At the end of the day your .NET code is compiled to x86 bytecode, which means that the efficiency of your code is still dependent on compiler optimizations. Since the runtime also knows the full scope of what your application is doing there's opportunity for optimizations as well.

2) Pro and a Con -- mostly there to allow interop and legacy situations and requires a compiler flag to allow unsafe code anyway. Pointers tend to be really efficient at doing certain tasks. I wouldn't be entirely surprised if unsafe code went away in a future version of C# (post 3.5) to align the language with the DLR.

3) Check out http://www.mono-project.com/ ... and there are other many examples of .NET apps running on other platforms including your 360 (XNA), coffee maker, watch, gps (Micro Framework)...

This post has been edited by SMcLellan: 9 Jun, 2007 - 11:47 PM
User is offlineProfile CardPM
+Quote Post

sogod
RE: Pros/Cons Of The C# Language
22 Jun, 2007 - 12:15 AM
Post #5

New D.I.C Head
*

Joined: 22 Jun, 2007
Posts: 1


My Contributions
QUOTE(SMcLellan @ 10 Jun, 2007 - 12:44 AM) *

1) At the end of the day your .NET code is compiled to x86 bytecode, which means that the efficiency of your code is still dependent on compiler optimizations. Since the runtime also knows the full scope of what your application is doing there's opportunity for optimizations as well.


Well, it is complied, not interpreted, but the opportunity for optimizations does not mean that much. The JIT is good, but its not magic. Your code still has be loaded and compiled to machine code at run time, which takes time, and the large parts of the base class you need have to be loaded, which take time, and more importantly there is a lot of overhead for memory management which takes time and memory.

But by and large, most applications written today don't really need the speed of C or C++. In fact most programmers probably couldn't explain the performance differences between an array and a linked list (even MS worries me, they left linked lists out of the framework collections library in .NET 1.0 and 1.1!) wink2.gif And if you cant do that, probably managing pointers and memory directly is not your cup of tea, and so you couldn't really use the features of C++ to get maximum performance anyways.

User is offlineProfile CardPM
+Quote Post

gogole
RE: Pros/Cons Of The C# Language
4 Aug, 2007 - 06:53 AM
Post #6

D.I.C Head
Group Icon

Joined: 17 Jul, 2007
Posts: 131


Dream Kudos: 25
My Contributions
pros:
the just in time compiling method is great, saves time and beats a virtual machine.
it is easy to remember syntax.
the garbage collector saves you the trouble of freeing memory

cons:
doesn't compile as fast as it's predecessor c++

This post has been edited by gogole: 4 Aug, 2007 - 06:55 AM
User is offlineProfile CardPM
+Quote Post

carbon_coder
RE: Pros/Cons Of The C# Language
5 Jan, 2008 - 01:16 PM
Post #7

New D.I.C Head
*

Joined: 31 Dec, 2007
Posts: 2

I think C# is very user friendly. It was easy for me to pick up and learn especially with the XNA framework.
User is offlineProfile CardPM
+Quote Post

baavgai
RE: Pros/Cons Of The C# Language
5 Jan, 2008 - 02:22 PM
Post #8

Dreaming Coder
Group Icon

Joined: 16 Oct, 2007
Posts: 2,019



Thanked: 105 times
Dream Kudos: 475
Expert In: C, C++, Java, C#, ASP.NET, PHP, Perl, Python, Oracle, SQL Server, MySql, HTML, JavaScript, Lua

My Contributions
Hmm, looks like someone resurrected an old thread. Well, I hadn't seen it, so...

PROS:
  • Java's step child, near identical to Java, but with benefit of experience
  • delegates - offer a clean event model and more elegant code
  • events - can't be stressed enough, good clean model (VB.NET version, not so much)
  • properties - more explicit than classic OOP getter/setter methods
  • No multiple inheritance (sorry, had to, not a CON for me).
  • Microsoft Driven
CONS:
  • Microsoft Driven - yep, it's a pro too, funny that
  • Can't really do non Windows: Sorry, Mono tries, but...

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/1/08 09:44PM

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month