Re: Why We Use C Than C++...




Dag-Erling Smørgrav schrieb:

> > C++ is not faster or slower than C if you DO the same.
>
> in which case there is no point in chosing C++ over C.

Well, the point is that you can do a lot more with C++ - if you want!

I think kernel programming and embedded programming have a lot in
common. If you come from, let's say PC application programming where
speed and size of your code do not matter because your system has
plenty of it, then you first need to learn to write lean C++ code - and
to avoid some C++ features:
- virtual functions
- exceptions
- rtti
- templates (if your compiler is not able to)
- a.s.o.

Still, there are a lot of C++ features left that are worth using them
in embedded environments. If you understand, what happens "behind the
scenes" of your code, then C++ is very powerful even in embedded
systems.

I personally really like the beauty and robustness of a lean interface
wrapper class that looks very sophisticated from the outside but
actually contains only a lot of inline stuff that gets and sets some
port registers...

For my part, I think that plain C just looks ugly and is so damn old
school... ;o)

.



Relevant Pages

  • Re: Conformance
    ... better than C for certain types of programming, and C is better than C++ ... You think that C will lose because it has far less features than C++. ... currently a superior language. ... libraries, some of which were last updated decades ago. ...
    (comp.std.c)
  • Re: [OT] Re: Teaching new tricks to an old dog (C++ -->Ada)
    ... the evidence I find is that these Ada features meet programmers' ... with templates is almost never used. ... > specification of low-level features in e.g. multiprocessor environments. ... I think portable concurrent or distributed programming is a paradigm ...
    (comp.lang.ada)
  • Re: [OT] Re: Teaching new tricks to an old dog (C++ -->Ada)
    ... the evidence I find is that these Ada features meet programmers' ... with templates is almost never used. ... > specification of low-level features in e.g. multiprocessor environments. ... I think portable concurrent or distributed programming is a paradigm ...
    (comp.lang.cpp)
  • Re: BDD and TDD - What are they for?
    ... To do TDD, you write the test case first, then write code to pass the test. ... > One of the biggest features of TDD is being able ... programming, but not having people keep several functions in mind at any ... forces you to think in clear English* statements that your client could understand. ...
    (comp.lang.ruby)
  • Re: How can I design business cards w/ Micro Office ?
    ... Text added at the end of the last line of text will not be updated (since it is outside of the bookmark) until all of the text in the "active" cell is selected and the bookmark is inserted again. ... Critics of Word often lament a lack of features that are in fact part of the program. ... Word has some limitations -- it doesn't allow you to name the layers in a vector image, for example, and there are some inconveniences in editing the tangents of the control points -- but the results were terrific, and the other students couldn't believe that she had done the entire project in Word, and without having to do any VBA programming. ... optimization problems, and the example spreadsheets that Microsoft supplies with Excel show how to use it to develop a work schedule or to produce a numeric solution of differential equations, just using the basic user interface -- no programming needed. ...
    (microsoft.public.access.tablesdbdesign)