7 Replies - 23808 Views - Last Post: 05 January 2008 - 03:22 PM Rate Topic: -----

#1 Videege  Icon User is offline

  • rÍvant.toujours
  • member icon

Reputation: 6
  • View blog
  • Posts: 1,413
  • Joined: 25-March 03

Pros/Cons of the C# Language

Post icon  Posted 08 June 2007 - 08:28 AM

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 :).
Gogogo!

Is This A Good Question/Topic? 0
  • +

Replies To: Pros/Cons of the C# Language

#2 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,507
  • Joined: 12-July 02

Re: Pros/Cons of the C# Language

Posted 08 June 2007 - 08:55 AM

For me:

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

Cons: No multiple inheritance (although there is a work around).
Was This Post Helpful? 0
  • +
  • -

#3 spullen  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 10
  • View blog
  • Posts: 356
  • Joined: 22-March 07

Re: Pros/Cons of the C# Language

Posted 08 June 2007 - 03:18 PM

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.
Was This Post Helpful? 0
  • +
  • -

#4 SMcLellan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 10-June 07

Re: Pros/Cons of the C# Language

Posted 10 June 2007 - 12:44 AM

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: 10 June 2007 - 12:47 AM

Was This Post Helpful? 0
  • +
  • -

#5 sogod  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 22-June 07

Re: Pros/Cons of the C# Language

Posted 22 June 2007 - 01:15 AM

View PostSMcLellan, on 10 Jun, 2007 - 12:44 AM, said:

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!) ;) 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.
Was This Post Helpful? 0
  • +
  • -

#6 gogole  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 3
  • View blog
  • Posts: 131
  • Joined: 17-July 07

Re: Pros/Cons of the C# Language

Posted 04 August 2007 - 07:53 AM

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: 04 August 2007 - 07:55 AM

Was This Post Helpful? 0
  • +
  • -

#7 carbon_coder  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 27
  • Joined: 31-December 07

Re: Pros/Cons of the C# Language

Posted 05 January 2008 - 02:16 PM

I think C# is very user friendly. It was easy for me to pick up and learn especially with the XNA framework.
Was This Post Helpful? 0
  • +
  • -

#8 baavgai  Icon User is online

  • Dreaming Coder
  • member icon

Reputation: 5880
  • View blog
  • Posts: 12,757
  • Joined: 16-October 07

Re: Pros/Cons of the C# Language

Posted 05 January 2008 - 03:22 PM

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...

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1