473,497 Members | 2,051 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is C suitable for nowadays?

I am a students learning programming, and want to do some software
projects to practice myself.

However, no one will only use one language to make all the tasks
done. And every languages has its strong and relatively weak side. So,
what about C?

Many friends of mine suggest me move to C++ or Java. But I there must
be some places reserved for C (although they say C++ can do all the
jobs of C).

May any one give some general idea, when should I use C and when it
is better to try something else. So I can plan my learning more
efficiently, practicing C more in some fields.
Mar 14 '07 #1
16 3711
Matthew Zhou <zh*********@gmail.comwrote:
May any one give some general idea, when should I use C and when it
is better to try something else. So I can plan my learning more
efficiently, practicing C more in some fields.
I would prefer C over any language in cases where execution time
matters (and where ASM would be overkill or out of question because
of portability issues). Take operating systems for example.. Most
parts of nearly all modern operating systems are written in C.
Flo

Mar 14 '07 #2
Matthew Zhou said:
May any one give some general idea, when should I use C and when it
is better to try something else.
If you have to be persuaded to use C, you probably wouldn't be very good
at it. If your favourite language is a good fit for the problem, use
that. If not, try your second favourite.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Mar 14 '07 #3
Matthew Zhou wrote:
I am a students learning programming, and want to do some software
projects to practice myself.

However, no one will only use one language to make all the tasks
done. And every languages has its strong and relatively weak side. So,
what about C?
C is a general purpose programming language. It has been used in every
conceivable domain of programming. Currently, it's more used in system
programming. It's a preferred language for creating highly portable,
highly efficient programs.

<snip>
May any one give some general idea, when should I use C and when it
is better to try something else. So I can plan my learning more
efficiently, practicing C more in some fields.
That's not possible. To become proficient in a language, you must
devote at least several months of effort learning it's syntax,
semantics, it's implementations and write various programmes with,
preferably of divergent natures. You can't "practise C more in some
fields."

C is a small language. Try giving it a shot. If you at all know the
basics of programming try _The C Programming Language_ by Kernighan
and Ritchie. It's probably the best out there. You'll know soon
whether you like it or not, and if not you can try other languages.

Mar 14 '07 #4
Richard Heathfield <rj*@see.sig.invalidwrites:
Matthew Zhou said:
>May any one give some general idea, when should I use C and when it
is better to try something else.

If you have to be persuaded to use C, you probably wouldn't be very good
at it. If your favourite language is a good fit for the problem, use
that. If not, try your second favourite.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
C is my favourite language. I am just considering learning
others. Maybe in certain cases another language will be make the work
easier. But I for those work which C is the best choices I want to
practice more. And for others, I will try out to use some other
languages. At last I think I can know more or less about the right way
to combine the power of different languages.

Maybe I should change the title to "What is C not suitable for?"
Mar 14 '07 #5
Matthew Zhou <zh*********@gmail.comwrote:
I am a students learning programming, and want to do some software
projects to practice myself.
Okay.

However, no one will only use one language to make all the tasks
done. And every languages has its strong and relatively weak side. So,
what about C?
In my humble opinion, for whatever it's worth, two of C's strong
points are

1) Good support for both low-level and high-level programming.
2) Small physical size of the book "The C Programming Language",
by Kernigan and Ritchie (second edition only!).

#2 means that you can learn C from scratch in a relatively
short time. How short depends on how much you already know.

In my own case, many years ago, it was quick and easy because I
was transitioning from Pascal, a language designed for teaching
(Pascal User Manual and Report, another thin book). I only had to
pay close attention to the more difficult parts of C, such as the
relationship between arrays and pointers. I would not recommend
learning Pascal today.

The comp.lang.c FAQ is a good resource for the parts of the language
that tend to confuse beginners.

Many friends of mine suggest me move to C++ or Java. But I there must
be some places reserved for C (although they say C++ can do all the
jobs of C).
From what little I know about Java, it is high-level only and comes
with a good library. It depends on what you want to do.

Some people say that you can take C++ as your first programming
language, but I am really, really dubious. C++ is a large language
(no thin books) and a lot of it makes absolutely no sense unless
you already know a lot of computer science. I could see taking a
course in C++, if the instructor is really good and knows what he's
doing, but I think a self-taught beginner would quickly suffer from
information overload.
--
pa at panix dot com
Mar 14 '07 #6
Matthew Zhou wrote:
I am a students learning programming, and want to do some software
projects to practice myself.

However, no one will only use one language to make all the tasks
done. And every languages has its strong and relatively weak side. So,
what about C?
C is a relatively small language that is reasonably easy to learn
completly.
It tends to produce code that is "close to the metal", that is each
line of
C compilers to a small number of hardware instructions.

C programs can be written that are space/time efficient.

C is implemented on a very wide variety of platforms. C89 is very
portable.

Many friends of mine suggest me move to C++ or Java. But I there must
be some places reserved for C (although they say C++ can do all the
jobs of C).
Linux is written in C. I believe Microsoft Windows was (and maybe
still is).
C is still widely used in embedded applications.

C++ adds OO, templates, exceptions and a vast library. It is harder
to
become completly familiar with C++ and there are pitfalls for the
beginner.
Sometimes the program is far from the bare metal.

a = b++;

could invoke many user defined functions.

I understand (I am not an expert in this area) some areas of C++
still
vary from compiler to compiler. Some of the more esoteric template
operations are not correctly implemented on all compilers. See the
Boost project.
May any one give some general idea, when should I use C and when it
is better to try something else. So I can plan my learning more
efficiently, practicing C more in some fields.
I like C. It's small, it's simple and it can be made to do some
amazing things.

C++ is usually regarded as more scalable to large projects and gives
you
a choice of paradigms (procedural, OO and generic). The library is
pretty
amazing as well.

Have you taken a look a python?
--
Nick Keighley

Mar 14 '07 #7
pa@see.signature.invalid (Pierre Asselin) writes:
Matthew Zhou <zh*********@gmail.comwrote:
>I am a students learning programming, and want to do some software
projects to practice myself.

Okay.

>However, no one will only use one language to make all the tasks
done. And every languages has its strong and relatively weak side. So,
what about C?

In my humble opinion, for whatever it's worth, two of C's strong
points are

1) Good support for both low-level and high-level programming.
2) Small physical size of the book "The C Programming Language",
by Kernigan and Ritchie (second edition only!).

#2 means that you can learn C from scratch in a relatively
short time. How short depends on how much you already know.

In my own case, many years ago, it was quick and easy because I
was transitioning from Pascal, a language designed for teaching
(Pascal User Manual and Report, another thin book). I only had to
pay close attention to the more difficult parts of C, such as the
relationship between arrays and pointers. I would not recommend
learning Pascal today.

The comp.lang.c FAQ is a good resource for the parts of the language
that tend to confuse beginners.

>Many friends of mine suggest me move to C++ or Java. But I there must
be some places reserved for C (although they say C++ can do all the
jobs of C).

From what little I know about Java, it is high-level only and comes
with a good library. It depends on what you want to do.

Some people say that you can take C++ as your first programming
language, but I am really, really dubious. C++ is a large language
(no thin books) and a lot of it makes absolutely no sense unless
you already know a lot of computer science. I could see taking a
course in C++, if the instructor is really good and knows what he's
doing, but I think a self-taught beginner would quickly suffer from
information overload.
--
pa at panix dot com
Strongly agree with you. Actually I have no programming experience
before. One year ago I began to learn C++, though I did not learnt
much, at least I found that it is too complicated for a beginner like
me. So I gave up and spent the other 6 months on the K&R2. However I
think just learn something is not enough. So I think I need more
practice.

From my own experience, though not from programming, I have the
feeling that if I want to master some knowledge, I must practice. As I
was a new high school student four years ago, due to some needs, I
pushed myself to learn calculus, and I found that by practicing, by
solving problems, I can master it. And even today, I do a better job
than most of my colleague ( they are teaching by professors and I was
taught by myself and a book.By they way, since they are also students
in MATH department just like me, so they are comparable). Now I am
studying programming, so I think the situation should be some how
likely. Though it is a very different subject other than mathematics,
I think there is something remain the same---practice, solve problems.

But I do not know where to get some real world practicing. And also I
have no idea what should I practice more than others. I think I should
practice more for the field what C is good for. Of course, I will
practice more for the part which is harder, such as pointers and
arrays.

Thank you for all your replying, and if you can give me some ideas to
make me go in the right way.

And, thanks if any one point out that the idea of mine above is wrong
for programming and tell me why.
Mar 14 '07 #8
On Mar 14, 4:48 am, Matthew Zhou <zhouyan1...@gmail.comwrote:
However, no one will only use one language to make all the tasks
done. And every languages has its strong and relatively weak side. So,
what about C?
C's strength, IMO, is that it is close to the machine. It is usually a
short step from what you write in C to what the compiler generates by
way of actual machine instructions. This makes C an excellent language
for people with control issues, or for problems in which close control
over the machine is useful. One of the biggies is operating systems
(although at least one excellent, but commercially unsuccessful OS was
written in C++: BeOS). Another is applications that need to be small
and portable: embedded programming is a good field here.

Because C doesn't expand your source code in unexpected ways, there's
usually a pretty direct corralary between what you write, the size of
your binary, and the performance of your application. That doesn't
mean C is faster, or smaller -- that's in the programmer's hands. But
if you intend to write small, efficient code, C doesn't get in your
way.

C is suitable for projects of any size; many people will tell you that
for large applications, or distributed processing environments, C is
the wrong choice. This may be true, but it's not the fault of C: it's
a problem with the way people use C.
In practical or professional terms, C may be the wrong language to
study if you are aiming for those kinds of fields.

Perhaps more significant than the OO features, one difference that
distinguishes C from C++ or Java is the standard libraries that are
part of the language. Java and C++ both come with large, robust, and
(usually) efficient libraries; C does not. For rapid development,
someone familiar with the language and the libraries and starting from
scratch will often get more done more quickly in Java or C++ than in
C. Many C shops will have their own in-house suite of libraries
suitable to the kind of work the location undertakes. Others will have
third party libraries. It's usually not much work to get up to speed
with these libraries, especially for an expert, but it's an extra
step. And if you're starting a major project, you have to make the
call: buy or build your libraries.

As for the OOD: you *can* do anything in C that you can do in C++ or
Java, but it's not necessarily easy, or appropriate. (In fact, it is
arguable whether some of the stuff that's hard or ugly in C ever
really makes much sense in other languages anyway, but a professional
is better off not getting religious about this, and learning how to
read, maintain, and apply OOD in a clean, efficient manner.)

Another area is memory management: C offers ample opportunity for
inexperienced programmers to wreak havoc and destruction, and even
experienced programmers will manage to shoot themselves in the foot
now and then. Maybe I should only speak for myself here, but even
after 10 years of C programming, a careless typo on a late-night
session can create a bug that takes me hours to track down. Java is
substantially better in this regard, at a pretty big performance
penalty. C++, the "everything to everyone" language, is most often
used in ways that diminish this likelihood, but doesn't actually
prevent it.

In short: theoretically, there's rarely a case in which C is a bad
choice. Practically, I've come to the conclusion that it's more about
the culture of the shop than the project at hand. Professionally, I
think it's a poor strategy to declare a "favorite" language. The good
strategy is to maintain your curiosity about new languages,
techniques, technologies, algorithms, design patterns, and to throw
yourself into any new project open to the possibility that the best
tool for the job *might* be one that you're not familiar with.

Remember: languages are tools, and the professional wants to equip
himself or herself with all the right tools.

Mar 14 '07 #9
Matthew Zhou skrev:
I am a students learning programming, and want to do some software
projects to practice myself.

However, no one will only use one language to make all the tasks
done. And every languages has its strong and relatively weak side. So,
what about C?

Many friends of mine suggest me move to C++ or Java. But I there must
be some places reserved for C (although they say C++ can do all the
jobs of C).

May any one give some general idea, when should I use C and when it
is better to try something else. So I can plan my learning more
efficiently, practicing C more in some fields.
You might also want to take a look at Oberon:

http://www.zel.org/oberon/fromctoo.htm (and the links from that article).
August
Mar 14 '07 #10
On Mar 14, 9:56 pm, Matthew Zhou <zhouyan1...@gmail.comwrote:
Strongly agree with you. Actually I have no programming experience
before. One year ago I began to learn C++, though I did not learnt
much, at least I found that it is too complicated for a beginner like
me. So I gave up and spent the other 6 months on the K&R2. However I
think just learn something is not enough. So I think I need more
practice.

if i must *compare* then i am also following the same path. now i
believe, there are some patters in learning programming that keep on
showing themselves.

From my own experience, though not from programming, I have the
feeling that if I want to master some knowledge, I must practice. As I
was a new high school student four years ago, due to some needs, I
pushed myself to learn calculus, and I found that by practicing, by
solving problems, I can master it. And even today, I do a better job
than most of my colleague ( they are teaching by professors and I was
taught by myself and a book.By they way, since they are also students
in MATH department just like me, so they are comparable). Now I am
studying programming, so I think the situation should be some how
likely. Though it is a very different subject other than mathematics,
I think there is something remain the same---practice, solve problems.
good, you have understood the *thing* and i took 1 year of my young-
hood only to confront it.

But I do not know where to get some real world practicing. And also I
have no idea what should I practice more than others.
try these 2 web-sites:
http://savannah.gnu.org
http://sourceforge.net/

just search with keywords "C projects" or "C++ softwares" or whatever.
these web-sites host Open-Source softwares and thousands of self-
taught programmers contribute to them. Linux and nearly all of the GNU
tools developed in the same way. i found them an excellent place to
learn real-life programming and giving something back to the
community, since i took so much :-)

may be you will meet some of the best brains there....

good luck

:-)
NOTE; i am also a newbie but i have analysed this software thing quite
a bit.

Mar 14 '07 #11
"bluejack" <bl******@gmail.comwrites:
On Mar 14, 4:48 am, Matthew Zhou <zhouyan1...@gmail.comwrote:
>However, no one will only use one language to make all the tasks
done. And every languages has its strong and relatively weak side. So,
what about C?

C's strength, IMO, is that it is close to the machine. It is usually a
short step from what you write in C to what the compiler generates by
way of actual machine instructions. This makes C an excellent language
for people with control issues, or for problems in which close control
over the machine is useful. One of the biggies is operating systems
(although at least one excellent, but commercially unsuccessful OS was
written in C++: BeOS). Another is applications that need to be small
and portable: embedded programming is a good field here.

Because C doesn't expand your source code in unexpected ways, there's
usually a pretty direct corralary between what you write, the size of
your binary, and the performance of your application. That doesn't
mean C is faster, or smaller -- that's in the programmer's hands. But
if you intend to write small, efficient code, C doesn't get in your
way.

C is suitable for projects of any size; many people will tell you that
for large applications, or distributed processing environments, C is
the wrong choice. This may be true, but it's not the fault of C: it's
a problem with the way people use C.
In practical or professional terms, C may be the wrong language to
study if you are aiming for those kinds of fields.

Perhaps more significant than the OO features, one difference that
distinguishes C from C++ or Java is the standard libraries that are
part of the language. Java and C++ both come with large, robust, and
(usually) efficient libraries; C does not. For rapid development,
someone familiar with the language and the libraries and starting from
scratch will often get more done more quickly in Java or C++ than in
C. Many C shops will have their own in-house suite of libraries
suitable to the kind of work the location undertakes. Others will have
third party libraries. It's usually not much work to get up to speed
with these libraries, especially for an expert, but it's an extra
step. And if you're starting a major project, you have to make the
call: buy or build your libraries.

As for the OOD: you *can* do anything in C that you can do in C++ or
Java, but it's not necessarily easy, or appropriate. (In fact, it is
arguable whether some of the stuff that's hard or ugly in C ever
really makes much sense in other languages anyway, but a professional
is better off not getting religious about this, and learning how to
read, maintain, and apply OOD in a clean, efficient manner.)

Another area is memory management: C offers ample opportunity for
inexperienced programmers to wreak havoc and destruction, and even
experienced programmers will manage to shoot themselves in the foot
now and then. Maybe I should only speak for myself here, but even
after 10 years of C programming, a careless typo on a late-night
session can create a bug that takes me hours to track down. Java is
substantially better in this regard, at a pretty big performance
penalty. C++, the "everything to everyone" language, is most often
used in ways that diminish this likelihood, but doesn't actually
prevent it.

In short: theoretically, there's rarely a case in which C is a bad
choice. Practically, I've come to the conclusion that it's more about
the culture of the shop than the project at hand. Professionally, I
think it's a poor strategy to declare a "favorite" language. The good
strategy is to maintain your curiosity about new languages,
techniques, technologies, algorithms, design patterns, and to throw
yourself into any new project open to the possibility that the best
tool for the job *might* be one that you're not familiar with.

Remember: languages are tools, and the professional wants to equip
himself or herself with all the right tools.
Thank you very much! :)
Mar 14 '07 #12
"Matthew Zhou" <zh*********@gmail.comwrote in message
Strongly agree with you. Actually I have no programming experience
before. One year ago I began to learn C++, though I did not learnt
much, at least I found that it is too complicated for a beginner like
me. So I gave up and spent the other 6 months on the K&R2. However I
think just learn something is not enough. So I think I need more
practice.
C++ is a poor choice as a first language. A bit like trying to be an
organist without first learning the piano.
>
But I do not know where to get some real world practicing. And also I
have no idea what should I practice more than others. I think I should
practice more for the field what C is good for. Of course, I will
practice more for the part which is harder, such as pointers and
arrays.
You learn by writing real programs. In your situation, a real program is
probably a game. Unfortunately most games cannot be programmed in pure ANSI
C because of the lack of graphics.
I'd start off with a simple character-mapped game using curses or conio or
similar non-standard libararies. A nice first one is "asteroids" - print two
asterisks on each line and scroll the screen down. meanwhile the plyer
controls a ship on the bottom line he can move from left to right, and has
to dodge the stars. Very playable, and very easy.
--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Mar 14 '07 #13
Matthew Zhou wrote:
Richard Heathfield <rj*@see.sig.invalidwrites:
.... snip ...
>>
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.

C is my favourite language. I am just considering learning others.
Maybe in certain cases another language will be make the work
easier. But I for those work which C is the best choices I want to
practice more. And for others, I will try out to use some other
languages. At last I think I can know more or less about the right
way to combine the power of different languages.

Maybe I should change the title to "What is C not suitable for?"
Maybe you should consider learning to snip your quotes. There is
almost never any reason for quoting signatures. This is an
exception.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>

--
Posted via a free Usenet account from http://www.teranews.com

Mar 14 '07 #14
Matthew Zhou said:
Richard Heathfield <rj*@see.sig.invalidwrites:
>Matthew Zhou said:
>>May any one give some general idea, when should I use C and when it
is better to try something else.

If you have to be persuaded to use C, you probably wouldn't be very
good at it. If your favourite language is a good fit for the problem,
use that. If not, try your second favourite.
C is my favourite language.
Then use C except when it hurts to do that.
I am just considering learning others.
Excellent idea. You may discover a new favourite, a language you like
better than C. And if not, at least you may learn some insights which
will inform your C programming. So you can't lose.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Mar 14 '07 #15
"Richard Heathfield" <rj*@see.sig.invalidwrote in message
>
>I am just considering learning others.

Excellent idea. You may discover a new favourite, a language you like
better than C. And if not, at least you may learn some insights which
will inform your C programming. So you can't lose.
Except there are too many languages doing similar things. People mentioned
Oberon and Python, for instance.

I use Perl for trivial scripts to drive my C programs, rather than hardcode
all the directory paths. The other day I had to ask my friend what
"continue" was in Perl. It turns out it is "next". Just a little detail, but
the sort of niggling inefficiency that means that nothing ever gets done in
time.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Mar 14 '07 #16
Malcolm McLean wrote:
"Matthew Zhou" <zh*********@gmail.comwrote in message
But I do not know where to get some real world practicing. And also
I have no idea what should I practice more than others. I think I
should practice more for the field what C is good for. Of course, I
will practice more for the part which is harder, such as pointers
and arrays.
You learn by writing real programs. In your situation, a real program
is probably a game. Unfortunately most games cannot be programmed in
pure ANSI C because of the lack of graphics.
Unless you go with a text-adventure game.


Brian
Mar 14 '07 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

220
18799
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
16
1508
by: SimonYingling | last post by:
I'm a young programmer, but definitly see my self doing this for the rest of my life. I'm 15 and into C++. I was wondering if a good compilier for Windows would be Visual C++ 6.0. I have used Dev...
8
1317
by: Jimbo | last post by:
Hi people, I've been XMLing for a few years, but am now writing a research paper on semantic web stuff. Back in 1999/2000 when the hype for XML was getting going I am sure I heard/read several...
8
4009
by: Hermawih | last post by:
Hello , I want your opinion about this . In order to say it clearly , I think I have to describe it in long sentences . I could consider myself as Intermediate/Advance Access Developer ;...
40
3178
by: vishnu | last post by:
Hi friend, i have a problem in my program what is the use of static function in C lang? plz help me
26
3587
by: puzzlecracker | last post by:
It'd be interesting to compare the learning practices of c++ practitioners. I'll start with mine The C++ Programming Language C++ Primer Effective C++ More Effective C++ Effective STL The...
184
6826
by: jim | last post by:
In a thread about wrapping .Net applications using Thinstall and Xenocode, it was pointed out that there may be better programming languages/IDEs to use for the purpose of creating standalone,...
8
1411
by: K Viltersten | last post by:
I'll be working some XML's soon and i wonder if it's recommended to develop own parsers or if there exist good tools already in DotNet 3.0 or 3.5 under VS.NET 2005. Once the XML has been read,...
13
1741
by: LC's No-Spam Newsreading account | last post by:
I have happily lived for 15 years (our first web server started in 1993) without CSS, but I now decided to learn and experiment with it. My personal preference has always been that the width of...
0
7121
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6993
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6881
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4899
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1411
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.