how relevant is C today?

J

John Salerno

Because of my 'novice-ness' in programming, I had always thought that C
was replaced by C++ and wasn't really used anymore today. I know that's
not the case at all now, but I'm still curious how much C is used
anymore in programming today, and what purpose it serves. Is it used for
actual application programming, or is its use more for something like
extending Python? Would it help for a newbie to learn C for any reason?
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

John said:
Because of my 'novice-ness' in programming, I had always thought that C
was replaced by C++ and wasn't really used anymore today. I know that's
not the case at all now, but I'm still curious how much C is used
anymore in programming today, and what purpose it serves. Is it used for
actual application programming, or is its use more for something like
extending Python? Would it help for a newbie to learn C for any reason?

My impression is that C++ hasn't managed to replace C, and that it isn't
used that much for new projects; of course, there is tons of existing
C++ code.

I think John Ousterhout's distinction of System programming vs.
Scripting languages isn't that bad, after all. C is used heavily
for System programming, and will not be replaced there for a foreseeable
future: operating systems, programming languages, web servers, database
servers, etc. OTOH, application programming is done in Java, Python,
C#, Ruby, ... C++ is used both for system programming and applications.

As for *learning* the languages: never learn a language without a
specific inducement. If you know you are going to write a Python
extension, an Apache module, or a Linux kernel module in the
near future, start learning C today. If you don't know what you
want to use it for, learning it might be a waste of time, as
you won't know what to look for if you don't have a specific project
in mind.

Regards,
Martin
 
M

Mirco Wahab

Hi John
Because of my 'novice-ness' in programming, I had always thought that C
was replaced by C++ and wasn't really used anymore today. I know that's
not the case at all now, but I'm still curious how much C is used
anymore in programming today, and what purpose it serves.

There is a whole spectrum of 'mixing' between features of
C ans C++ used today in the industry and thats o.k. if it
just works. You cal write plain C in a C++ environment,
mix some C++ features to your otherwise plain C and
so on - as you like.

You can't compare C/C++'industrial use w/Python's in todays
Software production - there is no match.

A recent 580+ people survey (O'Reilly) brought up the following:
http://www.onlamp.com/pub/a/onlamp/2005/12/02/onlamp_survey_results.html?page=2

"The Dice" (find tech jobs) has offerings
(last 7 days, U.S. + unrestricted) for:
*SQL 14,322
C/C++ 11,968
Java 10,143
...
Perl 3,332
PHP 730
*Python* 503
Fortran 119
Ruby 108
open*gl 66

That is what the industry looks for.
You understand the ratios?
... Is it used for
actual application programming, or is its use more for something like
extending Python? Would it help for a newbie to learn C for any reason?

It is used for almost everything, from
- Programming the Python Language itself,
- Programming the Perl Language itself,
- Programming the PHP language and others,
to
- complete Applications, as you said.

It *is* somehow 'wordy' (especially C), but
don't underestimate its power in the hands
of a master ;-)

There is a huge amount of highly
functional libraries for almost
everything too.

Regards,

M.
 
D

Daniel Nogradi

"The Dice" (find tech jobs) has offerings
(last 7 days, U.S. + unrestricted) for:
*SQL 14,322
C/C++ 11,968
Java 10,143
...
Perl 3,332
PHP 730
*Python* 503
Fortran 119
Ruby 108
open*gl 66

Can anyone shed some light on the secret of Java? How is it that they
are so high on this list?
 
J

Jorge Godoy

Daniel Nogradi said:
Can anyone shed some light on the secret of Java? How is it that they
are so high on this list?

Marketing? Hype? :)

--
Jorge Godoy <[email protected]>

"Quidquid latine dictum sit, altum sonatur."
- Qualquer coisa dita em latim soa profundo.
- Anything said in Latin sounds smart.
 
J

Jorge Godoy

Mirco Wahab said:
"The Dice" (find tech jobs) has offerings
(last 7 days, U.S. + unrestricted) for:
*SQL 14,322
C/C++ 11,968
Java 10,143
...
Perl 3,332
PHP 730
*Python* 503
Fortran 119
Ruby 108
open*gl 66

That is what the industry looks for.
You understand the ratios?

Of course! You need 23 C/C++ people to do the job of one Pythoneer ;-)

--
Jorge Godoy <[email protected]>

"Quidquid latine dictum sit, altum sonatur."
- Qualquer coisa dita em latim soa profundo.
- Anything said in Latin sounds smart.
 
S

Sybren Stuvel

John Salerno enlightened us with:
Because of my 'novice-ness' in programming, I had always thought that C
was replaced by C++ and wasn't really used anymore today.

C is used in many, many programs. The Linux kernel is perhaps one of
the best known. IIRC Apache is written inC too. The default Python
implementation too, of course.

Sybren
 
S

Sandra-24

C/C++ is used for a lot of things and not going anywhere.

I recommend you learn it not because you should create applications in
C or C++, but because it will increase your skills and value as a
programmer. I recommend you even spend a few weeks with an assembly
language, for the same reason.

However, when it comes to beginning new things with an eye for getting
the job done, C/C++ (or Java for that matter...) is usually a bad idea.
That having been said, there are always exceptions to the rule and
you'll learn better how to call things as you advance your skills as a
programmer.

There are also sometimes parts of your application that just cannot be
optimized any more in a high level language, and might benefit from
being converted to C or C++. But do yourself a favor and only do such
things after taking careful measurements and exhausting other options.
Many time consuming algorithms don't gain a noticable speed improvement
in lower level languages.

-Sandra
 
J

John Zenger

Martin said:
As for *learning* the languages: never learn a language without a
specific inducement. If you know you are going to write a Python
extension, an Apache module, or a Linux kernel module in the
near future, start learning C today. If you don't know what you
want to use it for, learning it might be a waste of time, as
you won't know what to look for if you don't have a specific project
in mind.

Your message makes me sad, as if I heard someone say "never read a book
without a specific inducement; if you know someone is going to ask you
about the book, start reading it today, but if you don't know what you
are going to use the book for, reading it will be a waste of time."

Programming languages are intellectual achievements and you can learn a
lot every time you study a new one (provided it is different enough from
the ones you already know.) Even if you don't have an immediate project
in mind, learning a new programming language can mean learning a new
style of programming, or at least a new way of looking at computer
science. That is worthwhile even if you get no immediate use from the
new language.
 
G

Grant Edwards

As for *learning* the languages: never learn a language
without a specific inducement.

That's silly. Learning (weather a computer language, a natural
language, or anything else) is never a bad thing. The more
languages you know, the more you understand about languages in
general. Learning languages is like any other skill: the more
you do it, the better you get at it.
If you know you are going to write a Python extension, an
Apache module, or a Linux kernel module in the near future,
start learning C today. If you don't know what you want to use
it for, learning it might be a waste of time, as you won't
know what to look for if you don't have a specific project in
mind.

Geeze, when I think of all the things I've "wasted my time"
learning.
 
C

Carl Friedrich Bolz

Grant said:
That's silly. Learning (weather a computer language, a natural
language, or anything else) is never a bad thing. The more
languages you know, the more you understand about languages in
general. Learning languages is like any other skill: the more
you do it, the better you get at it.

I don't exactly see why this is a contradiction. "Specific inducement"
does not necessarily mean that you have to have an external cause to
learn a language -- be it your job or whatever. Nobody hinders you from
creating that inducement yourself. It's just very hard to properly learn
a language without having an idea what to do with it (in fact, I have
seen people interested to learn programming utterly fail in doing so
because they had absolutely no clue what to program).
Geeze, when I think of all the things I've "wasted my time"
learning.

Well, how many languages have you learnt without writing anything in them?

Cheers,

Carl Friedrich Bolz
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

John said:
Your message makes me sad, as if I heard someone say "never read a book
without a specific inducement; if you know someone is going to ask you
about the book, start reading it today, but if you don't know what you
are going to use the book for, reading it will be a waste of time."

Ah. I wasn't actually talking about reading a C book. I was talking
about learning the programming language. You should, of course, read
a book about C - but I don't believe you can learn to program C by
just reading a book (or any other programming language, for that
matter). You will read the book, and might be able to *read* C programs
afterwards. To be able to write them, you need practice, and, for
that, you need a specific inducement.

Regards,
Martin
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

Grant said:
That's silly. Learning (weather a computer language, a natural
language, or anything else) is never a bad thing. The more
languages you know, the more you understand about languages in
general. Learning languages is like any other skill: the more
you do it, the better you get at it.

Learning a language (whether a natural or a programming language)
needs practice, both for reading and for writing. Natural languages
are often taught under the guidance of a teacher, to make sure
the student gets the practice she needs.

In my experience, you won't learn a programming language
effectively if you don't get practice (in particular, in writing
programs - although reading them might even require *more*
practice, especially for C). And, people often don't practice
enough (either a natural language, nor a programming language)
if they don't have a specific goal in mind what they want to
learn the language for.
Geeze, when I think of all the things I've "wasted my time"
learning.

That's everybody's choice, of course. If you enjoy programming
languages on their own merits, you won't need further motivation.
However, then you don't post to a newsgroup "should I learn
this language", but you just go ahead and do it.

Regards,
Martin
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

Carl said:
I don't exactly see why this is a contradiction. "Specific inducement"
does not necessarily mean that you have to have an external cause to
learn a language -- be it your job or whatever. Nobody hinders you from
creating that inducement yourself. It's just very hard to properly learn
a language without having an idea what to do with it (in fact, I have
seen people interested to learn programming utterly fail in doing so
because they had absolutely no clue what to program).

This is my experience also.

Regards,
Martin
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

Carl said:
I don't exactly see why this is a contradiction. "Specific inducement"
does not necessarily mean that you have to have an external cause to
learn a language -- be it your job or whatever. Nobody hinders you from
creating that inducement yourself. It's just very hard to properly learn
a language without having an idea what to do with it (in fact, I have
seen people interested to learn programming utterly fail in doing so
because they had absolutely no clue what to program).

This is my experience also.

Regards,
Martin
 
S

Scott David Daniels

Sandra-24 said:
C/C++ is used for a lot of things and not going anywhere.

I recommend you learn it not because you should create applications in
C or C++, but because it will increase your skills and value as a
programmer. I recommend you even spend a few weeks with an assembly
language, for the same reason.

"Back in the day" we wrote _way_ too much in assembly language, often
simply because there was no other language capable of doing, for example
an assembly language. C has replaced assembly language for most of an
operating system. In the SIGPLAN conference where C was first publicly
introduced, a later talk began with the speaker, who was talking about
his new portable macro system, said, "Everyone at this conference
should find out about 'C', it makes this work obsolete."

What C has as virtues are simple clear semantics, an obvious map to the
machine code representing each language feature, a language simple
enough to "read through to the machine" in the sense that you can read
a C program and not have a little section in the pure language take
a surprising amount of time ("no surprise delays"), and you can express
most of the bag of tricks assembly language programmers used at the time
to write their operating systems, compilers, .... One other immense
difference in C was that the language had very few "magic" functions
(setjmp and longjmp are the obvious bits-o-magic). For the most part,
the entire library could be written in the language "C" itself.
Further, there was a clear mapping between assembly language and C;
you could write a function in assembly that could be called from C,
and there was so little "necessary infrastructure" that you could
also write a function in C that could be called from assembly.

C can express neither exceptions nor coroutines (nor their fancy cousin,
continuations), which could be and were expressed in assembly. Nor does
C provide memory management. A few library functions give you some
primitives to roll your own, but garbage collection is out of the
question (despite Hans Boehm), because the language does not carry
enough infrastructure to find type information through introspection.

In exchange for these losses, the C programmer can write code that
executes in response to an external signal and yet does not create a
total hash of the internal memory structures. That kind of thing is
important in an OS, and something few languages (including C++) can do.
If you intend to study C++, study C first (it is easier to grasp), as
almost everything you learn in C can be used in C++. C++ is a "big"
language, while C is a "small" one; it will take much longer to "know"
C++ even though C++ started with the goal of being "C with objects."
If you are interested in languages, reading "the Design and Evolution
of C++" is a great base; it explains how C++ got the way it is from its
initial design goals.

--Scott David Daniels
(e-mail address removed)
 
J

John Salerno

Martin said:
As for *learning* the languages: never learn a language without a
specific inducement. If you know you are going to write a Python
extension, an Apache module, or a Linux kernel module in the
near future, start learning C today. If you don't know what you
want to use it for, learning it might be a waste of time, as
you won't know what to look for if you don't have a specific project
in mind.

I don't know if I completely agree with you, but I definitely understand
your point. I started learning C# for no reason, just because I'm
interested in programming. A year later, I never really used it much
because I didn't have a reason to. Now I've moved on to Python
(actually, I was going to start learning Python a while ago, but I was
afraid it would interfere with learning C#). So here I am now thinking
about C, but I also don't want it to interfere with Python.

I like Python and want to stick with it, which is why I'm desperately
looking fore exercises and puzzles so I can use it. It's just that I
obessively like to learn new things, and I keep moving on to new
subjects once I've 'learned' something well enough. I know Python well
enough, but for no real reason, so I think I'm going to stick with it
and keep using it, because it's fun.
 
M

Mirco Wahab

Hi John
It's just that I obessively like to learn new things,
and I keep moving on to new subjects once I've 'learned'
something well enough.

Ha!

So learn 'Perl' then - you'll never ever
get over this point ... ;-))

And if you, against all odds, think you
master it now - zongggg, a new Perl Version
with completely new syntax shows up ...
I know Python well enough, but for no real reason, so I think I'm
going to stick with it and keep using it, because it's fun.

At which level in the 'python challenge' did
you get stuck - and why?

Regards

M.
 

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

Forum statistics

Threads
474,292
Messages
2,571,494
Members
48,184
Latest member
XRUBennie9

Latest Threads

Top