[ros-kernel] C++

Mike Nordell tamlin at algonet.se
Thu Mar 11 08:57:14 CET 2004


James Marjie wrote:

> Mike Nordell wrote:
[snip]
> >That said, I'm also not against letting
> >people use what they feel more comfortable with, and produces best
> >(maintainable) result with.

[snipped .sig, and list footer - people, please stop quoting that]

>     Not to be a complete dick ,but come on. If I am more comfortable
> writing my stuff in assembler, then C should I be allowed to do so?

It seems I missed to communicate the connection I was trying to make between
C and C++ as the connection between a T-Ford and a Ferrari. It seems I also
missed to communicate the "maintainable" part with intended weight.

But to answer your question; in general no, but in some areas, yes. There
are a few areas where assembler is appropriate. If you feel more comfortable
with assembler than with C, those few areas would be appropriate.

It's also the (by me unspoken, but I was hoping it to be obvious) overall
picture that the code is to be as portable as possible (between CPU
architectures, but IMO preferrably also between compilers). Using assembler
is a platform dead-end, making such code work on a single CPU architecture,
and sometimes even using one single translator, why it is only suitable for
a very few areas. I believed this to be so obvious it shouldn't have to be
stated, especially since the subject is "C++".

Vizzinis point about by maximizing the number of people that can read,
write, understand and (therefore) maintain the code is key.  Judging by
history, in a decade:
- both C and C++ will still be alive.
- a smaller percentage of developers will know assembler - any language or
dialect.
- a larger percentage of developers will know C++.
- some CPU's will have disappeared from the market, making code written
specifically for them (assembler) basically both useless and worthless at
that time.

Should that prediction turn out to be true, then I think drivers should be
allowed to be implemented in the subset of C++ suitable for such a task.

/Mike



More information about the Ros-kernel mailing list