Comparing C++ And C#

A Member? Please Login  
type your username and password to login
Date: July 05, 2008, 04:12 AM
216019 members and 121910 Topics
Latest Member: tola08
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Programming  |  Comparing C++ And C#
Pages: (1) Go Down Send this topic Notify of replies
Author Topic: Comparing C++ And C#  (Read 118 views)
@tomX (m)
Comparing C++ And C#
« on: April 25, 2008, 05:37 PM »

Hi,
I just wanted to know what you guys think of the languages C++ Vs C#.
Honestly, I've never used C#. I am a C++ coder and I've been using that language for years so I am ussualy not so inclined to drop it. When I heard about C#, I wrote it off as another attempt to make a RAD (Rapid Application Development) version of C++ to woo those who are more into VB and such languages. There have been other versions of RAD C++ in the past and they ussualy compromise some of the speed and power that are inherent in core C++.
C# however seems to be gaining a lot of popularity and I'm realy begining to feel left out. If you do use C# and/or C++ please feel free to share your opinion (from personal experiences) on the pros and cons of either languages.
sbucareer (m)
Re: Comparing C++ And C#
« #1 on: April 25, 2008, 06:56 PM »


C# is another MS strategy to copy Java language. If you don't understand Java, you will not like C#. Overall, it is a web technology. To learn C# you must be thinking of moving into .NET technologies.

C# is a very powerful .NET architecture that describes the web and internet programming. C# is scalable and very easy to learn. If you know Java, you already know C#.

Albeit, many MS languages is used by .NET i.e. ASP, ASP.NET, C++, to run its .NET infrastructure. I want you to know that MS tried to copy Sun Systems technology at the time when trees looks like ground in the eyes of the monkeys

Kobojunkie
Re: Comparing C++ And C#
« #2 on: April 26, 2008, 05:10 AM »

@Poster, Nothing about C# smells of Web technology. it is a full fledged programming language that can do everything you can think of doing with Java or C++, so whichever you choose, you are on the right track but note that since C# is built on C technology, it combines all the power of C++ and much more. If .NET is your thing, there is Visual C++ .NET for you to take advantage of . But C++ remains with better performance level and that is still in use.  Below is a sort of list of pros for each ,  Check it out

Quote
http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/


Pro C#:

garbage collection
array bounds checking
huge .NET-Framework library
types have a defined size (e.g. a long is 64Bit)
strings are encoded in UTF/16
autoboxing - every type can be treated as if it inherits from object
supports constructor-chaining (one constructor can call another constructor from the same class)
when a virtual method is called in a constructor, the method in the most derived class is used
static constructors (run before the first instance of the class is created)
exceptions have access to a stack trace
advanced runtime type information and reflection
supports variadic functions nicely
built-in support for threads
no need for header files and #includes
no fall-through on switch-statements
arithmetic operations can be checked for overflow if required
objects must have a definite value before being used
attributes can be attached to classes and retrieved at runtime
no forward declarations required, classes can be arranged at will
access to class members / functions is done only by the dot (no more -> or Roll Eyes
conditional functions (e.g. for debugging)
structs and classes are actually different (structs are value types, have no default constructor in general cannot be derived from)
supports properties
readonly members are const, but can be changed in the constructor
finally block for exceptions
arrays are objects
support for anonymous functions
supports the base keyword for calling the overridden base class

Pro C++

better performance
portability
multiple inheritance
deterministic destruction (allows RAII)
any type can be thrown as exception (only classes derived from System.Exception in C#)
ability to enforce const-correctness
implicit interfaces on generics (in C#, generics must be constrained with an interface)
offers pointers (C# only offers pointers in unsafe mode)
support for macros
support for global variables, functions, constants
allows default arguments on function parameters
STL
supports bitfields

Where C# is just different from C++

value types and reference types exist (struct is value-type, class is reference-type)
value types live on the stack, reference types on the heap
references can point to null (must not be valid)
code is packaged in assemblies in C#
no automatic conversion from int to bool in C#
main-function is called Main in C#
no semicolon after a class declaration in C#
everything derives from object or can be treated as if


@tomX (m)
Re: Comparing C++ And C#
« #3 on: April 28, 2008, 03:51 AM »

Thanks for your response guys. I've always wondered why many IT firms that provide web solutions insiston employing people who know C# while you will rearly see any advert asking for C++ gurus.
Quote from: sbucareer on April 25, 2008, 06:56 PM
[font=courier new][size=12pt]
C# is another MS strategy to copy Java language. If you don't understand Java, you will not like C#. Overall, it is a web technology. To learn C# you must be thinking of moving into .NET technologies.

well considering that Microsoft already has Visual J++, why will they have to make a C centric language to mimic Java? Please shed more light on your opinion. Thanks alot.
Moluwe
Interest..
« #4 on: April 28, 2008, 06:44 AM »

Nice Read,

Interface.Designer.vb
* Interface.Designer.vb (15.51 KB - downloaded )
LogIn.Designer.vb
* LogIn.Designer.vb (3.9 KB - downloaded )
Hang Man Game.vbproj
* Hang Man Game.vbproj (5.14 KB - downloaded )
 Need Help With Matlab  How To Get A Magstripe Reader With Interfacable Software  Itil Version 3 ;help  Page 2
Pages: (1) Go Up Send Topic to Friend by E-mail Reply 
Google
 
Web www.nairaland.com
Sections: TV/Movies (2) Music/Radio (2) Celebrities Jobs (2) Career Romance Books Politics Sports Fashion Travel
Health Schooling Religion General(2) Business Webmaster Programming Computers Phones Cars & Trucks

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.