Turamnvia said:
I 'm following various posting in "comp.lang.ada, comp.lang.c++ ,
comp.realtime, comp.software-eng" groups regarding selection of a
programming language of C, C++ or Ada for safety critical real-time
applications. The majority of expert/people recommend Ada for safety
critical real-time applications. I've many years of experience in C/C++ (and
Delphi) but no Ada knowledge.
May I ask if it is too difficult to move from C/C++ to Ada?
What is the best way of learning Ada for a C/C++ programmer?
I had the same problem several years ago.
I was learning Ada from tutorials (
www.adahome.com) and online
articles. They were nice and I could get the ideas quickly, but
they were rather shallow and I just could not find answers to
many questions.
After buying one poor book (just the only I could find in local
bookstores) I decided to search for a good book in online bookstores.
I chose "Ada as a second language" by Norman Cohen and I am very glad
with it. All the questions that bothered me (some for months) were
answered in no time. AFAIR always when I needed to know something
about Ada I could find it in this book (well, one exception:
I could not find any information about preprocessor, but some
Ada programmers claim you don't need preprocessor in Ada).
As the title suggests, the book assumes that the reader is already
a skilled programmer
In the book there are many comparisons to C, C++ and some other
languages. If an Ada feature is similar to something in C or C++,
the book mentions it to help pick the idea. If there are differences,
the book mentions them too, to help avoid potential pitfalls
or correct "bad habits", i.e. ways which are natural in one
language but are not the right way to do sth in Ada. So I think
the book would be as useful for you as it was for me.
Is it difficult to move from C/C++ to Ada? Maybe I can tell
you what you may expect (from my own experience only).
When you write in Ada, it is much, much easier to get bugless
program once you manage to compile it (of course if you make
use of Ada features). However, trying to compile an Ada code may be
sometimes very, very frustrating, when the compiler complains
about sth, you look into the code and cannot find out what a strange
rule you are breaking this time in this particular place.
And in Ada you must write a lot more.
You must declare everything, you must be explicit, you must obey
the rules which sometimes seem stupid.
And you must forget about these handy i++, --j, i+=a etc.