473,378 Members | 1,492 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

When should use C?

eas
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!
Nov 14 '05 #1
12 1659

"eas" <lp****@countrywide.att.net> wrote in message
news:6%********************@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
Nov 14 '05 #2

"eas" <lp****@countrywide.att.net> wrote in message
news:6%********************@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


Nov 14 '05 #3
On Sat, 17 Jan 2004 19:25:54 GMT, "eas" <lp****@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/~a...FAQ-acllc.html
Nov 14 '05 #4
"Jack Klein" <ja*******@spamcop.net> wrote in message
news:bc********************************@4ax.com...
On Sat, 17 Jan 2004 19:25:54 GMT, "eas" <lp****@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++".
Nov 14 '05 #5
On Sat, 17 Jan 2004 19:38:01 GMT, in comp.lang.c , "Tom St Denis"
<to********@iahu.ca> wrote:

"eas" <lp****@countrywide.att.net> wrote in message
news:6%********************@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 =---
Nov 14 '05 #6
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 : bi****@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
Nov 14 '05 #7
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.
Nov 14 '05 #8
"Richard Heathfield" <do******@address.co.uk.invalid> wrote in message
news:bu**********@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
Nov 14 '05 #9
Peter Nilsson wrote:
"Richard Heathfield" <do******@address.co.uk.invalid> wrote in message
news:bu**********@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 : bi****@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
Nov 14 '05 #10
"Jack Klein" <ja*******@spamcop.net> wrote in message
news:bc********************************@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.
Nov 14 '05 #11
"eas" <lp****@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/
Nov 14 '05 #12
In article <news:10*************@corp.supernews.com>
Servé Lau <se***@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.
Nov 14 '05 #13

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

Similar topics

4
by: Nuno | last post by:
Is there any SQL Error? Or I have to use Select case in VB code to control SQL instead. Thank you for any ans. Nuno
13
by: elad | last post by:
Hi The Menu doesn't work properly when I have 2 frame and the Menu popup frame=document target frame, when I choose item in the menu the doc opened and the menu get stuck. Here is the code...
24
by: Steven T. Hatton | last post by:
In the following code, at what point is S::c fully defined? #include <iostream> using std::cout; using std::endl; using std::ostream; class C { int _v;
7
by: sql-db2-dba | last post by:
Does DB2 just fudge it when it is an empty table? Is there a "formula" for average row size when you have variable length records. Or you really have to know what your application is packing into...
7
by: Nicolae Fieraru | last post by:
Hi All, I am trying to change the rowsource of a combobox when I click on it. I played with many events, associated with the form and the combobox, but still haven't figured out what is the way...
4
by: Peter Row | last post by:
Hi, I have created a UserControl which is subsequently hosted on a standard form. My control has a TabControl on it but it has no TabPages configured. At runtime I create X pages and put a...
5
by: AAguiar | last post by:
I have an asp.net project where the code behind the aspx page calls a c# class which makes calls to a managed static C++ class. The C# class works fine when the asp net worker process starts, when...
8
by: Galina | last post by:
Hello I have 6 dependent list boxes on my ASP page:  Faculty;  Lecturer;  Course;  Course occurrence;  Group;  Week commencing date. When faculty is selected, lists of lecturers and...
44
by: Smokey Grindle | last post by:
I have a list box on my form, but I need to databind it to a data table that is a private member of the form's class... so I basically have Public Class MyForm priate m_MyTable as new datatable...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.