473,839 Members | 1,509 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 4300
cj
Geesh, I sure got a lot of posts on that one. I'm not sure where I'm
headed but I appreciate the opinions.
cj wrote:
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 #51
cj wrote:
Geesh, I sure got a lot of posts on that one. I'm not sure where I'm
headed but I appreciate the opinions.
lol Is become a C++ forum. Nice thread.

Learn a bit of C++ first, even just the basics you will appreciated C# more. Don't go into depth
just basics.

I knew a bit of C and C++ and currently learning C#. I love C# because it reminds me of C and has
encouraged me to learn C++. Once I am more confident in C# I will begin to dig in C++.

Also note all games are written in C & C++. Well most mainstream commercial games. C++ is not going
to die out within our lifetime.

Those who say is dying are talking rubbish and hype. C++ programmers will die out long before C++.
That is the most likely outcome, and watch salaries soar.
--
Adhal Freeware
http://www.adhal.org
Jun 27 '08 #52
Hendrik Schober wrote:
Arne Vajhøj wrote:
>Hendrik Schober wrote:
>>MC <fo************ **@www.ai.uga.e du.slash.mcwrot e:
[...]
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.

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

IMO these to paragraphs contradict each other. C makes it a lot
easier to write bad, crashing code, than C++ does.

Since C++ support practically all of C then ...

...if C++ wouldn't do so much to make it easy to write
better, safer code, my above statement wouldn't make
sense. Yes. Your point?
Should be obvious.

Arne
Jun 27 '08 #53
Cholo Lennon wrote:
Arne Vajhøj wrote:
>Cholo Lennon wrote:
>>"Arne Vajhøj" <ar**@vajhoej.d kescribió en el mensaje
news:48****** *************** **@news.sunsite .dk...
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 )
C# also has abstract classes and even though abstract classes can
be used instead of interfaces, then interfaces especially when
combined with the only inherit from one class but implement
multiple interfaces rules really guide users towards good
OOP style.

It's a point of view...
>TR1 is fine, but strictly speaking it is not C++ yet (it may
be in 2009 rumors say).

Well, some compilers are distributing partial tr1 implementations and function
is included. BTW boost::function (in which std::tr1::funct ion is based) has many
years and is widely used in modern C++ code / production code.
boost != C++

But on the other side:
- very few are using only ANSI features
- boost is widely used
- the C++ standardization process is let us call it thorough
so maybe it is a more fair comparison to include boost in C++
functionality.

Arne
Jun 27 '08 #54
Daniel James wrote:
In article news:<48******* *************** *@news.sunsite. dk>, Arne
Vajhøj wrote:
>If you teach C++ to 50 students, then you may get 10 great
programmers and 40 that swear never to try and program again.

I'd call that a positive result! Certainly better than getting 50
mediocre programmers.
Seen from a puristic point of view I will agree. But there
is this aspect of the world called money - we need millions
of programmers to code business apps.

Arne
Jun 27 '08 #55
Don't confuse flexibility with lack of safety -- you can have the one
without the other.
How is this confused? My point was C# is not less flexible because it allows
pointer tricks, something that C++ claims as an advantage, safety or lack of
it has nothing to do with the argument. At the end of the day, you have the
best of both worlds in C#.
The single most glaringly obvious example of what I mean is that you
can't do template metaprogramming in C#, but there are others.
And what is that good for? I wouldn't go searching for obscure features to
compare against C#. What I would do is compare common code paths and
implementation. Like it or not, C++ is a dying sport. Holding on to
obscurities will not inject life into it.
more strictly, to provide a plugin replacement for Java
That's new. By the same token C++ was what to C?

It's time to let go of C++. Really, it is. It's done for.

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
-------------------------------------------------------
"Daniel James" <wa*********@no spam.aaisp.orgw rote in message
news:VA******** **********@nosp am.aaisp.org...
In article news:<87******* *************** ************@mi crosoft.com>,
Alvin Bruney [ASP.NET MVP] wrote:
>Why is it more powerful and more flexible? I thought you could write
'unsafe' code in C#.

Don't confuse flexibility with lack of safety -- you can have the one
without the other.

Why is C++ more powerful than C#? Because you can do more things with
it, in more ways. C# is designed to support the "Object Oriented"
paradigm (or, more strictly, to provide a plugin replacement for Java
-- which is an almost religiously 'pure' OO language) but C++ is a
multi-paradigm language -- it can "do OOP", but it can be used to
implement other designs as well.

The single most glaringly obvious example of what I mean is that you
can't do template metaprogramming in C#, but there are others.

Cheers,
Daniel.

Jun 27 '08 #56
What's replacing them for the real-time control portions of the code?
Real time control where? If you are talking at the switch level, that's C
code. Period. I'm not aware of any of the major telecom players who would
touch that code because it is business critical. You could interpret that as
C is superior. I'll interpret it as don't mess with it because it ain't
broke.

Anything north of the switch to include the billing platforms, call routing
on up to client reporting and statistics is not C and not C++.

I once wrote a C# proof of concept for a company just to show that C# could
outperform C for billing and summarization. It worked, hands down, because
C# has a better memory allocation model for memory intensive applications,
which billing and summarization is. However, nobody wanted me to implement
the concept in the real world because the existing application was 'mission
critical'. go figure. C at the real time portion of the code is not there
because it brings any major advantage over what we have today.

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
-------------------------------------------------------
"Michael D. Ober" <obermd.@.alum. mit.edu.nospam. wrote in message
news:ML******** *************** *******@earthli nk.com...
"Alvin Bruney [ASP.NET MVP]" <vapor dan using hot male spam filterwrote
in message news:EF******** *************** ***********@mic rosoft.com...
>>Huh? Our entire telecommunicati ons industry is written in C and C++

Sleight of hand. I worked for a few years in the telecommunicati ons
industry. C and C++ happen to be entrenched there because at the time
that was the dominant languages. As these pieces get re-written,
rest-assured they won't be re-written in these languages because there's
nothing to gain using these technologies in telecommunicati ons. I know,
I've been there.

What's replacing them for the real-time control portions of the code?

Mike.

Jun 27 '08 #57
I agree 100%. I should have said earlier "if these pieces get re-written..."

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
-------------------------------------------------------
"Arne Vajhøj" <ar**@vajhoej.d kwrote in message
news:48******** *************** @news.sunsite.d k...
Alvin Bruney [ASP.NET MVP] wrote:
>>Huh? Our entire telecommunicati ons industry is written in C and C++

Sleight of hand. I worked for a few years in the telecommunicati ons
industry. C and C++ happen to be entrenched there because at the time
that was the dominant languages. As these pieces get re-written,
rest-assured they won't be re-written in these languages because there's
nothing to gain using these technologies in telecommunicati ons. I know,
I've been there.

Applications rarely get rewritten. I would expect most of the existing
C and C++ apps to continue running for a decade or two more. Just
think of how many 30 year old Cobol and PL/I code that are still around.

New apps will likely be written in something else (Java or .NET) unless
there are special reasons not to (hardware interfaces or real time
requirements or requirement for very low memory footprint).

Arne
Jun 27 '08 #58
Alvin Bruney [ASP.NET MVP] wrote:
>What's replacing them for the real-time control portions of the code?
Real time control where? If you are talking at the switch level, that's
C code. Period. I'm not aware of any of the major telecom players who
would touch that code because it is business critical. You could
interpret that as C is superior. I'll interpret it as don't mess with it
because it ain't broke.
Or the real time requirements and/or requirements for low
memory foot print does not lend itself to a C# solution.

[I don't know but I assume that a switch has relative
little memory]

Arne
Jun 27 '08 #59
Then, Alvin, next Windows will be done in C#?
"Alvin Bruney [ASP.NET MVP]" <vapor dan using hot male spam filterwrote in
message news:10******** *************** ***********@mic rosoft.com...
>Don't confuse flexibility with lack of safety -- you can have the one
without the other.

How is this confused? My point was C# is not less flexible because it
allows pointer tricks, something that C++ claims as an advantage, safety
or lack of it has nothing to do with the argument. At the end of the day,
you have the best of both worlds in C#.
>The single most glaringly obvious example of what I mean is that you
can't do template metaprogramming in C#, but there are others.

And what is that good for? I wouldn't go searching for obscure features to
compare against C#. What I would do is compare common code paths and
implementation. Like it or not, C++ is a dying sport. Holding on to
obscurities will not inject life into it.
>more strictly, to provide a plugin replacement for Java
That's new. By the same token C++ was what to C?

It's time to let go of C++. Really, it is. It's done for.

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
-------------------------------------------------------
"Daniel James" <wa*********@no spam.aaisp.orgw rote in message
news:VA******** **********@nosp am.aaisp.org...
>In article news:<87******* *************** ************@mi crosoft.com>,
Alvin Bruney [ASP.NET MVP] wrote:
>>Why is it more powerful and more flexible? I thought you could write
'unsafe' code in C#.

Don't confuse flexibility with lack of safety -- you can have the one
without the other.

Why is C++ more powerful than C#? Because you can do more things with
it, in more ways. C# is designed to support the "Object Oriented"
paradigm (or, more strictly, to provide a plugin replacement for Java
-- which is an almost religiously 'pure' OO language) but C++ is a
multi-paradigm language -- it can "do OOP", but it can be used to
implement other designs as well.

The single most glaringly obvious example of what I mean is that you
can't do template metaprogramming in C#, but there are others.

Cheers,
Daniel.

--
Microsoft Visual C++ MVP
=============== =========
Mi blog sobre programación: http://geeks.ms/blogs/rfog
Momentos Leves: http://momentosleves.blogspot.com/
Cosas mías: http://rfog.blogsome.com/
Libros, ciencia ficción y programación
=============== =============== ==========
Una palabra mal colocada estropea el más bello pensamiento.
-- Francois Marie Arouet.

Jun 27 '08 #60

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

Similar topics

3
11260
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
5860
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
23047
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
8504
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
8617
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
18313
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
6882
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
31455
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
23612
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
9855
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
9697
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10906
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...
1
10647
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
9426
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5682
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4482
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
2
4064
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3132
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.