469,366 Members | 2,198 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,366 developers. It's quick & easy.

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 #1
151 3659
Since you're moving from VB I'd say your best bet is C#. C# is very
good for handling the forms while giving the feeling of power like C+
+. Also if you're at a business C++ programmers are getting hard to
find and thus getting expensive.
Jun 27 '08 #2
IMHO if you can choose, then choose C#. Easier to master than C++, and
hides all the pointer management you have in c++. Unless you have some
strong requirement for C++, to me it is C#.

Al.
http://alsql.blogspot.com.
Jun 27 '08 #3
There is no correct answer. It depends on what you want to do. If you are
writing business applications (ie standard data processing) then I imagine
C# will be easier for you to learn if you are coming from VB. I use C++ and
can tell you it is a steep learning curve. In my case, however, I am glad I
put myself through it.

"cj" <cj@nospam.nospamwrote in message
news:uK**************@TK2MSFTNGP06.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 #4
Angus wrote:
In my case, however, I am glad I
put myself through it.
Amen brother :)
Jun 27 '08 #5
"cj" <cj@nospam.nospamwrote in message
news:uK**************@TK2MSFTNGP06.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.
Either might be an excellent choice, depending on what you want your market
to be. C# is strictly .NET, while C++ can be used to develop for a multitude
of environments. OTOH, if you will be developing strictly for .NET, C# would
be the better choice because it's getting support for all the new .NET
features.
Jun 27 '08 #6
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.nospamwrote in message
news:uK**************@TK2MSFTNGP06.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 #7
MC
"cj" <cj@nospam.nospamwrote in message news:uK**************@TK2MSFTNGP06.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.

C# is very similar to Java. C# is almost confined to Windows and Java is portable.

I would say, invest in C# if you want to develop mainly for Windows, or Java if you need complete portability, knowing that the two are very similar.
Jun 27 '08 #8
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.
It depends a bit on the app.

First note that there are actually 3 choices: C#, C++ for .NET and
C++ for native.

But unless the code you want to write is special, then you should
got for C#. It is simply easier to do than C++.

That is also reflected in the job market where even though there are
plenty of C++ jobs, then C# has passed C++ in most markets and
seems headed to pass C++ in the rest of the markets soon.

Arne
Jun 27 '08 #9
clintonG wrote:
Microsoft developed C# specifically for the web.
I don't think so. I believe C# was developed to be a general
language.
JavaScript is the defacto standard for all client-side web development.
For the code part of it at least.
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.
C# and JavaScript both belongs to the C family of languages. But they
are somwhat different languages anyway.

Arne
Jun 27 '08 #10
"MC" <fo**************@www.ai.uga.edu.slash.mcwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
"cj" <cj@nospam.nospamwrote in message
news:uK**************@TK2MSFTNGP06.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 telecommunications industry is written in C and C++ and C++
is still the way to go for embedded systems.
C# is very similar to Java. C# is almost confined to Windows and Java is
portable.

I would say, invest in C# if you want to develop mainly for Windows, or
Java if you need complete portability, knowing that the two are very
similar.
For general business programming, leverage your VB skills and learn VB.Net
(if your skills are VB 6) and C#. Once you learn either VB.net or C# the
other one is relatively easy. Both have their strong and weak points
relative to each other and knowing both will allow you to take advantage of
the better language for the solution you're working on.

Mike.
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 telecommunications 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
inexperienced 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.comha scritto nel messaggio
news:op.uc3f9esf2upo6d@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.nospamwrote in message news:uK**************@TK2MSFTNGP06.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


"cj" <cj@nospam.nospamwrote in message
news:uK**************@TK2MSFTNGP06.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.
Over 80% of the world's financial transactions are still executed COBOL
code. Not bad for a language over 40 years old.

The point is, that companies do not rewrite their systems just because a
new technology or language comes about. Their investment is probably
many millions of dollars in software development. And if it aint broke,
don't fix it.

Although it isn't 'cool' to learn C/C++ nowadays, it will put you in
good stead in the employment market if you know them. In my opinion, it
would be easier to learn C/C++ (native) first and then go on to C#, as
you are really learning what goes on under the C# hood.

C# is a great programming language and has removed many of the sloppy
methods prevalent in C. C++ could have been a lot better than it is, but
unfortunately it was decided to make it compatible with C. With these
languages, you need self-imposed discipline to write them successfully
(although it is possible to write garbage programs in C#).
Jun 27 '08 #17
MC
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.

Intermediate code is not interpreted, it is JIT-compiled. It can also be precompiled if you wish.

There is a reason we want to be shielded from machine internals just a bit -- Not all of the computers of the future are going to be 32-bit Pentiums! That is the rationale for using intermediate code and JIT compilation.
Jun 27 '08 #18
RFOG wrote:
En 21/06/2008 12:37:21, Nick <Ni*******@yahoo.co.ukescribiˇ:
>>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++?

The today only reason for that is the system will not have a C++ compiler.
There are cases (embedded or kernel) where you want very tight control
over the generated code. In which case you will either pick C or
pick C++ and only use a subset of C++ (that likely will look
relative similar to C).

Arne
Jun 27 '08 #19
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 #20
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 #21
Michael D. Ober wrote:
"MC" <fo**************@www.ai.uga.edu.slash.mcwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>"cj" <cj@nospam.nospamwrote in message
news:uK**************@TK2MSFTNGP06.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 telecommunications 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 #22

"Arne Vajh°j" <ar**@vajhoej.dkescribiˇ 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::function or boost::function)

Regards

--
Cholo Lennon
Bs.As.
ARG
Jun 27 '08 #23
Giovanni Dicanio wrote:
"RFOG" <no@mail.comha scritto nel messaggio
news:op.uc3f9esf2upo6d@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?
He. Try SQL Server 2005 Management Studio. It really sucks.
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 #24
En 21/06/2008 22:24:33, Arne Vajh°j <ar**@vajhoej.dkescribiˇ:
RFOG wrote:
>En 21/06/2008 12:37:21, Nick <Ni*******@yahoo.co.ukescribiˇ:
>>>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++?
The today only reason for that is the system will not have a C++
compiler.

There are cases (embedded or kernel) where you want very tight control
over the generated code. In which case you will either pick C or
pick C++ and only use a subset of C++ (that likely will look
relative similar to C).

Arne
Yes, I agree with that. But you suppose a world centered in x86 arch...
For one PC there are a zillion of other devices that run other
microprocessors and some C++ compilers (CodeWarrior for ColdFire, one that
I know, for example) are very very agressive optimizing and restructures
code avoiding in most cases vtables and so, making more compact code than
a person can do.

But, of course, in most cases in embedded scenarios developers only uses
C++ as a "better C". It is, for example, very absurd to instantiate a
polimorphic class with ten levels of abstraction into a high precision
timer interrupt and deallocate in each interrupt finishing.

--
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
========================================
Debemos vivir y trabajar, en cada momento, como si tuviÚsemos la eternidad
ante nosotros.
-- Gabriel Marcel.
Jun 27 '08 #25
Alvin Bruney [ASP.NET MVP] wrote:
such as reference counted smart pointers
There's no such thing. That's why they are smart, they handle it for
you.
That doesn't mean they can't use reference counting as a mechanism, and
if they do, they are reference counted.

--
Rudy Velthuis http://rvelthuis.de

"Once you've written TBicycle, you never forget how."
-- Oliver Townshend in b.p.d.n-t.
Jun 27 '08 #26
MC <fo**************@www.ai.uga.edu.slash.mcwrote:
[...]
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.

Schobi

--
Sp******@gmx.de is never read
I'm HSchober at gmx dot de
"I guess at some point idealism meets human nature and
explodes." Daniel Orner
Jun 27 '08 #27
In article news:<#U**************@TK2MSFTNGP03.phx.gbl>, Hendrik
Schober wrote:
IMO these to paragraphs contradict each other. C makes it a lot
easier to write bad, crashing code, than C++ does.
No, if you really /want/ bad, crashing, code you can write it just as
easily in C++ as in C (it might be a bit harder in C#, but you can
still do it).

OTOH if you want fast, compact, readable code that your programmers can
easily understand and maintain (even if they're not the same
programmers that wrote it) then it is much easier to do that well in
C++ than in C. C# can also give you some of that, but C++ is more
flexible and powerful, has more 3rd-party library support, and runs on
more platforms.

Cheers,
Daniel.

Jun 27 '08 #28
C# can also give you some of that, but C++ is more
flexible and powerful,
Why is it more powerful and more flexible? I thought you could write
'unsafe' code in C#. Doesn't that make it as powerful and as flexible. Or
perhaps unsafe code was removed from C#, if so then I stand corrected.

--

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*********@nospam.aaisp.orgwrote in message
news:VA******************@nospam.aaisp.org...
In article news:<#U**************@TK2MSFTNGP03.phx.gbl>, Hendrik
Schober wrote:
>IMO these to paragraphs contradict each other. C makes it a lot
easier to write bad, crashing code, than C++ does.

No, if you really /want/ bad, crashing, code you can write it just as
easily in C++ as in C (it might be a bit harder in C#, but you can
still do it).

OTOH if you want fast, compact, readable code that your programmers can
easily understand and maintain (even if they're not the same
programmers that wrote it) then it is much easier to do that well in
C++ than in C. C# can also give you some of that, but C++ is more
flexible and powerful, has more 3rd-party library support, and runs on
more platforms.

Cheers,
Daniel.
Jun 27 '08 #29
Huh? Our entire telecommunications industry is written in C and C++

Sleight of hand. I worked for a few years in the telecommunications
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 telecommunications. I know, I've been there.

--

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
-------------------------------------------------------
"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message
news:op***************@petes-computer.local...
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 telecommunications 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 #30
RFOG wrote:
En 21/06/2008 06:39:43, MC <fo**************@www.ai.uga.edu.slash.mc>
escribiˇ:
[...]

And actually it is impssible to buid an OS in Java or in a .NET languge.
What about Singularity and Cosmos ?
>
[...]
Andre
Jun 27 '08 #31
Thanks for the reply. I'll check into it.
"MC" <fo**************@www.ai.uga.edu.slash.mcwrote in message news:OC**************@TK2MSFTNGP04.phx.gbl...
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.
Intermediate code is not interpreted, it is JIT-compiled. It can also be precompiled if you wish.

There is a reason we want to be shielded from machine internals just a bit -- Not all of the computers of the future are going to be 32-bit Pentiums! That is the rationale for using intermediate code and JIT compilation.
Jun 27 '08 #32
Thanks for the reply. I'll check into it.

"Arne Vajh°j" <ar**@vajhoej.dkwrote in message
news:48***********************@news.sunsite.dk...
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 #33
Thanks for the reply. I'll check into it.

"Rudy Velthuis" <ne********@rvelthuis.dewrote in message
news:xn**************@news.microsoft.com...
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 #34
"Alvin Bruney [ASP.NET MVP]" <vapor dan using hot male spam filterwrote in
message news:EF**********************************@microsof t.com...
>Huh? Our entire telecommunications industry is written in C and C++

Sleight of hand. I worked for a few years in the telecommunications
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 telecommunications. I know, I've been
there.
What's replacing them for the real-time control portions of the code?

Mike.
Jun 27 '08 #35

"Andre Kaufmann" <an*********************@t-online.deha scritto nel
messaggio news:eA**************@TK2MSFTNGP04.phx.gbl...
RFOG wrote:
>En 21/06/2008 06:39:43, MC <fo**************@www.ai.uga.edu.slash.mc>
escribiˇ:
[...]

And actually it is impssible to buid an OS in Java or in a .NET languge.

What about Singularity and Cosmos ?
I think that those are *experimental* stuff, not commercial OSes, available
in shops to buy.

The "real" things (Windows, GNU/Linux, Mac OS X OSes) are written in C
and/or C++.

Giovanni
Jun 27 '08 #36
Giovanni Dicanio wrote:
>
"Andre Kaufmann" <an*********************@t-online.deha scritto nel
messaggio news:eA**************@TK2MSFTNGP04.phx.gbl...
RFOG wrote:
>En 21/06/2008 06:39:43, MC
<fo**************@www.ai.uga.edu.slash.mc escribiˇ:
[...]
>
And actually it is impssible to buid an OS in Java or in a .NET
languge.
What about Singularity and Cosmos ?

I think that those are experimental stuff, not commercial OSes,
available in shops to buy.
But it is possible, and it could well be that it is done, also
commercially, one day.

--
Rudy Velthuis http://rvelthuis.de

"The artist is nothing without the gift, but the gift is nothing
without work." -- Emile Zola (1840-1902)
Jun 27 '08 #37
Rudy Velthuis wrote:
Giovanni Dicanio wrote:
>"Andre Kaufmann" <an*********************@t-online.deha scritto nel
messaggio news:eA**************@TK2MSFTNGP04.phx.gbl...
>>RFOG wrote:
En 21/06/2008 06:39:43, MC
<fo**************@www.ai.uga.edu.slash.mc escribiˇ:
>>>[...]

And actually it is impssible to buid an OS in Java or in a .NET
languge.
What about Singularity and Cosmos ?
I think that those are experimental stuff, not commercial OSes,
available in shops to buy.

But it is possible, and it could well be that it is done, also
commercially, one day.
It could. And I am sure it will.

But new mainstream OS's are rather rare. I think the newest
must be Linux from 1991.

It may take some time before the next one shows up.

Arne
Jun 27 '08 #38
Hendrik Schober wrote:
MC <fo**************@www.ai.uga.edu.slash.mcwrote:
>[...]
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 ...

Arne
Jun 27 '08 #39
Cholo Lennon wrote:
"Arne Vajh°j" <ar**@vajhoej.dkescribiˇ 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::function 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.

TR1 is fine, but strictly speaking it is not C++ yet (it may
be in 2009 rumors say).

Arne
Jun 27 '08 #40
Alvin Bruney [ASP.NET MVP] wrote:
>Huh? Our entire telecommunications industry is written in C and C++

Sleight of hand. I worked for a few years in the telecommunications
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 telecommunications. 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 #41
Alvin Bruney [ASP.NET MVP] wrote:
>C# can also give you some of that, but C++ is more
flexible and powerful,
Why is it more powerful and more flexible? I thought you could write
'unsafe' code in C#. Doesn't that make it as powerful and as flexible.
Or perhaps unsafe code was removed from C#, if so then I stand corrected.
It is still there.

But the trouble interacting between unsafe and safe code
makes it not very attractive in my eyes. If I had a need
for that type of code, then I would do it in C++.

Arne
Jun 27 '08 #42
Arne Vajh°j wrote:
Rudy Velthuis wrote:
[...]
It could. And I am sure it will.
But new mainstream OS's are rather rare. I think the newest
must be Linux from 1991.
I would call Linux from 1991 experimental too. At least I remember it to
be a huge experiment to get it up and started ;-).
[...]
Arne
Jun 27 '08 #43
Daniel James <wa*********@nospam.aaisp.orgwrote:
In article news:<#U**************@TK2MSFTNGP03.phx.gbl>, Hendrik
Schober wrote:
>IMO these to paragraphs contradict each other. C makes it a lot
easier to write bad, crashing code, than C++ does.

No, if you really /want/ bad, crashing, code you can write it just as
easily in C++ as in C (it might be a bit harder in C#, but you can
still do it).
I wasn't talking about Macchiavelli.
("C++ tries to guard against Murphy, not Machiavelli.")
[...]
Daniel.
Schobi

--
Sp******@gmx.de is never read
I'm HSchober at gmx dot de
"I guess at some point idealism meets human nature and
explodes." Daniel Orner
Jun 27 '08 #44
In article news:<87**********************************@microso ft.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 #45
In article news:<48***********************@news.sunsite.dk>, Arne
Vajh°j wrote:
But new mainstream OS's are rather rare. I think the newest
must be Linux from 1991.
Symbian OS is newer -- first released (as EPOC32) in 1997.

It is written in C++, albeit using a rather odd dialect (forced upon it
in part by the quality of the GNU cross-compilation toolchain for ARM
at the time it was written, and partly by certain in-house coding
styles at Psion).

Cheers,
Daniel.
Jun 27 '08 #46
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.

Cheers,
Daniel.
Jun 27 '08 #47
In article news:<Lo******************************@earthlink.c om>,
Michael D. Ober wrote:
Huh? Our entire telecommunications industry is written in C and C++
and C++ is still the way to go for embedded systems.
Not quite ... Ericsson's telephone exchange software is written in
Haskell, for example. They claim that it could not be written to run so
efficiently in C or C++.

Cheers,
Daniel.
Jun 27 '08 #48
Arne Vajh°j wrote:
Cholo Lennon wrote:
>"Arne Vajh°j" <ar**@vajhoej.dkescribiˇ 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::function 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::function is based) has many
years and is widely used in modern C++ code / production code.
Regards

--
Cholo Lennon
Bs.As.
ARG

Jun 27 '08 #49
Arne Vajh°j wrote:
Hendrik Schober wrote:
>MC <fo**************@www.ai.uga.edu.slash.mcwrote:
>>[...]
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?
Arne
Schobi
Jun 27 '08 #50

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by William C. White | last post: by
2 posts views Thread by Albert Ahtenberg | last post: by
3 posts views Thread by James | last post: by
reply views Thread by Ollivier Robert | last post: by
1 post views Thread by Richard Galli | last post: by
4 posts views Thread by Albert Ahtenberg | last post: by
1 post views Thread by inderjit S Gabrie | last post: by
2 posts views Thread by Jack | last post: by
3 posts views Thread by Sandwick | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.