When should use C?

  • Follow


Given a platform that supports both C and C++ compiler, what other factors
should determine which programming language to use, C or C++, besides
programmers' fluency level?

In what areas of software developments are you using C instead of C++? What
benefits of using C in these areas?

Thanks in advance!


0
Reply lpoint (4) 1/17/2004 7:25:54 PM

"eas" <lpoint@countrywide.att.net> wrote in message
news:6%fOb.26477$VS4.821720@bgtnsc04-news.ops.worldnet.att.net...
> Given a platform that supports both C and C++ compiler, what other factors
> should determine which programming language to use, C or C++, besides
> programmers' fluency level?
>
> In what areas of software developments are you using C instead of C++?
What
> benefits of using C in these areas?

C simple.  Thor like ugga simple!

Realistically C doesn't have an advantage over C++ other than a simpler
compiler.

Tom


0
Reply tomstdenis3 (162) 1/17/2004 7:38:01 PM


"eas" <lpoint@countrywide.att.net> wrote in message
news:6%fOb.26477$VS4.821720@bgtnsc04-news.ops.worldnet.att.net...
> Given a platform that supports both C and C++ compiler, what other factors
> should determine which programming language to use, C or C++, besides
> programmers' fluency level?
>
> In what areas of software developments are you using C instead of C++?
What
> benefits of using C in these areas?
>
C might give you better portability when writing a library that's intended
to be callable from different languages since most of languages allow
importing of C libraries or calling of C functions.

p.s. you should google for "c over c++" or similar search string, I'm sure
people have discussed this topic many times on the usenet before ;-)

with respect,

Toni Uusitalo








0
Reply tonidot.uusitalo1 (25) 1/17/2004 8:54:36 PM

On Sat, 17 Jan 2004 19:25:54 GMT, "eas" <lpoint@countrywide.att.net>
wrote in comp.lang.c:

> Given a platform that supports both C and C++ compiler, what other factors
> should determine which programming language to use, C or C++, besides
> programmers' fluency level?

Let's pose an analogous question:

Given a tool box that contains both a hammer and a screwdriver, what
other factors should determine which tool to use, hammer or
screwdriver, besides worker's familiarity level?

A professional, and indeed anyone will common sense, will user their
judgement to select the best tool available to him/her to do the job
at hand.

No matter how many more nails than screws one has inserted in one's
career, one should be able to recognize when to use the screwdriver
rather than the hammer.

> In what areas of software developments are you using C instead of C++? What
> benefits of using C in these areas?
> 
> Thanks in advance!

Note by the way that your question is not really topical here.  The
very existence of the C++ language is irrelevant, immaterial, and
off-topic in comp.lang.c.

If you want opinions on comparisons between languages, you want
(marginally) alt.comp.lang.learn.c-c++ or (much better idea) a
language neutral group like comp.programming.

-- 
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
0
Reply jackklein (3932) 1/17/2004 9:02:30 PM

"Jack Klein" <jackklein@spamcop.net> wrote in message
news:bc8j00hpl8b4mnbeduknutb9u93mfbnjur@4ax.com...
> On Sat, 17 Jan 2004 19:25:54 GMT, "eas" <lpoint@countrywide.att.net>
> wrote in comp.lang.c:
>
> > Given a platform that supports both C and C++ compiler, what other
factors
> > should determine which programming language to use, C or C++, besides
> > programmers' fluency level?
>
> Let's pose an analogous question:
>
> Given a tool box that contains both a hammer and a screwdriver, what
> other factors should determine which tool to use, hammer or
> screwdriver, besides worker's familiarity level?

Jack, your analogy seems more akin to "should I use Word or Excel" than to
"should I use C or C++".


0
Reply jarmo (52) 1/17/2004 9:52:50 PM

On Sat, 17 Jan 2004 19:38:01 GMT, in comp.lang.c , "Tom St Denis"
<tomstdenis@iahu.ca> wrote:

>
>"eas" <lpoint@countrywide.att.net> wrote in message
>news:6%fOb.26477$VS4.821720@bgtnsc04-news.ops.worldnet.att.net...
>> Given a platform that supports both C and C++ compiler, what other factors
>> should determine which programming language to use, C or C++, besides
>> programmers' fluency level?
>>
>> In what areas of software developments are you using C instead of C++?
>What
>> benefits of using C in these areas?
>
>C simple.  Thor like ugga simple!
>
>Realistically C doesn't have an advantage over C++ other than a simpler
>compiler.

What? This is worse than your usual nonsense. 


-- 
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html>


----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
0
Reply markmcintyre (4547) 1/17/2004 11:17:08 PM

eas wrote:

> Given a platform that supports both C and C++ compiler, what other factors
> should determine which programming language to use, C or C++, besides
> programmers' fluency level?

It's simple. Always use C.

Well, what answer did you expect in comp.lang.c? No other language, 
including C++, is topical here.

-- 
Richard Heathfield : binary@eton.powernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
0
Reply dontmail (1884) 1/18/2004 4:48:29 AM

eas wrote:
> Given a platform that supports both C and C++ compiler, what other factors
> should determine which programming language to use, C or C++, besides
> programmers' fluency level?

In my opinion, you should use C unless you need an object-oriented 
paradigm and you don't feel like building your own object system on top 
of C. (It is possible to do just that, but it's fairly complex and isn't 
something the maintnence programmer is going to expect. :) )

Of course, if you need to use a specific library that's only callable 
from C++, using C would probably be needlessly complex. However, I think 
most C libraries are trivially callable from C++.

> 
> In what areas of software developments are you using C instead of C++? What
> benefits of using C in these areas?

OS design is mainly done in C and has been since the 1970s-1980s. It's 
done in C instead of assembly because C is portable, so you don't need 
to rewrite as much to make the OS run on a different machine. It's done 
in C instead of C++ because C is simpler and most C++ constructs are 
simply not needed. (Maybe there is a lingering perception of compiled 
C++ programs being slower or less efficient, but that is hardly the case 
anymore.)

-- 
My address is yvoregnevna gjragl-guerr gjb-gubhfnaq guerr ng lnubb qbg pbz
Note: Rot13 and convert spelled-out numbers to numerical equivalents.


0
Reply see84 (117) 1/18/2004 5:18:50 AM

"Richard Heathfield" <dontmail@address.co.uk.invalid> wrote in message
news:bud36s$9p8$1@titan.btinternet.com...
> eas wrote:
>
> > Given a platform that supports both C and C++ compiler, what other
factors
> > should determine which programming language to use, C or C++, besides
> > programmers' fluency level?
>
> It's simple. Always use C.
>
> Well, what answer did you expect in comp.lang.c? No other language,
> including C++, is topical here.

That doesn't mean you have to live in an ivory tower. ;)

--
Peter


0
Reply airia (1802) 1/18/2004 8:58:59 AM

Peter Nilsson wrote:

> "Richard Heathfield" <dontmail@address.co.uk.invalid> wrote in message
> news:bud36s$9p8$1@titan.btinternet.com...
>> eas wrote:
>>
>> > Given a platform that supports both C and C++ compiler, what other
> factors
>> > should determine which programming language to use, C or C++, besides
>> > programmers' fluency level?
>>
>> It's simple. Always use C.
>>
>> Well, what answer did you expect in comp.lang.c? No other language,
>> including C++, is topical here.
> 
> That doesn't mean you have to live in an ivory tower. ;)

Neither does it mean that I do. :-)  I have been known to use off-topic 
languages, but I try to refrain from so doing in /this/ newsgroup.

-- 
Richard Heathfield : binary@eton.powernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
0
Reply invalid29 (585) 1/18/2004 10:30:02 AM

"Jack Klein" <jackklein@spamcop.net> wrote in message
news:bc8j00hpl8b4mnbeduknutb9u93mfbnjur@4ax.com...
> Let's pose an analogous question:
>
> Given a tool box that contains both a hammer and a screwdriver, what
> other factors should determine which tool to use, hammer or
> screwdriver, besides worker's familiarity level?
>
> A professional, and indeed anyone will common sense, will user their
> judgement to select the best tool available to him/her to do the job
> at hand.
>
> No matter how many more nails than screws one has inserted in one's
> career, one should be able to recognize when to use the screwdriver
> rather than the hammer.

Ok, now you've explained that languages are tools best fit for some jobs.
Maybe answering for what job C is best would be in order? I mean, it's a lot
easier to determine what you need with a hammer and a screwdriver than it is
with prog languages and this knowledge does not come by itself.


0
Reply serve (6) 1/18/2004 1:46:11 PM

"eas" <lpoint@countrywide.att.net> wrote:
> Given a platform that supports both C and C++ compiler, what other factors
> should determine which programming language to use, C or C++, besides
> programmers' fluency level?

First of all, programmers' fluency level *MUST* trump all other
considerations.  C++ introduces many new concepts -- the biggest
problem being that the most experienced C++ programmer can completely
baffle an average or inexperienced C++ programmer just in the course
of regular usage.  So if you have any consideration for maintenance,
and your programmers are not all of equivalent level of proficiency in
C++, then there will be a very high hidden maintenance cost (i.e.,
that of your best programmer being the only one who will ever be able
to debug/maintain your project.)

That said, C++ is the obvious logical progression of the C language. 
Its extra features does give it more power, while its
incompatibilities with C don't hamper its functionality.  With MSCV
and gcc becoming extremely compliant, there is no real barrier to
entry anymore.
 
> In what areas of software developments are you using C instead of C++? What
> benefits of using C in these areas?

C's main benefit is that a larger audience of people will understand C
code than C++.  Bstrlib (http://bstring.sf.net) has been written
mostly in C, with a completely seperate C++ wrapper, for example. 
Besides being fairly stable, its very easy for anyone to understand
how it works.  If it were written completely in C++, it would have cut
off half of its audience.

--
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/
0
Reply qed (328) 1/18/2004 8:54:55 PM

In article <news:100l3h44ldpd782@corp.supernews.com>
Serv� Lau <serve@detongiser.com> writes:
>Ok, now [Jack has] explained that languages are tools best fit for some jobs.
>Maybe answering for what job C is best would be in order? I mean, it's a lot
>easier to determine what you need with a hammer and a screwdriver than it is
>with prog languages and this knowledge does not come by itself.

Well, perhaps.  But when do you use a belt sander vs. an orbital
sander vs. a sanding block?  When do you want a rasp and when do
you want a file?  How about a miter saw, a keyhole saw, a jigsaw,
a backsaw, a hacksaw, and a coping saw?  (Or if you're in the
construction biz you probably just use a sawzall for everything,
including filing and sanding. :-) )

Seriously, the differences between "closely related" languages like
C, Pascal, and C++ are small enough to be like the situation with
the various saws.  In many cases, *any* of them will serve.  But
a program best written in Prolog is probably not well-served by
being written in C.

So when are procedure-oriented (even C++ is rather procedure-oriented,
for a language that claims to be object-oriented; compare with
Smalltalk for instance), imperative, normally-compiled,
not-too-far-from-the-machine-instruction-set languages appropriate?
I would say that some indictators include having a problem that
requires large amounts of "compute time" spent in small amounts of
code -- hence "compilation" and "close to the metal" become desirable
-- and you have a fair amount of "human time" to throw into
programming the solution.  Another indictator is when you and your
team are already familiar with the procedure-oriented language you
choose.  If *no* portability is required, however, you might consider
coding even "closer to the metal" (in assembly) under similar
conditions.  This generally greatly increases the amount of "human
time" required, of course.
-- 
In-Real-Life: Chris Torek, Wind River Systems
Salt Lake City, UT, USA (40�39.22'N, 111�50.29'W)  +1 801 277 2603
email: forget about it   http://web.torek.net/torek/index.html
Reading email is like searching for food in the garbage, thanks to spammers.
0
Reply nospam252 (1722) 1/18/2004 9:20:49 PM

12 Replies
34 Views

(page loaded in 5.467 seconds)

Similiar Articles:























6/23/2012 3:02:13 PM


Reply: