Re: C vs. C++
- From: Tomás Ó hÉilidhe <toe@xxxxxxxxxxx>
- Date: Mon, 12 Jan 2009 10:12:09 -0800 (PST)
On Jan 12, 6:19 am, beggars.banq...@xxxxxxxxx wrote:
Hi everybody
No trolling here, but I just thought C++ was just object oriented C
but I was recently surprised to learn that C was much more used in
numerical, computational physics. So here's my question : why would C
be better for this kind of programming.
People have made arguments along the lines of using "std::vector" will
result in more bloated, slower code.
When you compare C and C++ and talk about using the C++ Standard
Library, you're not comparing the languages at all but merely
comparing the languages as they tend to be used by a lot of people.
There's nothing in the C++ Standard that says you have to use
std::vector instead of an array.
I, for one, program in C++ but I prefer procedural programming a lot
of the time. Plus I can't remember the last time I used "std::vector",
I use arrays instead.
C++ is C with more features added, and is inherently better. The
downside is that there's less compilers available. Sure, if you use
the C++ Standard Library to do stuff, you /might/ end up with less
efficient code, but you'd be surprised at how well written the C++
Standard Library tends to be.
.
- Follow-Ups:
- Re: C vs. C++
- From: jacob navia
- Re: C vs. C++
- From: CBFalconer
- Re: C vs. C++
- References:
- C vs. C++
- From: beggars . banquet
- C vs. C++
- Prev by Date: Re: Are ++ and -- operators really more efficient
- Next by Date: Re: inet_ntoa not returning correct values
- Previous by thread: Re: C vs. C++
- Next by thread: Re: C vs. C++
- Index(es):
Relevant Pages
|