Re: Value of C-C++ over Java in the general cases

From: gooch (gooch001_at_comcast.net)
Date: 02/02/05


Date: 2 Feb 2005 08:21:05 -0800


worzel wrote:
> I can see why C-C++ may have value over Java in certain cases, but
ignoring
> that, is C++ becoming a skill that is increasingly less in demand due
to the
> likes of Java. For new appliactions, is C-C++ difficult to make a
case for
> these days?
>
> I am learning C++ for a diploma course, years after learning Java and
some
> other languages. I guess I am wondering if, once my C study is done,
if I
> will ever need to use it again. I alway used to think of C as being a
bit
> ancient and not really important for mainstream apps given the
alternatives
> these days. (though I am enjoying it and finding it quite natural and

> straightforward so far)
>
> Any input appreciated.

One thing to keep in mind is that although the majority of things you
think of as software applications are on a PC or PDA etc. the large
majority of software written is for embedded systems. There is software
in everything from military equipment to automobiles to kitchen
appliances. For systems that are real time, a response must occur
within a given time frame that is usually very short, Java adds a good
bit of overhead that C or even C++ might not. Think about your car, if
you are in an accident and the airbags need to deploy there is a finite
and very short amount of time in which that event must occur for the
airbag to be of any use. There are many systems like this that are
still programmed in C and sometimes C++. Some embedded systems use C++
regularly but there are some things that need to be avoided in a real
time situation such as multiple inheritance. The V-table overhead gets
to be too large in many cases.

Another consideration is the amount of memory available in these
systems. A C program can generally be written using a great deal less
memory than Java if that is a limiting factor for the target platform.

Also in many instances of embedded systems Java is not even an option
because a VM is not available for the target platform. As a matter of
fact there are still many hardware components that cannot support C++
due to a lack of compiler support so the only options may be C or
assembly. Assembly is rarely used in most situations now though because
most C optimizing compilers can generate code as good or better than
the average programmer. I am probably openning a can of worms with that
statement but in my experience that is the case.

You also state that you are learning C++ but later say that you are
enjoying learning C. Keep in mind that C and C++ are two different
languages. While a large percentage of C programs are valid C++ this is
not always true and it seems to be getting less so as time goes by and
standards change.

If you get in to software engineering it is likely that at some point
in your career you will be working in embedded systems simply due to
the huge number of embedded software applications compared to say
desktop applications. If you do not know C or some other appropriate
language you are likely to have problems in that arena. Many schools
have now dropped C and C++ altogether from their programs. We have
gotten interns and co-ops in who have never written in anything but
Java. We do embedded systems and work very closely with hardware and
the students who have only Java experience have a very difficult time
because the language they know hides much of the details from you so
they do not have an understanding of how the underlying hardware works.



Relevant Pages

  • Re: Programming language popularity
    ... Python is an infix LISP. ... compiles fast and can be tested interactively. ... mainstream languages, ... It can't be used in embedded systems. ...
    (comp.lang.forth)
  • Re: NORAD SGP4/SDP4
    ... languages are published, but Forth isn't one of them? ... aerospace and embedded systems as prime application areas, ... What Marcel is proposing is equivalent to what a diploma mill does. ... If someone who needed SGP4 were to choose Forth because they judged Forth to be the best way to get their application done, ...
    (comp.lang.forth)
  • Re: Spreading the word
    ... they are the players who should be servicing the embedded systems ... other languages now than they were a few years ago, ... English is now the lingua franca of spoken languages. ... Looking at the questions asked on the MSP430 Users group, ...
    (comp.lang.forth)
  • Re: gforth webserver, why isnt forth used all over ecommerce?
    ... That may be your issue, but in this thread, we're not just discussing embedded systems. ... We provide specific web services for some embedded apps, and found it much easier to write the subset of functionality we needed than to figure out how to shoehorn Apache into the resources available to us, and provide an interface to it. ... modules that build those respective languages into the webserver, allowing it to have dynamic content driven by code in those languages. ... I assume that since you used the phrase "web services" that the embedded webserver you looked at wasn't serving just static pages, but something driven by Forth code. ...
    (comp.lang.forth)
  • Re: Basic inheritance question
    ... used 'this' in C++ and Java. ... but in Python it doesn't. ... you meant "in languages that has implicit instance reference available in methods"? ...
    (comp.lang.python)