3 Nov 2006 19:17
Re: RES: RTEMS with C++
At 10:09 AM 10/11/2006, you wrote: >Angelo, Leon, Chrises (Welch and Johns(Continue reading)> >Thank you for your answers. > >Good to know that I'm wrong about RTEMS and C++, but I have to convince some >other people here too. > >We'll start developing new software for the space area in C. We already have >experience with software for satellites, but using assembly - ok, *I* don't >have; I'm the new guy here. My experience is that using the C++ compiler will cost you virtually nothing in performance if you don't use the expensive C++ features, and provides some benefits such as: - Possibly improved type checking - Inline functions (the efficiency of macros without the headaches) - The ability to overload functions based on the data type (resolved at compile time so it doesn't add overhead) - The ability to declare variables where they are needed rather than at the beginning of the function (some may not like that style, but I do) - The flexibility to gradually move toward object oriented programming if desired (you won't want to go back to straight C) You can avoid the overhead often associated with C++ by skipping things like exceptions, RTTI, STL and I/O streams. You may be able to turn some of them off with compiler switches (RTTI and exceptions) and just not use STL and I/O streams. That being said, consider carefully how much extra work it is worth to save a few bytes and processor cycles up front.
>
>Thank you for your answers.
>
>Good to know that I'm wrong about RTEMS and C++, but I have to convince some
>other people here too.
>
>We'll start developing new software for the space area in C. We already have
>experience with software for satellites, but using assembly - ok, *I* don't
>have; I'm the new guy here.
My experience is that using the C++ compiler will cost you virtually
nothing in performance if you don't use the expensive C++ features,
and provides some benefits such as:
- Possibly improved type checking
- Inline functions (the efficiency of macros without the headaches)
- The ability to overload functions based on the data type (resolved
at compile time so it doesn't add overhead)
- The ability to declare variables where they are needed rather than
at the beginning of the function (some may not like that style, but I do)
- The flexibility to gradually move toward object oriented
programming if desired (you won't want to go back to straight C)
You can avoid the overhead often associated with C++ by skipping
things like exceptions, RTTI, STL and I/O streams. You may be able
to turn some of them off with compiler switches (RTTI and exceptions)
and just not use STL and I/O streams. That being said, consider
carefully how much extra work it is worth to save a few bytes and
processor cycles up front.
RSS Feed