473,699 Members | 2,564 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# vs. C++

cj
I don't want to start a war but why would I choose one over the other?
First and foremost I need to keep in mind marketability of the skill and
the future of the language.

I'm getting the feeling I'll be moving from VB to one or the other. I
have some say on which but perhaps not the final decision. I have used
C and C++ a little bit years ago. I have no experience in C#. I don't
expect it to be that difficult but I hate remembering the idiosyncrasies
of too many languages so I'd like to pick one C# or C++ and make the
right choice.
Jun 27 '08
151 4213
Microsoft developed C# specifically for the web. VB.NET was developed and
remains being developed using C#.

What motivated me to choose C# was the indisputable fact that web
development is a client-server paradigm and as such separate language skills
are needed for client-side and server-side development.

JavaScript is the defacto standard for all client-side web development.
Since JavaScript was derived from C both JavaScript and C# have exactly the
same punctuation and nearly the same syntax and grammar making it possible
to say we can learn two or more languages for the price of one so to speak.

<%= Clinton Gallagher

"cj" <cj@nospam.nosp amwrote in message
news:uK******** ******@TK2MSFTN GP06.phx.gbl...
>I don't want to start a war but why would I choose one over the other?
First and foremost I need to keep in mind marketability of the skill and
the future of the language.

I'm getting the feeling I'll be moving from VB to one or the other. I
have some say on which but perhaps not the final decision. I have used C
and C++ a little bit years ago. I have no experience in C#. I don't
expect it to be that difficult but I hate remembering the idiosyncrasies
of too many languages so I'd like to pick one C# or C++ and make the right
choice.
Jun 27 '08 #11
On Fri, 20 Jun 2008 20:34:46 -0700, Michael D. Ober
<obermd.@.alum. mit.edu.nospam. wrote:
>C++ is a dying language. [...]

Huh? Our entire telecommunicati ons industry is written in C and C++ and
C++ is still the way to go for embedded systems.
I think he meant that "C++ is a dying language" in the same way that
FORTRAN and COBOL are "dying languages". Of course, those languages have
been dying for decades and still are in broad use. So C++ could take a
little while to finally kick the bucket too. :)

As far as embedded systems go, I think you will find that just as
C++ superceded assembly and hand-written machine code for embedded
systems, so too is C++ likely to be superceded by some other language.
For example, Java is already in widespread use as a platform language for
mobile phones, and it's not unreasonable to expect that inasmuch as
Windows is the OS for some embedded systems, C# and .NET will wind up
being commonly used in embedded systems as well.

Pete
Jun 27 '08 #12
MC wrote:
>Dealing with existing C++ code can be a disaster when you have lots of
inexperience d programmers on your team. To program well in C++ you have
to learn disciplined modern C++ practices, such as reference counted
smart pointers, RAII, exception safety, etc. Picking up a good style is
impossible when you learn from old C++ books. Companies who hire C++
programmers tend to have lots of legacy code that I wouldn't consider
modern or easy to maintain.

That is a good point. Object-oriented programming wasn't mature when C++ came into use. There is a lot of bad C++ code in the world, and C++ makes it easy to write bad code and create programs that crash.
Curious. I wouldn't see C# as fundamentally better for writing
Object-oriented code. I see the two languages as essentially the same
but C# has removed the need for explicit memory management and a few
other house keeping issues (ok I know C# isn't quite as flexible and
full featured as C++). So C# is a bit like driving an automatic rather
than as stick shift. The really complicated thing is the driving not the
mundane task of changing gear.

I would chose C# as it is easier than C++ but more importantly you are
more likely to be given new code to write in C# rather than decipher
some arcane legacy system in C++.

I think C will outlive C++. C is going to continue to be a good language for small routines where performance is paramount. For such things, I find myself writing "C-barely-plus-plus," which is C with slight use of the C++ extensions. But when I want real object-oriented programming, I use C#.
I can't see why anyone would want to use C rather than C++?
Jun 27 '08 #13

"RFOG" <no@mail.comh a scritto nel messaggio
news:op.uc3f9es f2upo6d@red-mars-server...
I strongly disagree. Of course C++ is alive into embedded systems, but you
forget one thing: Java VM is done in C++, and if C++ disappears... Windows
will disappear because Windows is done in C and most in C++... Linux will
disappear too.
I agree with you, RFOG.

Only one point: Linux (the kernel) is built in pure C (not C++).

And actually it is impssible to buid an OS in Java or in a .NET languge.
.NET MicroFramework is the most low level C# and it is a layer over...
emmmm... rrrrr... ¡C++!
You're right.

Moreover, I doubt that very big and successfull apps (like Microsoft Office,
or Visual Studio, or even non-Microsoft apps like Photoshop) could be built
using C# (or Java...). Or, if they would be built with C# or some other
"managed" language, what would be the memory occupation and would they be as
snappy as the C++ versions?

Instead, for Internet stuff like ASP.NET, I think that C# (or VB.NET as
well) is a clear winner over C++.

Just use the right tool for the right job.

Giovanni
Jun 27 '08 #14

CJ,

I guess you were surprised of how many replies you got so far!!

Anyway, if you want to move to C# or C++, know this:

a.. C# is a virtual machine - a little like java and VB already - at run-time your program is interpreted by another program called the CLR. It shields you from a lot of computer internals, but unlike VB, does a good job of offering you a nice object-oriented API. C# is just so cool for developers! The price to pay for this niceness is that programs are not as low-level as in C++, and thus will run a little slower.

b.. C++ on the contrary in just above C and assembler in terms of level. C++ will provide you with a rather direct access to the machine, a lot of efficiency, a lot of freedom. However, using that freedom and this more direct access to the OS, you will most probably hang yourself with the rope one day. It is much, much harder to harness all the power of C++, COM, Win32, etc., than it is to learn C# (as mentioned in another post). You can do programs that run faster, but you have less of a safety net when you decide to explore the untamed wilderness.

Wrapping up the above, C# is perfect for business applications that require more safety and faster development speed. I would say, in general, there way much more market for C#.

C++ is ideal if you want to do device drivers, develop system components, etc.

When it come to marketability, you have to assess your geographic situation. If you live in Silicon Valley, you probably need to develop in low-level and learn C++, or even master assembler. If you live in Montreal, the market is much higher level; C# is clearly adviseable. If you're unsure, refer to your local job web-site. Look up for what programer jobs are offered in your vicinity, and what they ask for in terms of knowledge and experience.

In any event, knowing how to manage a database is always - everywhere in the world - a wonderful though less glamourous asset.

Be good!
"cj" <cj@nospam.nosp amwrote in message news:uK******** ******@TK2MSFTN GP06.phx.gbl...
>I don't want to start a war but why would I choose one over the other?
First and foremost I need to keep in mind marketability of the skill and
the future of the language.

I'm getting the feeling I'll be moving from VB to one or the other. I
have some say on which but perhaps not the final decision. I have used
C and C++ a little bit years ago. I have no experience in C#. I don't
expect it to be that difficult but I hate remembering the idiosyncrasies
of too many languages so I'd like to pick one C# or C++ and make the
right choice.
Jun 27 '08 #15
Daniel Boulerice wrote:
>
CJ,

I guess you were surprised of how many replies you got so far!!

Anyway, if you want to move to C# or C++, know this:

a.. C# is a virtual machine - a little like java and VB already -
at run-time your program is interpreted by another program called the
CLR.
No, it isn't. At runtime, it is compiled just-in-time and it runs
natively, it is not interpreted. The CLR is not another program either,
it is the main runtime library that comes with .NET, and also runs
natively. AFAIK, most C++ products also have a runtime library. .NET's
CLR is just more extensive.
--
Rudy Velthuis http://rvelthuis.de

"This book fills a much-needed gap."
-- Moses Hadas (1900-1966) in a review
Jun 27 '08 #16
Daniel Boulerice wrote:
* C# is a virtual machine - a little like java and VB already - at
run-time your program is interpreted by another program called the
CLR.
Try google "JIT compiler".

Arne
Jun 27 '08 #17
Nick wrote:
Curious. I wouldn't see C# as fundamentally better for writing
Object-oriented code. I see the two languages as essentially the same
but C# has removed the need for explicit memory management and a few
other house keeping issues
More access levels, interfaces and delegates seems
to me to be features that makes good OOP easier.

Arne
Jun 27 '08 #18
Michael D. Ober wrote:
"MC" <fo************ **@www.ai.uga.e du.slash.mcwrot e in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
>"cj" <cj@nospam.nosp amwrote in message
news:uK******* *******@TK2MSFT NGP06.phx.gbl.. .
>>I don't want to start a war but why would I choose one over the other?
First and foremost I need to keep in mind marketability of the skill and
the future of the language.

C++ is a dying language. It was an experimental object-oriented
C-based language and has been superseded by Java and C#, which are the
real thing. Even the inventor of C++ did not intend it to last very
long, despite the great popularity that it achieved in the late 1990s.

Huh? Our entire telecommunicati ons industry is written in C and C++ and
C++ is still the way to go for embedded systems.
And a lot of other stuff.

Most of the OLE/COM stuff in Windows and Office is C++.

Lots of Windows apps out there are also build using MFC.

And I would not call C++ experimental. It is used in a lot
of production code.

Of course things has progressed since the mid 1980's. Java
learned from and improved from C++. And C# learned from and
improved from Java.

For a typical business application I will absolutely
recommend Java or C# over C++.

But C++ will live on for many years. Because of the bazillions
of lines of code that exist. And because of special requirements
for hardware access or real time characteristics that Java and C#
can not meet.

Arne

Jun 27 '08 #19

"Arne Vajhøj" <ar**@vajhoej.d kescribió en el mensaje
news:48******** *************** @news.sunsite.d k...
Nick wrote:
Curious. I wouldn't see C# as fundamentally better for writing
Object-oriented code. I see the two languages as essentially the same
but C# has removed the need for explicit memory management and a few
other house keeping issues

More access levels, interfaces and delegates seems
to me to be features that makes good OOP easier.
Just some clarification: In C++ you have interfaces (abstract classes) and
delegates (std::tr1::func tion or boost::function )

Regards

--
Cholo Lennon
Bs.As.
ARG
Jun 27 '08 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
11218
by: William C. White | last post by:
Does anyone know of a way to use PHP /w Authorize.net AIM without using cURL? Our website is hosted on a shared drive and the webhost company doesn't installed additional software (such as cURL) on the server because of that. Our site will have an SSL certificate next week, so I would like to use AIM instead of SIM, however, I don't know how to send data via POST over https and recieve data from the Authorize.net server over an https...
2
5816
by: Albert Ahtenberg | last post by:
Hello, I don't know if it is only me but I was sure that header("Location:url") redirects the browser instantly to URL, or at least stops the execution of the code. But appearantely it continues to execute the code until the browser send his reply to the header instruction. So an exit(); after each redirection won't hurt at all
3
23010
by: James | last post by:
Hi, I have a form with 2 fields. 'A' 'B' The user completes one of the fields and the form is submitted. On the results page I want to run a query, but this will change subject to which field is completed.
0
8476
by: Ollivier Robert | last post by:
Hello, I'm trying to link PHP with Oracle 9.2.0/OCI8 with gcc 3.2.3 on a Solaris9 system. The link succeeds but everytime I try to run php, I get a SEGV from inside the libcnltsh.so library. 354 roberto@ausone:Build/php-4.3.2> ldd /opt/php4/bin/php libsablot.so.0 => /usr/local/lib/libsablot.so.0 libstdc++.so.5 => /usr/local/lib/libstdc++.so.5 libm.so.1 => /usr/lib/libm.so.1
1
8581
by: Richard Galli | last post by:
I want viewers to compare state laws on a single subject. Imagine a three-column table with a drop-down box on the top. A viewer selects a state from the list, and that state's text fills the column below. The viewer can select states from the drop down lists above the other two columns as well. If the viewer selects only one, only one column fills. If the viewer selects two states, two columns fill. Etc. I could, if appropriate, have...
4
18268
by: Albert Ahtenberg | last post by:
Hello, I have two questions. 1. When the user presses the back button and returns to a form he filled the form is reseted. How do I leave there the values he inserted? 2. When the user comes back to a page where he had a submitted POST data the browser keeps telling that the data has expired and asks if repost. How to avoid that? I tried registering all POST and GET vars as SESSION vars but
1
6826
by: inderjit S Gabrie | last post by:
Hi all Here is the scenerio ...is it possibly to do this... i am getting valid course dates output on to a web which i have designed ....all is okay so far , look at the following web url http://www.mis.gla.ac.uk/biquery/training/ but each of the courses held have maximum of 8 people that could be
2
31412
by: Jack | last post by:
Hi All, What is the PHP equivilent of Oracle bind variables in a SQL statement, e.g. select x from y where z=:parameter Which in asp/jsp would be followed by some statements to bind a value to :parameter I dont like the idea of making the SQL statement on the fly without binding parameters as I dont want a highly polluted SQL cache.
3
23575
by: Sandwick | last post by:
I am trying to change the size of a drawing so they are all 3x3. the script below is what i was trying to use to cut it in half ... I get errors. I can display the normal picture but not the results of the picture half the size. The PHP I have installed support 1.62 or higher. And all I would like to do is take and image and make it fit a 3x3. Any suggestions to where I should read or look would be appreciated.
0
8691
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9180
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9038
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8920
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8887
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6536
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4633
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3060
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.