C++ wins over C !!

A

Allin Cottrell

Paul said:
See this post, C seems to be loosing here
Are we still programming in C, just b'cause those mortals find it easy
to develop a C compiler than C++ compiler. Considering C++ can do
every thing that C can and Vice Versa is not true. then why C?

This sort of logic will soon have you trashing C++ in favour of C#.
Is that Where You Want to Go, Today?

Allin Cottrell.
 
M

Mike Wahler

Guillaume said:
necessary.

It's not.

Note that Malcolm said 'virtually' (nice pun, btw :)),
not 'literally'.

But I'd generalize his statement a bit, to say instead,
"a high level language with native OO support."

No, one is not absolutely 'necessary', but 'virtually' so,
especially under time constraints.

-Mike
 
I

Ioannis Vranos

Paul said:
I agree with you folks, we can't compare every thing with every thing
else. But in my profession as a programmer, I many times encounter a
word "Portability" and a phrase "C is Portable across platforms". Some
of the projects in which I was involved where C++ is a best fit, my
boss chose C defeating us with that one word. This is just because not
all platforms have a C++ compiler. Then it makes me wonder is it a
right decision and why are we forced to use C just for the sake of
PORTABILITY (modular) where C++ (OOAD) would have been better.


C++ is not only OO. It supports a multi-paradigm language and supports 4
paradigms. Each paradigm is supported well with optimal space and time
efficiencies.


C supports one paradigm, the procedural. And it supports it well with
optimal space and time efficiencies.


I can understand the use of C where the additional benefits of C++ are
not needed.

As others said, C is a tool of many.
 
I

Ioannis Vranos

Augustus said:
Indeed! I will never understand why Mr. Stroustrup apparently decided
that it would be easy for people to move from a procedural paradigm to an
object oriented one but, at the same time, they would have difficulties
adapting to a syntax better adapted to the latter. To me, moving from
syntax to syntax is easy; changing a way thinking, is not.



C++ does not channel people to use one single paradigm. It supports 4
paradigms, each one well, and programmers are encouraged to use the one
or combination of ones that fits a problem well.


Apart from this rant, what makes Mr. Stroustrup a permanent member of the
Computing Hall of Shame is his decision to come up with a (purportedly)
high level language without automatic garbage collection. This is an
unforgivable decision.


GC is a system-specific feature, and C++ is a systems programming
language and portable, so it could not require the presence of a
specific garbage collector from all systems.






Ioannis Vranos

http://www23.brinkster.com/noicys
 
I

Ioannis Vranos

amen!

the memory management complexities one can impose on oneself via deep
object
trees is simply too great a burden for mere mortals to deal with safely
- even
the best c++ programers i know admit spending nearly half of their
debugging
time chasing memory errors. when good gc implemenations can be show to
produce __better__ and __faster__ code than hand coded memory management it
begs the question: "why should management decide to pay for this
sillyness?".


C++/CLI:

http://www23.brinkster.com/noicys/cppcli.htm


http://microsoft.sitestream.com/TechEd/DEV/DEV333_files/Botto_files/DEV333_Sutte.ppt


http://www.accu.org/conference/pres...Relevant_on_Modern_Environments_(keynote).pdf






Ioannis Vranos

http://www23.brinkster.com/noicys
 
B

Benjamin Ketcham

Paul said:
I agree with you folks, we can't compare every thing with every thing
else. But in my profession as a programmer, I many times encounter a
word "Portability" and a phrase "C is Portable across platforms". Some
of the projects in which I was involved where C++ is a best fit, my
boss chose C defeating us with that one word. This is just because not
all platforms have a C++ compiler. Then it makes me wonder is it a
right decision and why are we forced to use C just for the sake of
PORTABILITY (modular) where C++ (OOAD) would have been better.

Hmmm, from my (biased) viewpoint, that sounds great, where do you
find a boss who thinks like that? Usually, it's been me (as a
non-boss) who has felt that there are hidden "synergistic"
advantages (future-looking) to using C over C++ (in *some*
instances), while the boss/corporate-thinker types have insisted
on using C++, not always in problem domains where there were
obvious advantages to that (again IMO).

The fact of the matter is that, with discipline, one can use OO
methodologies with C, and often one should. C++ provides more
out-of-box support for that, obviously; but conversely, it is
sadly all too possible to program in non-OO (or otherwise
braindead) ways, using C++ or any other "trendy" language.
I think managers like C++ because of the *perception* that it
can somehow "force" better programming practices, but although
it can perhaps do so in some of the "small" ways, it's just as
encumbent upon the individual programmer to enforce good practices
on him/herself, or else the "big picture" ends up just as much of
a scrambled, bug-prone mess as it can with C. The tired old quip
rears its head again: one can write crap code in any language.

The reality is that C (meaning, C89/90) *is* much more portable than
almost any other language. The fact that it is both easy and (perhaps
more importantly) commercially compelling to write a C compiler for
every new platform, from the smallest to the largest, is IMO not
something to overlook. Sure, if you *know* your product is only
going to be deployed on a single architecture, or a narrow range
of architectures (e.g., a big GUI app intended for desktops, with
no danger of being ported to Palm Pilots or embedded nanobots based
on (what else) the 8051 core), then the equation tilts one way.

My opinion has always been (well, or has become) that *if* it can sanely
be written in C, then it should be: I view it as a form of "strength
reduction", like refactoring an old-school multi-chip 74-series
logic design to use fewer different chip numbers from the family,
or more-common ones.
I view C++ and other such languages more like specialized libraries: they
are great and powerful if they address the need at hand; but if you
can get by equally well without them, then it's better to not
introduce the sensitive dependence on a moving target that may not
support all your future directions and platform choices. People keep
claiming that C is a dying language, but here's my prediction: in 100
years, C++ will be long-gone, replaced by shiny new languages that we
can hardly imagine at this point. But C (and the music of the Beatles)
will still be around. In fact, I'll bet a virtual beer on that (I hope
my offspring come to share my love of C...).

If you are required to use C and you'd rather be using C++, and the
*only* excuse "they" have for forcing the use of C is "portability",
then perhaps something like cfront might be of interest (if only for
a rhetorical point when making your case to the brass...).

--Benjamin
 
A

Alan Balmer

I agree with you folks, we can't compare every thing with every thing
else. But in my profession as a programmer, I many times encounter a
word "Portability" and a phrase "C is Portable across platforms". Some
of the projects in which I was involved where C++ is a best fit, my
boss chose C defeating us with that one word. This is just because not
all platforms have a C++ compiler. Then it makes me wonder is it a
right decision and why are we forced to use C just for the sake of
PORTABILITY (modular) where C++ (OOAD) would have been better.
"Just" for the sake of portability? If portability is required, and a
C++ version is not portable to the required platforms, then C++ is
clearly not better. If C is the only language portable to the required
platforms, then your boss is right - it's not just the right
decision, but the only possible decision.

Or did you mean something else?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top