[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT: Why is C so popular?

On Wed, 2003-08-27 at 01:54, Loren M Lang wrote:
> Hash: SHA1
> On Wed, 27 Aug 2003, Alex Malinovich wrote:
> > The recent COBOL discussion has gotten me to thinking. Some languages
> > seem to be very popular in some situations. C is easily the dominant
> > language for most things Linux. So therein lies the question. Why,
> > exactly, is C so popular? Especially in comparison to C++. I can't think
> > of a single reason to use C instead of C++ for most of the coding that I
> > would do. I generally only write user applications. I don't get anywhere
> > near the kernel which is where I'd imagine most of the reason for using
> > C comes in. Yet I see people writing 'modern' GUI applications and using
> > C when I would think C++ would be a much better choice. Is there
> > something that I'm missing? Something that C actually does better than
> > C++ in regards to higher-level functions?
> I can think of a few reasons myself:
> 1) Compatibility
> 2) Speed
> 3) Portability

It's only compatible and portable on similar platforms.  Any C
code that chock full of Linux system calls won't portable to any
other platform unless a (gasp) compatibility layer is written 1st.
Same thing happens with glibc.  There are functions in it which
are non-portable to Solaris, AIX & HP-UX, not to mention non-Unix

Bottom line: I can write user-level C code that is *highly* de-
pendant on a given OS and libc implementation.

COBOL and FORTRAN are probably the 2 most portable languages, since
they are so highly specified, and there are always compiler options
to flag implementation extensions.

Python is *very* portable, but even it has platform-specific
functions.  It's relatively easy, though, to compensate with run-
time conditional execution.

Given that the app programmer is adequately skilled and uses the
proper algorithms, speed is dependent upon the compiler writer's 
skill, nothing more.

Ron Johnson, Jr. ron.l.johnson@cox.net
Jefferson, LA USA

The difference between Rock&Roll and Country Music?
Old Rockers still on tour are pathetic, but old Country singers 
are still great.

Reply to: