Still Using C++?

I

Ian Collins

Razii said:
I don't have to write any. I know people who do and they have the same
opinion. A few days ago I saw a video where the guy claimed that C is
far simpler, cleaner and better to write operating system kernels and
device drivers, and C++ brings unnecessary complexity for such
programming tasks. I have to find the link again. In any case, C works
best for lower level programming. C++ is not needed for such
programming tasks. That's not my opinion but opinion of many others
who do write device drivers and kernels.
Well let them post those opinions, mine are based on my day job and I
can tell you device drivers and other "low level" code can exploit the
same benefits C++ brings as any other.

Please stick to posting within your own knowledge and stop regurgitating
second hand opinions you can't back up.
 
I

Ian Collins

Razii said:
Experts don't agree. C++ brings complexity that is not needed. Low
level programming can be done fine and cleanly with C, which is more
popular than C++ anyway.
Speaking from personal experience again?
 
K

Kai-Uwe Bux

Ian said:
Speaking from personal experience again?

What is it that you object to:

(a) not speaking from personal experience, or
(b) not naming the sources you rely on but refering to some
unnamed "experts"?

Objecting to (a) is just silly. It throws out citing references,
encyclopedias, knowledge learned through education, and much more of what
is necessary to have a cultural heritage. Mankind would still be on trees
if all that counts was personal experience.

On the other hand, (b) is a valid objection.


Best

Kai-Uwe Bux
 
I

Ian Collins

Kai-Uwe Bux said:
What is it that you object to:

(a) not speaking from personal experience, or
(b) not naming the sources you rely on but refering to some
unnamed "experts"?

On the other hand, (b) is a valid objection.
b) This fool continues to spout unsubstantiated nonsense.
 
B

Bo Persson

Razii said:
I don't have to write any. I know people who do and they have the
same opinion. A few days ago I saw a video where the guy claimed
that C is far simpler, cleaner and better to write operating system
kernels and device drivers, and C++ brings unnecessary complexity
for such programming tasks. I have to find the link again. In any
case, C works best for lower level programming. C++ is not needed
for such programming tasks. That's not my opinion but opinion of
many others who do write device drivers and kernels.

Interfacing to the OS might be slightly simpler in C, as the API is
often published as a C style interface.

That some guys claim that they don't need C++ features, could also
mean that these hardcode C coders haven't yet realized what they could
use it for. Is that a language problem?



Bo Persson
 
L

LR

Ian said:
b) This fool continues to spout unsubstantiated nonsense.

Sorry, but I don't understand your post.

Are you implying that his claims can be substantiated? If so, which ones?

I think these are the claims.

1) Experts don't agree.
2) C++ brings complexity that is not needed.
3) Low level programming can be done fine and cleanly with C.
4) [C] (which) is more popular than C++ anyway.

I think 1) is clearly true, perhaps almost self-evident, although, the
word "expert" has not been clearly defined.

I suspect that 2) is not testable, although, I think that C++ has some
features that are useful in attacking complexity. I think this is
important because I believe the relevant issue is not usually the
complexity of our tools, but the complexity of the problems we use our
tools to solve and even simple problems can become more tractable with
the application of these features.

I believe Items 3) and 4) are dependent on the definitions of "fine",
"cleanly" and "popular".

Perhaps http://www.parashift.com/c++-faq-lite/big-picture.html might
help in dealing with some of these questions. Particularly
http://www.parashift.com/c++-faq-lite/big-picture.html#faq-6.5.

LR
 
M

Matthias Buelow

LR said:
I suspect that 2) is not testable, although, I think that C++ has some
features that are useful in attacking complexity. I think this is
important because I believe the relevant issue is not usually the
complexity of our tools, but the complexity of the problems we use our
tools to solve and even simple problems can become more tractable with
the application of these features.

This is the most important point: Writing nontrivial programs is hard
enough and one needs all the expressiveness a programming language can
offer. C++ is more expressive than C; that doesn't mean that C isn't a
useful language but it's certainly better for smaller programs than for
large ones; perhaps ideal for the kind of micro-benchmarks that "Razii"
seems to be so fond of.
 
P

Pascal J. Bourguignon

LR said:
Are you implying that his claims can be substantiated? If so, which ones?

I think these are the claims.

1) Experts don't agree.
2) C++ brings complexity that is not needed.
3) Low level programming can be done fine and cleanly with C.
4) [C] (which) is more popular than C++ anyway.

I think 1) is clearly true, perhaps almost self-evident, although, the
word "expert" has not been clearly defined.

I suspect that 2) is not testable, although, I think that C++ has some
features that are useful in attacking complexity.

It's perfectly testable. Just write the same program in C++ and in
another programming language. All I can say here, is that when I
switched to Common Lisp, I got the idea to convert my libraries (not
only C++, but including C++) into lisp, and:

1- only one tenth of the libraries were useful in Lisp,

2- of the tenth I eventually translated in Lisp, then ended having
only one tenth of the size.

Ok, the comparison with Lisp is unfair; you can just test it writting
the same programm in C++ and Eiffel, or even in C++ and Objective-C.

I think this is
important because I believe the relevant issue is not usually the
complexity of our tools, but the complexity of the problems we use our
tools to solve and even simple problems can become more tractable with
the application of these features.

I believe Items 3) and 4) are dependent on the definitions of "fine",
"cleanly" and "popular".

In anycase, popularity can be measured easily enough, and you can come
with reasonable and measurable definitions for "fine" an "cleanly".
 
L

LR

Pascal said:
LR said:
Are you implying that his claims can be substantiated? If so, which ones?

I think these are the claims.

1) Experts don't agree.
2) C++ brings complexity that is not needed.
3) Low level programming can be done fine and cleanly with C.
4) [C] (which) is more popular than C++ anyway.

I think 1) is clearly true, perhaps almost self-evident, although, the
word "expert" has not been clearly defined.

I suspect that 2) is not testable, although, I think that C++ has some
features that are useful in attacking complexity.

It's perfectly testable. Just write the same program in C++ and in
another programming language. All I can say here, is that when I
switched to Common Lisp, I got the idea to convert my libraries (not
only C++, but including C++) into lisp, and:

1- only one tenth of the libraries were useful in Lisp,

Only one tenth? Each language has some idiomatic features. I wonder if
you were maintaining C++'s idiom in your translation? Or maybe you
wouldn't want to?
2- of the tenth I eventually translated in Lisp, then ended having
only one tenth of the size.

I'm not that familiar with Lisp, but I'd be curious to know if you
maintained things like being able to provide a type for an array or
Ok, the comparison with Lisp is unfair;

Perhaps. Perhaps not. Depending on what your criteria for unfair
comparisons is.

you can just test it writting
the same programm in C++ and Eiffel, or even in C++ and Objective-C.


What program would you suggest writing? Hello World? A payroll
application? Ecological or economic system modeling?


How would you, in context, define, "complexity", how to "bring
complexity" and decide if it was not needed?

I suggest that none of that is simple. Perhaps it's not doable. Please
see claim 1).

A quick example. Suppose there is an OO language that doesn't support
the concept of dtors. I want to implement a class similar to
std::ifstream in this language. Does the fact that I have to 'manually'
close the file mean that C++ brings complexity that is not needed? Or
does the absence of dtors actually make the code I, as a user of the
language, have to write more complex?


In anycase, popularity can be measured easily enough,

Provided "popularity" is defined first.
and you can come
with reasonable and measurable definitions for "fine" an "cleanly".

Yes, of course you can. But those definitions would have to be provided
by the person making the claim. And of course, once the terms are
defined, the claims can be challenged. Even the validity and usefulness
of the definition in the context of the claims can be challenged.

In the end, I think the claims made do not serve a particularly useful
purpose. Just my opinion. YMMV.


LR
 
M

Matthias Buelow

Razii said:
Yes, the experts who claim that C is simpler and easier to use for
lower level programming are speaking from personal experience.

You, however, admit to not being an "expert" yourself, and therefore you
are not able to tell real "experts" from fake ones. Therefore, your
assertion that "experts claim ..." has no more substance than random
hearsay.
 
E

Erik Wikström

I don't have to write any. I know people who do and they have the same
opinion. A few days ago I saw a video where the guy claimed that C is
far simpler, cleaner and better to write operating system kernels and
device drivers, and C++ brings unnecessary complexity for such
programming tasks.

Obviously his knowledge of C++ is not as good as it should be. You can
easily write C-style C++ and still benefit from some of the features of
C++, such as the stronger type-checking and function overloading. All
feature in C++ might not be suitable for lowlevel programming, but they
you simply don't use them.
 
G

Gernot Frisch

a few samples written in C#.

The main reason, IMO, is, that Microsoft is trying to force programmers to
C# with the XNA kit, which allows you to make games for the X-Box 360.
This is a very kind offer from Microsoft, but it will make you create code
you can hardly port to any other platform then.

So, I'll stick with C++ as there's no real benefit from any other language
for me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top