473,289 Members | 1,947 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,289 software developers and data experts.

why still use C?

no this is no trollposting and please don't get it wrong but iam very
curious why people still use C instead of other languages especially C++.

i heard people say C++ is slower than C but i can't believe that. in pieces
of the application where speed really matters you can still use "normal"
functions or even static methods which is basically the same.

in C there arent the simplest things present like constants, each struct and
enum have to be prefixed with "struct" and "enum". iam sure there is much
more.

i don't get it why people program in C and faking OOP features(function
pointers in structs..) instead of using C++. are they simply masochists or
is there a logical reason?

i feel C has to benefit against C++.

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk
--
comp.lang.c.moderated - moderation address: cl**@plethora.net
Nov 13 '05 #1
687 22642
In article <cl****************@plethora.net>, cody wrote:
no this is no trollposting and please don't get it wrong but iam very
curious why people still use C instead of other languages especially C++.

i heard people say C++ is slower than C but i can't believe that. [-]
It isn't.

[-] i don't get it why people program in C and faking OOP features(function
pointers in structs..) instead of using C++. are they simply masochists or
is there a logical reason?

[-]
C++ compilers used to pose problems like being more or less standards
compliant and in all honesty they often still do plus to generate optimal
machine code the compiler / linker combo needs to work together much more
closely than it is the case with C.

Well, and developers used to and use to pose problems, too as just take
some seasoned C developers and be assured over their dead body they'll
admit not to be able to output high quality C++ code almost straight
away and so it must be the language.

In short C++ isn't slower for sure as both, a C as well as a C++ compiler
is going to generate machine code. It's just no compiler can do the
thinking for you (yet) and I haven't met all too many C++ developers
yet who really do know the language.

Mind I'm far from saying I'd really do. Far from it, though I'm not
having problems admiting that while, after being more then 10 years in
the job, I dare say there's a fair share of developers, often the local
"star developers", who prefer arguing to listening.

In general language wars are pointless anyway, though as the end user
couldn't care less about "your" problems but he or she wants to see
a working result, so the real question is are you able to deliver or
are you not ?

Cheers,
Juergen

--
\ Real name : Juergen Heinzl \ no flames /
\ EMail Private : ju*****@manannan.org \ send money instead /
Nov 13 '05 #2
Hi cody,
no this is no trollposting and please don't get it wrong but iam very
curious why people still use C instead of other languages especially C++.
I can't answer for people in general of course, but as a moderately able
C programmer with a thorough dislike of C++ I can try to explain what my
motives are.
i heard people say C++ is slower than C but i can't believe that. in pieces
of the application where speed really matters you can still use "normal"
functions or even static methods which is basically the same.
A few years ago I did some timing and (counter to my intuition) I found
that, indeed, it didn't make a difference, as you point out. One
remarkable thing was that the C++ executables for my (small) benchmarks
were quite a bit larger, which may be relevant for embedded applications.
in C there arent the simplest things present like constants, each struct and
enum have to be prefixed with "struct" and "enum". iam sure there is much
more.
These are some areas where I would agree that yes, C++ is (a bit)
cleaner than C. Another example is declaring variables inside for()
statements and such, this can truly help readability, and limiting the
scope of a local variable if possible is a good thing. Note that many of
these (almost cosmetic) changes have made their way back into C99.
i don't get it why people program in C and faking OOP features(function
pointers in structs..) instead of using C++. are they simply masochists or
is there a logical reason?


In all honesty I think that many people who prefer C over C++ don't
quite get what all the fuzz is about in OOP (I know I don't). In
principle there are sound advantages to grouping together structs and
their associated method functions from a design perspective. Inheritance
and polymorphism have an important part to play as well, especially in
some areas of application (such as GUIs).

However, this is the first place where you get a tradeoff of execution
speed, executable size, and runtime memory usage (for virtual method
tables) versus design-time advantages. In reality of course, especially
with nowadays' big machines, these disadvantages are not too important
for most applications. However, (to me at least) it is a bit unnerving
to be at the mercy of the compiler and its designer, and hope that he
implemented all this machinery properly and without causing too much
overhead. This is more a psychological barrier than a real one of
course, since modern compilers are able to optimize away many
unneccessary machinery, and some rather clever tricks have been found to
make virtual method calls very cheap. However, as a programmer I am no
longer completely in the driver's seat as I am with C. Looking at a C
porgram, I can have a straightforward and relatively accurate mental
picture of what the actual machine code produced by the compiler will
look like. With OOP and C++, that's no longer true, especially with code
that uses all the available C++ features including exceptions and templates.

One generic complaint I have with OOP (not limited to C++) is that I can
no longer look at a code fragment and reconstruct the execution flow in
my head, because of polymorphism and operator overloading; in C (unless
you're doing funky stuff with threads or longjumps), the execution flow
is pretty much known at compile-time, and can be reproduced from the
code. I happen to like that.

Of course OOP proponents will counter that this is in fact the entire
point of OOP: one should no longer be thinking in terms of structural
execution flow, but rather in terms of objects with a well-defined
behaviorial 'contract', that can be triggered by invoking methods.

Now this is where a lot of subjectivity comes in, but I for one simply
don't think that way. This is probably due to the way I earned my
computer experience (going up from BASIC to 8-bit machine language to
Pascal to C). "Thinking in classes", something that is essential for
good OOP programming, is just not for me (except for some obvious cases
with a small number of classes - I have done some C++ programming in my
time of course).

When the programs get bigger, and the number of classes grows, you come
to another point: there is a transition in the level of design: instead
of putting statements in the right order, you have to start managing a
class model. The Design Patterns school-of-thought comes in here: how do
I design a set of classes with interaction to get a certain type of
bahavior? For me, this has two problems. First, there is often more than
one sensible way of designing a set of classes to address a certain
problem. I have an instinctive dislike of that kind of situation: I have
the (admittedly rather naive) feeling that software related problems
should have a canonical 'best' solution. The second (real) problem is
that C++ doesn't really support the Design Pattern level of abstraction.
Instead, it hands the programmer a number of nuts and bolts that enable
him to approximate the abstract idea encapsulated in a DP. I think there
are no programming languages available today that properly support the
Design Pattern methodology, and it's certainly not C++.

Now of course all this is more a rant against OOP than C++, but IMHO C++
offers no advantages to C99 other than OOP-support, so it is relevant to
your question.

You could argue of course that C++ > (C + OOP). The two most prominent
features apart from OOP that set aside C and C++ are, I think,
exceptions and templates.

As for exceptions, you may know Dijkstra's paper "Goto's considered
harmful". In this paper he has a number of points that I would subscribe
to, concerning the ability of the human programmer to read the meaning
of a piece of code from the source. In essence, he argues that GOTO
statements destroy this possibility.

I would argue that exceptions are "goto's on steroids". Since exceptions
are allowed to cross function-call boundaries, execution flow becomes
very non-transparant - at least to me! This is a similar objection I
have with polymorphism as described above.

A serious problem with exception handling in C++ is it's interaction
with memory management, which is made even worse by having implicit
object creation (with implicit constructor calls). Now I know a lot of
talented programmers, many of which are far more accomplished in C++
programming than I am, but not a single one of them can quote me the
do's-and-don'ts of a 'good' C++ program in this respect. It's a minefield.

Incidentally, having just written a rather big real-life C library with
error handling, I do appreciate the need for exception handling.
However, I think it is a mistake to have a language that does include
exception handling but doesn't do garbage collection for the reason
stated above. Sure, it's possible to do it properly. But one has to
remember that programmers are human beings; most programmers I know have
simply not the level of intimacy with the C++ runtime model to do this
without making mistakes.

Templates.... Suffice it to say that one cannot write a portable C++
program using templates and expect it to work identically on different
compilers. Portability is nil, and this makes this feature not useful in
many practical sutuations. One can complain about (or to) compiler
builders in this regard, but this is just a symptom of overly
complicated semantics. Even if compiler builders get their act together,
the semantics would still be too difficult for most programmers.
Including me.

To summarize I would say C++ with its feature set is just too
complicated, as a language design I feel it has failed. One has to keep
in mind that a programming language is a tool to make programs. If a
tool has a significant chance of being unintentially misused (with
possibly disastrous results), it's not a good tool. I will stick with
something I actually (more or less) understand, which is C.

By the way, did you ever read the Stroustrup book ('Programming in
C++')? As the book progresses, his examples evolve from things that look
sort-of-like-C to STL-based programs that are (to my untrained eye at
least) simply ugly. My feeling is that he tries to bring the expressive
power of dynamic interpreted languages to the realm of compiled
languages. A valliant attempt, and I would applaud him for it. However,
his writing conveys a breathtaking arrogance or perhaps lack of
understanding for the fact that most programmers are mere mortals... I'm
sure as the language's designer he is able to mentally internalize the
runtime model of C++, but to think that your average programmer could
readily do the same is just preposterous.

And a last thing: try writing a library in C++ and linking it with a
program written in C (like Matlab, IDL, Mathematica...). Now there's a
practical reason to prefer C over C++ if I ever saw one.

Thank you for giving me an opportunity to rant a bit about this. Perhaps
this therapeutical excercise of mine will give you some insight in the
reasons why some of us still prefer C over C++! :-)

Best regards,

Sidney Cadot
The Netherlands

Nov 13 '05 #3
Sidney Cadot wrote:
Hi cody,
no this is no trollposting and please don't get it wrong but iam very
curious why people still use C instead of other languages especially C++.


I can't answer for people in general of course, but as a moderately able
C programmer with a thorough dislike of C++ I can try to explain what my
motives are.


<superb answer snipped>

Very well said. A very thoughtful article indeed.

--
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 13 '05 #4

"Sidney Cadot" <si****@jigsaw.nl> wrote in message
news:bl**********@news.tudelft.nl...
Hi cody,
no this is no trollposting and please don't get it wrong but iam very
curious why people still use C instead of other languages especially C++.

I can't answer for people in general of course, but as a moderately able
C programmer with a thorough dislike of C++ I can try to explain what my
motives are.
i heard people say C++ is slower than C but i can't believe that. in
pieces of the application where speed really matters you can still use "normal"
functions or even static methods which is basically the same.


A few years ago I did some timing and (counter to my intuition) I found
that, indeed, it didn't make a difference, as you point out. One
remarkable thing was that the C++ executables for my (small) benchmarks
were quite a bit larger, which may be relevant for embedded applications.


OOP in general tends to be slower. The process of allocating and
deallocating memory, including finding a good sized region to allocate,
takes time. As you say, though, one can do non-OOP in C++, and, with some
work, OOP in C.
in C there arent the simplest things present like constants, each struct and enum have to be prefixed with "struct" and "enum". iam sure there is much more.
As if the compiler didn't know... In PL/I structures can be referenced in
any unambiguous way. I don't know if that leads to more bugs, or makes
programs more or less readable, though. It does seem strange that you have
to keep reminding the compiler that something is a struct.
These are some areas where I would agree that yes, C++ is (a bit)
cleaner than C. Another example is declaring variables inside for()
statements and such, this can truly help readability, and limiting the
scope of a local variable if possible is a good thing. Note that many of
these (almost cosmetic) changes have made their way back into C99.
i don't get it why people program in C and faking OOP features(function
pointers in structs..) instead of using C++. are they simply masochists
or is there a logical reason?


Note, though, that Java is much closer to C than C++ is, despite the
similarity of names. If you like C, but want an OO language, Java should be
your choice.
In all honesty I think that many people who prefer C over C++ don't
quite get what all the fuzz is about in OOP (I know I don't). In
principle there are sound advantages to grouping together structs and
their associated method functions from a design perspective. Inheritance
and polymorphism have an important part to play as well, especially in
some areas of application (such as GUIs).
For some kinds of programming projects, yes.

(snip)
. However, as a programmer I am no
longer completely in the driver's seat as I am with C. Looking at a C
porgram, I can have a straightforward and relatively accurate mental
picture of what the actual machine code produced by the compiler will
look like. With OOP and C++, that's no longer true, especially with code
that uses all the available C++ features including exceptions and templates.

Well, some people consider C as a glorified assembler. It isn't quite that,
especially as it has changed over the years, but not so far off.
One generic complaint I have with OOP (not limited to C++) is that I can
no longer look at a code fragment and reconstruct the execution flow in
my head, because of polymorphism and operator overloading; in C (unless
you're doing funky stuff with threads or longjumps), the execution flow
is pretty much known at compile-time, and can be reproduced from the
code. I happen to like that.
Well, with library functions in general you don't know what is inside the
function. If you are writing the whole program yourself then the
abstraction is less useful. If different people are working on different
parts then abstraction means you need to know less about the specific
features of those parts. The interface is narrower, which sometimes
decreases efficiency. (It may take more calls to get something done, or
more things done than are really needed.)
Of course OOP proponents will counter that this is in fact the entire
point of OOP: one should no longer be thinking in terms of structural
execution flow, but rather in terms of objects with a well-defined
behaviorial 'contract', that can be triggered by invoking methods.
(snip)
As for exceptions, you may know Dijkstra's paper "Goto's considered
harmful". In this paper he has a number of points that I would subscribe
to, concerning the ability of the human programmer to read the meaning
of a piece of code from the source. In essence, he argues that GOTO
statements destroy this possibility.

I would argue that exceptions are "goto's on steroids". Since exceptions
are allowed to cross function-call boundaries, execution flow becomes
very non-transparant - at least to me! This is a similar objection I
have with polymorphism as described above.
Well, there is that. But the name, exception, gives you some idea of their
use. They should be used for exceptional things. In compilers sometimes
there is nothing that can be done. Especially in recursive descent
compilers it may be that the only thing to do is declare an error and go
onto the next statement. That requires crossing function call boundaries,
but it is easy to understand what is happening. The C setjmp/longjmp has a
similar use, and is similarly non-transparent.

(snip)
To summarize I would say C++ with its feature set is just too
complicated, as a language design I feel it has failed. One has to keep
in mind that a programming language is a tool to make programs. If a
tool has a significant chance of being unintentially misused (with
possibly disastrous results), it's not a good tool. I will stick with
something I actually (more or less) understand, which is C.


Well, much of the idea of C is to be simple. I learned PL/I as my first
structures language, and I still prefer it, in some ways, to C. PL/I is
complicated, almost by design. (It was designed to include features from
Algol, Fortran, and COBOL, all in one language.) C string handling is
simple in design, somewhat efficient, but so easy to do wrong. Again,
PL/I was designed to be complicated, but such that you didn't need to learn
parts you didn't need to use. That required no reserved words. (If you
didn't know about a feature how could you know not to use the words?)
Writing simple programs is pretty simple. The dynamic memory features of C
are fine once you are used to them, but pretty strange until then.

-- glen
Nov 13 '05 #5

<no****@nospam.invalid> wrote in message
news:20***********************@mail.zedz.net...

On 6-Oct-2003, "cody" <NO****************@gmx.net> wrote:
[snip]


Because C is more portable?


No more portable than C++.

-Mike
Nov 13 '05 #6
> Inheritance and polymorphism have an important part to play as well,
especially in some areas of application (such as GUIs).

However, this is the first place where you get a tradeoff of execution
speed, executable size, and runtime memory usage (for virtual method
tables) versus design-time advantages. In reality of course, especially
with nowadays' big machines, these disadvantages are not too important
for most applications. However, (to me at least) it is a bit unnerving
to be at the mercy of the compiler and its designer, and hope that he
implemented all this machinery properly and without causing too much
overhead. This is more a psychological barrier than a real one of
that is really true!
course, since modern compilers are able to optimize away many
unneccessary machinery, and some rather clever tricks have been found to
make virtual method calls very cheap. However, as a programmer I am no
longer completely in the driver's seat as I am with C. Looking at a C
porgram, I can have a straightforward and relatively accurate mental
picture of what the actual machine code produced by the compiler will
look like. With OOP and C++, that's no longer true, especially with code
that uses all the available C++ features including exceptions and templates.
One generic complaint I have with OOP (not limited to C++) is that I can
no longer look at a code fragment and reconstruct the execution flow in
my head, because of polymorphism and operator overloading;
yes, operator overloading is one of the most the most sucking thing in c++!
As for exceptions, you may know Dijkstra's paper "Goto's considered
harmful". In this paper he has a number of points that I would subscribe
to, concerning the ability of the human programmer to read the meaning
of a piece of code from the source. In essence, he argues that GOTO
statements destroy this possibility.

I would argue that exceptions are "goto's on steroids". Since exceptions
are allowed to cross function-call boundaries, execution flow becomes
very non-transparant - at least to me!
where the exception goes is well defined, it cannot go somewhere, it goes
simply
down the callstack which is more readable than gotos, imo.

but doesn't c support structured exception handling too? i heard something
like that.
It's a minefield.
absolutely.
Templates.... Suffice it to say that one cannot write a portable C++
program using templates and expect it to work identically on different
compilers. Portability is nil, and this makes this feature not useful in
many practical sutuations. One can complain about (or to) compiler
builders in this regard, but this is just a symptom of overly
complicated semantics.
that is not true. name me one example where semantics are different on
different compilers!
templates are a very very useful and mighty feature in c++. however it is a
bit difficult to use.
To summarize I would say C++ with its feature set is just too
complicated, as a language design I feel it has failed. One has to keep
in mind that a programming language is a tool to make programs. If a
tool has a significant chance of being unintentially misused (with
possibly disastrous results), it's not a good tool. I will stick with
something I actually (more or less) understand, which is C.
yes and no. c++ should not be used for everything. gui's should not be made
with c++.
for libraries, c++ is good because it is very fast and flexible thanks to
templates.
you say the language design has failed, but do you have a better idea how it
can be solved?
imo for high performance applications there is no better way than c++. since
c lacks of templates,
c++ would be the choice for me.
By the way, did you ever read the Stroustrup book ('Programming in
C++')? As the book progresses, his examples evolve from things that look
sort-of-like-C to STL-based programs that are (to my untrained eye at
least) simply ugly. My feeling is that he tries to bring the expressive
power of dynamic interpreted languages to the realm of compiled
languages. A valliant attempt, and I would applaud him for it. However,
his writing conveys a breathtaking arrogance or perhaps lack of
understanding for the fact that most programmers are mere mortals... I'm
sure as the language's designer he is able to mentally internalize the
runtime model of C++, but to think that your average programmer could
readily do the same is just preposterous.


right i cannot imagegine that somebody really and completely understands the
STL.

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk
Nov 13 '05 #7
Mike Wahler wrote:

<no****@nospam.invalid> wrote in message
news:20***********************@mail.zedz.net...

On 6-Oct-2003, "cody" <NO****************@gmx.net> wrote:
> [snip]


Because C is more portable?


No more portable than C++.

-Mike

Are you excluding "C++" programs written for Microsoft compilers, or g++
prior to 3.x? That would nearly make the point, that C++ portability has
been possible (but not commonly adhered to) for about a year, compared to
over 20 for C.
--
Tim Prince
Nov 13 '05 #8
Sidney Cadot <si****@jigsaw.nl> wrote in message news:<bl**********@news.tudelft.nl>...
....
And a last thing: try writing a library in C++ and linking it with a
program written in C (like Matlab, IDL, Mathematica...). Now there's a
practical reason to prefer C over C++ if I ever saw one.


It seems to me that only this last issue truly addresses the question.
In all of your other issues, you're complaining about features of C++
that you don't have to use if you don't want to.

I personally use C or C++ for the simple reason that our company's
contract with NASA requires us to deliver code for either Fortran 77,
Fortran 90, C90 (more precisely, C94), or Ada.

I like C because it's a simpler language than C++, and because I've
got a lot more experience with it. However, I love complicated things,
and I see all kinds of interesting features in C++ that I'd love to
have time to play with. However, as long as all of my C++ programming
is done at home, rather than at work, I'm never going to build up much
experience with it. I'm hpping that the next project I work on allows
both C++ and C99 (which also has some neat new features that aren't in
C++).
Nov 13 '05 #9
On Sun, 5 Oct 2003, cody wrote:
no this is no trollposting and please don't get it wrong but iam very
curious why people still use C instead of other languages especially C++.

i heard people say C++ is slower than C but i can't believe that. in pieces
of the application where speed really matters you can still use "normal"
functions or even static methods which is basically the same.

in C there arent the simplest things present like constants, each struct and
enum have to be prefixed with "struct" and "enum". iam sure there is much
more.

i don't get it why people program in C and faking OOP features(function
pointers in structs..) instead of using C++. are they simply masochists or
is there a logical reason?

i feel C has to benefit against C++.


There are a few reasons I would use C over C++.

1) Not all environments have a good C++ compiler.

There are still some situations where finding a good C++ compiler is just
not possible. Last time I checked they were still working on an embedded
C++ standard because the C++ standard does not address the needs of the
embedded world.

2) There is a certain amount of overhead with learning and using C++ that
might not be necessary for specific projects.

If I am writing a program that I can keep most, if not all, of the project
in my head then why would I want to use C++? Especially if I have been
programming C for over 20 years.

3) C language is closer to assembly language.

If I am trying to squeak out every last cycle I can out of an application
or if timing is critical I would write a project in C language, set a
switch to keep the intermediate assembly source files and then replace the
C source with assembly source but only for those functions that need to be
hand tweaked. In situations where I cannot do this, I can often play with
my C language until I get the same results as programming in assembly
language.

Bottom line, I use C with I don't need everything C++ offers. It is sort
of the same reason they still teach Newtonian physics. Why doesn't
everyone use Einsteinian physics? Because Newtonian is easier and is good
enough for today to today physics.

--
Send e-mail to: darrell at cs dot toronto dot edu
Don't send e-mail to vi************@whitehouse.gov
Nov 13 '05 #10
Darrell Grainger wrote:
....
3) C language is closer to assembly language.


I don't think that objection holds up. Whatever features of C that
you're thinking of, are all part of C++ as well. If you need to write
close to assembly language, you can write C++ code that is also legal
C90 code with essentially the same meaning. If you follow good C coding
practices (systematic use of prototypes, etc.), you'll seldom even have
to hink about the fact that you're writing this code to be compiled by a
C++ compiler, rather than a C compiler.
Nov 13 '05 #11
Mike Wahler wrote:
<no****@nospam.invalid> wrote in message

Because C is more portable?


No more portable than C++.


There are many machines out there that have a C compiler, of some
sort, available. They do not have any C++ available. PICs, the
Rabbit, 8051s come to mind. To my mind this makes C more
portable.

If you talk solely about portability, but not availability, then
Pascal is much more portable than C. There are far fewer
requirements for the underlying machine. But if you talk about
walking up to some machine while clutching a program source file
in some ISO standardized language, and getting that program to run
on that machine, C is most likely to do the job.

--
Chuck F (cb********@yahoo.com) (cb********@worldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!

Nov 13 '05 #12
On Mon, 06 Oct 2003 14:29:46 +0000, Darrell Grainger wrote:
Bottom line, I use C with I don't need everything C++ offers. It is sort
of the same reason they still teach Newtonian physics. Why doesn't
everyone use Einsteinian physics? Because Newtonian is easier and is good
enough for today to today physics.


Allow me, as a former relativist (in the physical sciences sense) to take
exception on that analogy. While illustrative, it seems to imply that C++
has some kind of trascendence over C - which, in my view, it has not.

Both Newtonian physics and Einsteinian physics are superb theories, the
latter superseding the former, but not obsoleting it for the reasons you
accurately mentioned.

However, C++ does not stand vis-a-vis C the same way. C++ is a horribly
complicated language, based on a philosophy totally different than that
underlying C, and artificially made it look as close as possible to C. In
my view, C++ is the most abhorrent contraption ever produced by the CS
establishment, turning a potentially interesting field (albeit not the
silver bullet many would have us believe) like object oriented design into
something unpalatable and repugnant. In my view again, if there is a CS
hell, I hope that Mr. Stroustrup, the guy whose brainchild C++ is, has an
honorary place waiting for him in there.
Nov 13 '05 #13
Santa Claus wrote:

However, C++ does not stand vis-a-vis C the same way. C++ is a horribly
complicated language, based on a philosophy totally different than that
underlying C, and artificially made it look as close as possible to C. In
my view, C++ is the most abhorrent contraption ever produced by the CS
establishment, turning a potentially interesting field (albeit not the
silver bullet many would have us believe) like object oriented design into
something unpalatable and repugnant. In my view again, if there is a CS
hell, I hope that Mr. Stroustrup, the guy whose brainchild C++ is, has an
honorary place waiting for him in there.


It'll be right next to the place reserved for people who
sling mud anonymously.

If your criticism has merit (I know too little of C++ to
evaluate it), have the courage to put your name to it. If
the courage is lacking, what are we to make of your confidence
in your own opinion? And if you have so little confidence in
it, why bother us with it?

May the next chimney you slide down have a roaring fire
at the bottom.

--
Er*********@sun.com
Nov 13 '05 #14

"Tim Prince" <ti***********@xxxxsbcglobal.net> wrote in message
news:a9********************@newssvr21.news.prodigy .com...
Mike Wahler wrote:

<no****@nospam.invalid> wrote in message
news:20***********************@mail.zedz.net...

On 6-Oct-2003, "cody" <NO****************@gmx.net> wrote:

> [snip]

Because C is more portable?
No more portable than C++.

-Mike

Are you excluding "C++" programs written for Microsoft compilers,


I'm excluding anything outside the domain of the ISO
standard C++ language, just as I would exclude anything
outside standard C when referring to portablility.
or g++
prior to 3.x?

I'm not talking about compilers, but (standardized) languages.
That would nearly make the point,
I need refer to no specific imlementations to make the point
that C and C++ are standardized and portable.
that C++ portability has
been possible
The ISO standard C++ language is portable. And yes,
it's possible that it is what it is.
(but not commonly adhered to)
ISO C and ISO C++ are standardized, portable languages.
What folks do or not with them does not change this fact.
for about a year,
You don't get out much do you? :-) C++ has been standardized
since 1998.
compared to
over 20 for C.


C has not been standardized for 20 years. It was first
standardized in 1990 (or 1989, depending upon whom you ask).

-Mike
Nov 13 '05 #15
cody writes:
in C there arent the simplest things present like constants, each struct and enum have to be prefixed with "struct" and "enum". iam sure there is much
more.


The only real difference from C++ is in the syntax. I think (perhaps
wrongly) of the thing you are describing as a mini namespace thing.
--
comp.lang.c.moderated - moderation address: cl**@plethora.net
Nov 13 '05 #16
On 05 Oct 2003 21:37:06 GMT, "cody" <NO****************@gmx.net> wrote
in comp.std.c:
no this is no trollposting and please don't get it wrong but iam very
curious why people still use C instead of other languages especially C++.
This post is completely off-topic in all three of the newsgroups to
which you posted it, although the moderator of comp.lang.c.moderated
apparently disagrees with me.

It is particularly off-topic in comp.std.c, which discusses the past,
present, and future of the ISO/IEC International Standard for the C
programming language. As far as the standard is concerned, there is
literally no language other than C, although C++ is mentioned a few
times in non-normative footnotes.
i heard people say C++ is slower than C but i can't believe that. in pieces
What people? What are their qualifications to make such a statement?
What evidence have they provided to prove the statement?

And what are your qualifications to refute such a statement? What
evidence do you have to disprove it?
of the application where speed really matters you can still use "normal"
functions or even static methods which is basically the same.

in C there arent the simplest things present like constants, each struct and
enum have to be prefixed with "struct" and "enum". iam sure there is much
more.
Obviously your knowledge of C is minimal. Do you think ignorance of a
subject qualifies you to expound on it? Or is your wisdom to be
inferred by your lack of proper capitalization, punctuation, and
grammar?
i don't get it why people program in C and faking OOP features(function
pointers in structs..) instead of using C++. are they simply masochists or
is there a logical reason?

i feel C has to benefit against C++.


Why should we care about your obviously illogical feelings? C existed
long before C++ did, and is and was extremely successful. It is the
most portable programming language in the world. It does not need to
justify its existence to you or to anyone else, nor does it have to
compare itself to any other language.

Discussions of the relative merits of various programming languages
belong in news:comp.programming if they are cogent. They belong in
advocacy groups if not. No one is asking you to use C is you don't
think it is useful to you.

But comparisons between C and any other language, C++ included, are
not C language issues and do not belong in any of groups you posted
to.

--
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++ ftp://snurse-l.org/pub/acllc-c++/faq
--
comp.lang.c.moderated - moderation address: cl**@plethora.net
Nov 13 '05 #17
One word inertia.

C++ has been around for so long and is a very mature language with
fantastic tools. The problem is that companies do not invest in
training developers about object oriented design and programming.

Sandeep
--
http://www.EventHelix.com/EventStudio
EventStudio 2.0 - Generate Sequence Diagrams and Use Cases in PDF
--
comp.lang.c.moderated - moderation address: cl**@plethora.net
Nov 13 '05 #18
Rob
"cody" <NO****************@gmx.net> wrote in message
news:cl****************@plethora.net...
no this is no trollposting and please don't get it wrong but iam very
curious why people still use C instead of other languages especially C++.

i heard people say C++ is slower than C but i can't believe that. in pieces of the application where speed really matters you can still use "normal"
functions or even static methods which is basically the same.
I would dispute claims that C++ is slower than C. It is a fair call that
some early implementations of C++ (particularly while the standard was
in draft and evolving) were not particularly efficient. But that has
changed, now that there is a standard and compiler writers have had
a chance to address shortcomings of earlier implementations.

There are some aspects of C++ that carry a performance overhead.
No question. But, doing the same things in C would also carry a
performance overhead and that needs to be coupled with the fact
that the programmer must manually craft solutions to address the
same problem. One obvious example is virtual function dispatch,
which essentially means that the choice of a function to call is based
on the type of an object. It carries an overhead in either run time
or space: each data structure must carry a pointer to the function
that must be called, or there must be a run-time mechanism that
examines the type of object and then determins what object to
run. If such a facility is needed, then it is available in C++ but
must be explicitly coded in C. The hand coded solutions would
carry overheads as well.

in C there arent the simplest things present like constants, each struct and enum have to be prefixed with "struct" and "enum". iam sure there is much
more.
I thought C supported constants, but never mind (willing to stand
corrected).

The other points (eg struct and enumerted types needing to carry the
keywords) are stylistic issues. There are arguments in favour of having to
use the keywords (eg making it explicit what is actually going on) versus
not
(eg not having to know what is going on).

i don't get it why people program in C and faking OOP features(function
pointers in structs..) instead of using C++. are they simply masochists or
is there a logical reason?


In my experience, this observation is incorrect. There are some older
codes
in C that essentially replicated OO features (eg calling a function based on
type of object) but these are not extremely common, and most of them
preceded languages like C++ that support OO features.

The basic fact is that use of OO is a design trade-off. Object oriented
approaches
come with a series of trade-offs, in design, coding, and run time
performance.
There are other ways of designing systems, that also have trade-offs. Some
of
those design approaches are quite amenable to implementation in C. The
basic
result is that people who work on problems that aren't well suited to an OO
solution will often use other design approaches. Those people are often
quite
justified in using C, as they don't need to exploit additional features of
C++.
--
comp.lang.c.moderated - moderation address: cl**@plethora.net
Nov 13 '05 #19
"cody" <NO****************@gmx.net> writes:
no this is no trollposting and please don't get it wrong but iam very
curious why people still use C instead of other languages especially C++.


One important advantage of C is that C is significantly simpler than C++.

--
Fergus Henderson <fj*@cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--
comp.lang.c.moderated - moderation address: cl**@plethora.net
Nov 13 '05 #20
cody wrote:
no this is no trollposting
I will try to bear that in mind.
and please don't get it wrong but iam very
curious why people still use C instead of other languages especially C++.

i heard people say C++ is slower than C but i can't believe that.
Believe it. Or test it. For your test to be significant, be sure you use a
wide range of test programs, equivalently written in C and C++ (don't
bother with the so-called "C subset" of C++ - either write in C or write in
C++), on a wide variety of programs. Tabulate your results. (If they're
worth a damn, they're probably worth publishing, perhaps on your Web site
in the first instance.)
in
pieces of the application where speed really matters you can still use
"normal" functions or even static methods which is basically the same.
Suck it and see.
in C there arent the simplest things present like constants,

int main(void)
{
const int new = 6; /* I rest my case */
return 0;
}
each struct
and enum have to be prefixed with "struct" and "enum".
Poor baby.
iam sure there is
much more.
Yes, there is. C is simple, portable, and very very fast. Those are
important qualities.
i don't get it why people program in C and faking OOP features(function
pointers in structs..) instead of using C++. are they simply masochists or
is there a logical reason?
There is a logical reason. Encapsulation is a great idea for some projects
(not all, of course), so why not use it (when appropriate)? Note, also,
that a C program such as you describe doesn't "fake OOP features" - rather,
it uses OOP to achieve its objectives. That C, which was /not/ designed to
do OOP, /can/ be used for OOP is quite remarkable in itself. Having said
that, I am very much of the "if you want OOP and C++ is available, use C++"
school - but note that C++ is /not/ available on anything like as many
target platforms as C is.

i feel C has to benefit against C++.


It does have three important advantages. It's simple, portable, and fast.

--
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
--
comp.lang.c.moderated - moderation address: cl**@plethora.net
Nov 13 '05 #21
cody wrote:
i heard people say C++ is slower than C but i can't believe that. in pieces
of the application where speed really matters you can still use "normal"
functions or even static methods which is basically the same.
There is both a speed and size penalty for using C++ where
pain C would do. The penalty isn't as bad as it used to be.
in C there arent the simplest things present like constants, each struct and
enum have to be prefixed with "struct" and "enum". iam sure there is much
more.
C has constants. We usually use typedefs rather than struct
and enum tags.
i don't get it why people program in C and faking OOP features(function
pointers in structs..) instead of using C++. are they simply masochists or
is there a logical reason?


It's very rare for C programs to "fake OOP features".

One of C's main benefits is that it is easier to implement
and has simpler run-time support requirements. This makes
it especially suited to embedded processors, for example.
--
comp.lang.c.moderated - moderation address: cl**@plethora.net
Nov 13 '05 #22
cody wrote:
no this is no trollposting and please don't get it wrong but iam very
curious why people still use C instead of other languages especially C++.


C is available on nearly every machine. C++ is not. OOP is a nice thing
but not for everything.

"With OOP we can solve problems very elegant, we wouldn't have without
it."

While the above statement is not entirely true, there is some truth in it.
;)

/Sven

--
Remove the "-usenet" part of the mail address to mail me. The Gibe/Swen
worm forced me to shutdown my usenet email address for a limited time.
--
comp.lang.c.moderated - moderation address: cl**@plethora.net
Nov 13 '05 #23
In article <cl****************@plethora.net>,
"cody" <NO****************@gmx.net> wrote:
no this is no trollposting and please don't get it wrong but iam very
curious why people still use C instead of other languages especially C++.
C++ *is* C. Worse, it is an improper superset of C. Of all the things
you might advocate as an "alternative" to ANSI C, C++ is probably the
worst.
i don't get it why people program in C and faking OOP features(function
pointers in structs..) instead of using C++.


This is laughable. It is C++ that is best known for faking OO features!
If you're looking for an OO extension to C that is actually well done,
one that is additionally a proper superset of C, you should be looking
at Objective-C. But that's still in the C family. If you don't want C,
don't use C; don't use C++ and pretend you're not using C, though.
--
comp.lang.c.moderated - moderation address: cl**@plethora.net
Nov 13 '05 #24
cody wrote:
in C there arent the simplest things present like constants, each struct and
enum have to be prefixed with "struct" and "enum".


Neither of these is really true. "Real" integer constants can be
created using enums (or "#define"), and you can use "typedef" to avoid
having to write "struct" or "enum" everywhere if it bothers you, e.g.:

typedef enum { false, true } bool;

Jeremy.
--
comp.lang.c.moderated - moderation address: cl**@plethora.net
Nov 13 '05 #25
Hi all

My reason is simple: I have no time at the moment to learn C++ and C fits my
needs.

Well, I actually know something about C++, but I feel that you need a lot of
knowledke on C++ to be able to develop "big programs", I mean that there are
lots of things that need to be well understood, otherwise you are dead (you
know, lot of errors you can't find...)

"cody" <NO****************@gmx.net> escribió en el mensaje
news:cl****************@plethora.net...
no this is no trollposting and please don't get it wrong but iam very
curious why people still use C instead of other languages especially C++.

i heard people say C++ is slower than C but i can't believe that. in pieces of the application where speed really matters you can still use "normal"
functions or even static methods which is basically the same.

in C there arent the simplest things present like constants, each struct and enum have to be prefixed with "struct" and "enum". iam sure there is much
more.

i don't get it why people program in C and faking OOP features(function
pointers in structs..) instead of using C++. are they simply masochists or
is there a logical reason?

i feel C has to benefit against C++.

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk
--
comp.lang.c.moderated - moderation address: cl**@plethora.net

--
comp.lang.c.moderated - moderation address: cl**@plethora.net
Nov 13 '05 #26
cody wrote:
I am very curious about why people still use C
instead of other languages, especially C++.
Fear of change.
I heard people say C++ is slower than C but I can't believe that.
Neither can I. In fact, I know it isn't true.
No one has *ever* shown an example of C code
which is faster that C++ (or slower than C code)
that actually performed the same computation.
The speed of the code emitted by either a C or C++ compiler
depends *only* upon the quality of the the compiler.
In pieces of the application where speed really matters,
you can still use "normal" [C] functions or even static methods
which is basically the same.
It doesn't matter.
In C, there aren't the simplest things present like constants,
C supports the const keyword now.
each struct and enum must be prefixed with "struct" and "enum".
typedef struct X {
// public data members
} X;

in C is the same as

struct X {
// public data members
};

in C++.
I am sure there is much more.

I don't get it why people program in C and faking OOP features
(function pointers in structs..) instead of using C++.
Are they simply masochists? Or is there a logical reason?

I feel C has to benefit against C++.


They are *not* faking OOP features.
This is just the way that C programmers wrote object oriented programs
before the C++ programming language was introduced.
The C++ programming just makes object oriented programming
easier, more reliable and more portable -- that's all that
*any* so called object oriented programming language can do.
--
comp.lang.c.moderated - moderation address: cl**@plethora.net
Nov 13 '05 #27
cody wrote:
no this is no trollposting and please don't get it wrong but iam very
curious why people still use C instead of other languages especially C++.

i heard people say C++ is slower than C but i can't believe that. in pieces
of the application where speed really matters you can still use "normal"
functions or even static methods which is basically the same.
C++ is not slower than C. Many early C++ compilers would translate C++
to C, then proceed as a C compiler.

in C there arent the simplest things present like constants, each struct and
enum have to be prefixed with "struct" and "enum". iam sure there is much
more.
No, this is just a typing issue. All those things disappear during code
execution. One can use the typedef facility for making abbreviations.

i don't get it why people program in C and faking OOP features(function
pointers in structs..) instead of using C++. are they simply masochists or
is there a logical reason?
Many people have to deal with legacy code. Some OOP features have been
coded in C and have been tested. Converting them to C++ means more
development and testing time.

i feel C has to benefit against C++.

--
cody


Each language has its thorns and roses. I just asked if I could use C++
on our next embedded project and the management said no.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
--
comp.lang.c.moderated - moderation address: cl**@plethora.net
Nov 13 '05 #28
"Glen Herrmannsfeldt" <ga*@ugcs.caltech.edu> wrote in message
news:74********************@rwcrnsc52.ops.asp.att. net...
Well, some people consider C as a glorified assembler. It isn't quite that, especially as it has changed over the years, but not so far off.


Yes, let's talk about that. When I code in C for my favorite platform I do
tend to "see" the generated assembly in my head. The picture gets bigger and
changes too as I gain more experience, but I do think a lot more like that
machine when programming in C. When I do C++ this is a lot less, I tend to
think in terms of objects and generated objects (templates). Can't decide
what I like better, I keep switching back and forth between the two.

consider this:
size_t i = strcspn(s, "\n");
std::string::size_type i = s.find_first_of("\n");

In my mind strcspn does it a lot simpler than find_first_of.

Or even simpler.
strlen(s);
s.length();

What does s.length() example do? Do strlen somewhere? (some implementations
do). Keep track of the length?
You just give up a lot of control with C++.
Nov 13 '05 #29
On Mon, 06 Oct 2003 14:22:06 -0400, Eric Sosman wrote:

It'll be right next to the place reserved for people who
sling mud anonymously.

If your criticism has merit
Notice that it is a personal opinion, based on my experience. Yours might
differ, and you are welcome to that.
(I know too little of C++ to
evaluate it), have the courage to put your name to it.
What name? How do we know, anyway, that any names at the end of a post
correspond to the poster? Is it going to make you happier if I sign as
James S. Taylor? Or as Madhusudan Patel? Or as Pierre Mattera? Can you
tell if any of those is my real name? What difference does it make?
If the courage is lacking, what are we to make of your confidence in
your own opinion?
Make whatever you want.
And if you have so little confidence in it, why bother us with it?
Wrong conclusion from the wrong premise. You can't conclude anything
from my posting about my relative lack of confidence in any anything.
May the next chimney you slide down have a roaring fire
at the bottom.


Hmm... We touched a raw nerve here :-)

Nov 13 '05 #30
"E. Robert Tisdale" <E.**************@jpl.nasa.gov> writes:

| > In C, there aren't the simplest things present like constants,
|
| C supports the const keyword now.

but variables of integral types declared with the "const" keyword and
initialized with literals do not qualify as "integral constant expressions".
E.g.

const int nine = 9;

enum { NINE = nine }; // ERROR in C, OK in C++

-- Gaby
--
comp.lang.c.moderated - moderation address: cl**@plethora.net
Nov 13 '05 #31
Santa Claus is a troll. Please ignore him.

Nov 13 '05 #32
"E. Robert Tisdale" <E.**************@jpl.nasa.gov> wrote in message
news:3F**************@jpl.nasa.gov...
Santa Claus is a troll. Please ignore him.


I always thought he was an elf. :-)

-Mike
Nov 13 '05 #33
cody wrote:
I would argue that exceptions are "goto's on steroids". Since exceptions
are allowed to cross function-call boundaries, execution flow becomes
very non-transparant - at least to me!
where the exception goes is well defined, it cannot go somewhere, it goes
simply down the callstack which is more readable than gotos, imo.
"Simply down the callstack" is a bit of an oxymoron - this has some
severe and rather complicated consequences in case the callstack that is
being partially pop()ed contains partially executed
constructor/destructor calls, for example. Of course it is possible to
handle this properly, my only point is that it is complicated. Too
complicated for me, anyway - but of course you may be one of that rare
breed of programmers that understands what is going on in these cases.
If so: congratulations, and more power to you! :-)

The nice thing about exceptions is that the code throwing it shouldn't
care who catches it. This does not blend well with my preferred way of
working where I can keep track of the execution flow. Subjective.

Exception handling in C++ can result in code that is significantly
bloated and slower, by the way. The C++ compiler needs to insert
instrumentation code to handle exceptions in any function that can
possibly be the target of an exception, as far as I understand.
but doesn't c support structured exception handling too? i heard something
like that.
Not that I'm aware of. You do have setjmp/longjmp which allows to
effectively save and restore the stack state, and this can be used to
implement something similar, but that's it, as far as I know.
[Non-portable templates] that is not true. name me one example where semantics are different on
different compilers!
My latest try on doing something with templates was with a C++ compiler
for a Trimedia embedded processor, which failed to compile a rather
simple program with a template class, giving me an internal compiler
error. (this was about 2 years ago when I was graduating - can't
reproduce the program I'm afraid). Back in those days, compilers were
rife with problems in their template implementations.

I just did a search on Google for recent reports on this and (apart from
some rants on VC++ 6.0 templates), I get relatively little results.
Perhaps people have cleaned up their act (I don't know), so I guess it's
only fair to retract this statement since I cannot back it up with
anything other than old experience. My apologies... I just hope somebody
could step in at this point and give a couple of relevant examples to
prove me right after all.
templates are a very very useful and mighty feature in c++. however it is a
bit difficult to use.
On that we agree.
yes and no. c++ should not be used for everything. gui's should not be made
with c++.
Fact is that a very large percentage of GUIs _is_ made with C++.
for libraries, c++ is good because it is very fast and flexible thanks to
templates.
Except that it is difficult to link such a library with proprietary
software - these usually only support linking to C code. This severely
limits the usefulness of such libraries.
you say the language design has failed, but do you have a better idea how it
can be solved?
No. I'm waiting for people smarter than I am to come up with a new
paradigm :-)
imo for high performance applications there is no better way than c++. since
c lacks of templates, c++ would be the choice for me.
I'm comfortable with that. People differ, that's generally a good thing.
I haved C++ also on occasion, for a rather small self-contained data
processing application that just cried out for a (simple) class
hierarchy. It depends a lot on the type of project, I suppose.
[Stroustrup]

right i cannot imagegine that somebody really and completely understands the
STL.


Oh I can imagine that. I just hope these people don't expect the same of me!

Best regards, Sidney

Nov 13 '05 #34
On Mon, 06 Oct 2003 03:00:01 +0200, in comp.lang.c , Sidney Cadot
<si****@jigsaw.nl> wrote:

(actually I'm replying to Cody - my server lost his message)
no this is no trollposting and please don't get it wrong but iam very
curious why people still use C instead of other languages especially C++.
I missed your original post, but as far as I'm concerned, the answer
is "occam's razor".
When I'm writing a simple tool to process raw data from one stream to
another, its faster (for me) to /write/ it in C, even tho C++ probably
has zero or little runtime penalty.
i heard people say C++ is slower than C but i can't believe that. in pieces
of the application where speed really matters you can still use "normal"
functions or even static methods which is basically the same.
But whats the point of using C++ if all you do is "dumb it down" till
it matches C?
in C there arent the simplest things present like constants, each struct and
enum have to be prefixed with "struct" and "enum". iam sure there is much
more.
C has constants. I'm not sure what your point is about prefixing
types. Don't you like knowing what type a type is? If so, use
typedefs.
i don't get it why people program in C and faking OOP features(function
pointers in structs..) instead of using C++. are they simply masochists or
is there a logical reason?


IMHO only a theoretical scientist or someone without a C++ compiler
would fake up C++'s OOP with C. If you want OOP, then use C++. OR a
language that does it even better.
--
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>
Nov 13 '05 #35
James Kuyper wrote:
[linking to proprietary sw]
It seems to me that only this last issue truly addresses the question.
In all of your other issues, you're complaining about features of C++
that you don't have to use if you don't want to.


To a certain extent you are right of course, but the original question
mentioned 'faking' OOP-techniques in C quite explicitly, so I answered
under the assumption that cody's focus was on using OOP from either C or
C++. I really do feel that a great deal of discomfort of C programmers
with C++ is that they aren't particularly fond of OOP programming for a
variety of reasons - I know that's true for me. In my mind at least, C++
equals C plus syntactic sugar plus classes plus exceptions plus
templates. Surely you can use C++ without using the complexities brought
in by {classes, exceptions, templates}. But then, why not stick to C99?

By the way I am quite comfortable with other people having a different
opinion on this, I really think that the fun in programming is largely
dependent on one's comfortability with one's choice of language. I know
people who love coding in C++, Java, Lisp, Prolog, Haskell,... fine for
me. I love C (and a bit of Python nowadays), but there's no need to turn
this into a holy war. When somebody asks me 'why do you prefer X over Y'
I think I can make a case on technical merits but reality is never
black or white.
I personally use C or C++ for the simple reason that our company's
contract with NASA requires us to deliver code for either Fortran 77,
Fortran 90, C90 (more precisely, C94), or Ada.
Interesting! I code for ESA, and for my current project we were
basically free to choose. Could've gone with Java or C++ as far as ESA
was concerned, but since it was a requirement to link the library to IDL
and Matlab we decided to stick with C94 on technical merits. No regrets.
I like C because it's a simpler language than C++, and because I've
got a lot more experience with it. However, I love complicated things,
and I see all kinds of interesting features in C++ that I'd love to
have time to play with.
As for myself I'd like to have some more time to play with functional
languages, I like the compactness with which some things can be
expressed. I tend to think of OOP and C++ as extensions to the
imperative paradigm, for that reason I think there's more to learn for
me by studing a functional language.
However, as long as all of my C++ programming
is done at home, rather than at work, I'm never going to build up much
experience with it. I'm hpping that the next project I work on allows
both C++ and C99 (which also has some neat new features that aren't in
C++).


I can imagine that could be fun. And perhaps that would be a good excude
for brushing up those generic programming skills, from what I gather
from Google they're really portable nowadays! :-)

Best regards,

Sidney

Nov 13 '05 #36
James Kuyper wrote:
[...]


Oops! I same to have had the wrong message selected when trying to reply
to you. Please check my 0:12am message to Mark McIntyre for a response.

I beg everyone's pardon!

Sidney

Nov 13 '05 #37
"E. Robert Tisdale" wrote:

Santa Claus is a troll. Please ignore him.


So's Tisdale. What's your point?


Brian Rodenborn
Nov 13 '05 #38
Mike Wahler wrote in article
<l%***************@newsread3.news.pas.earthlink.ne t>:
I always thought he was an elf. :-)


No, he's an aout.

--
Todd Stephens
ICQ# 3150790
"A witty saying proves nothing." -Voltaire
Nov 13 '05 #39
Greetings to the group. I'm reading the FAQ and K&R and monitoring here,
trying to get a handle on the transition from shell programming to C.

From what I've read, I honestly don't see the need for anything BUT C
and the simple functionality of the high-level programming provided by
any decent shell. (Okay, a teeny weenie bit of assembly language too :-)

Hope I am not out-of-line here.

By-the-way, is there anyplace I can get the entire FAQ as a tarball or
something?

--
Later, Alan C
You can find my email address at the website: contact.html
take control of your mailbox ----- elrav1 ----- http://tinyurl.com/l55a
Nov 13 '05 #40
"Alan Connor" <zz****@xxx.yyy> wrote in message
news:Ol***************@newsread3.news.pas.earthlin k.net...
Greetings to the group. I'm reading the FAQ and K&R and monitoring here,
trying to get a handle on the transition from shell programming to C.

From what I've read, I honestly don't see the need for anything BUT C
and the simple functionality of the high-level programming provided by
any decent shell. (Okay, a teeny weenie bit of assembly language too :-)
Which language(s) you find useful will of course depend
upon the application domain(s). Certain languages are more
suited to particular tasks than others. If C, shell scripting
and assembly is all you need to get the job done, nothing
wrong with that.

Hope I am not out-of-line here.

By-the-way, is there anyplace I can get the entire FAQ as a tarball or
something?


The FAQ itself (at http://www.eskimo.com/~scs/C-faq/top.html)
has links to such. Scan the first few paragraphs for the
phrase "other versions".

HTH,
-Mike
Nov 13 '05 #41
On Tue, 07 Oct 2003 01:19:23 GMT, Mike Wahler <mk******@mkwahler.net> wrote:


"Alan Connor" <zz****@xxx.yyy> wrote in message
news:Ol***************@newsread3.news.pas.earthlin k.net...
Greetings to the group. I'm reading the FAQ and K&R and monitoring here,
trying to get a handle on the transition from shell programming to C.

From what I've read, I honestly don't see the need for anything BUT C
and the simple functionality of the high-level programming provided by
any decent shell. (Okay, a teeny weenie bit of assembly language too :-)


Which language(s) you find useful will of course depend
upon the application domain(s). Certain languages are more
suited to particular tasks than others. If C, shell scripting
and assembly is all you need to get the job done, nothing
wrong with that.

Hope I am not out-of-line here.

By-the-way, is there anyplace I can get the entire FAQ as a tarball or
something?


The FAQ itself (at http://www.eskimo.com/~scs/C-faq/top.html)
has links to such. Scan the first few paragraphs for the
phrase "other versions".

HTH,
-Mike


Thanks Mike. Don't know how I missed that. Got it now from the FTP site.

Long...Scary :-)

Thanks to Steve Summit.

--
Later, Alan C
You can find my email address at the website: contact.html
take control of your mailbox ----- elrav1 ----- http://tinyurl.com/l55a
Nov 13 '05 #42
Alan Connor wrote:
From what I've read, I honestly don't see the need for anything BUT C


C is fine for all your programming needs (if you like C, that is!), right up
until you have to do something that doesn't work in much the same way on
all machines. At that point, you have to start using platform extensions.
But that's okay, because any platform extension worth its salt has C
bindings anyway.

--
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 13 '05 #43
E. Robert Tisdale wrote:
Santa Claus is a troll. Please ignore him.


I think I'll have to disagree with you there. My children have seen Santa
Claus on quite a few occasions (typically in fairytale grotto-like
surroundings), so I have good observational evidence w.r.t. Sant Claus (or
Father Christmas, as my children call him). My experts tell me that "he is
short and fat and jolly"; "he has a long white beard"; "he wears a big red
coat with gold buttons"; "he gives out presents"; "he has twinkly eyes",
and "he drives a very special sleigh with lots of reindeer"; "he has lots
of elves to help him". These are not characteristics typically associated
with trolls; trolls tend to be taller and more vicious, and somehow don't
manage to get quite the same twinkle into their eye.

Now if you'd said that ***E. Robert Tisdale*** is a troll, I think you'd
have been closer to the mark.

--
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 13 '05 #44
On Tue, 7 Oct 2003 03:24:01 +0000 (UTC), Richard Heathfield <do******@address.co.uk.invalid> wrote:


Alan Connor wrote:
From what I've read, I honestly don't see the need for anything BUT C


C is fine for all your programming needs (if you like C, that is!), right up
until you have to do something that doesn't work in much the same way on
all machines. At that point, you have to start using platform extensions.
But that's okay, because any platform extension worth its salt has C
bindings anyway.


Good to know that. I aspire to a Linux distro that uses nothing but straight
ANSI C and shell scripts.

--
Later, Alan C
You can find my email address at the website: contact.html
take control of your mailbox ----- elrav1 ----- http://tinyurl.com/l55a
Nov 13 '05 #45
Alan Connor <zz****@xxx.yyy> writes:
On Tue, 7 Oct 2003 03:24:01 +0000 (UTC), Richard Heathfield <do******@address.co.uk.invalid> wrote:


Alan Connor wrote:
From what I've read, I honestly don't see the need for anything BUT C


C is fine for all your programming needs (if you like C, that is!), right up
until you have to do something that doesn't work in much the same way on
all machines. At that point, you have to start using platform extensions.
But that's okay, because any platform extension worth its salt has C
bindings anyway.


Good to know that. I aspire to a Linux distro that uses nothing but straight
ANSI C and shell scripts.


I don't believe it's possible to implement typical shells in
straight ANSI C without extensions, so this could be a
problematic goal.

-Micah

Nov 13 '05 #46
On Tue, 07 Oct 2003 03:59:15 +0000, Alan Connor wrote:
Good to know that. I aspire to a Linux distro that uses nothing but straight
ANSI C and shell scripts.


Why shell scripts, just install tcc and you can just do...

#! /bin/tcc -run
#include <stdio.h>

int main(void)
{
puts("Hello World");
return 0;
}

.... :)

--
James Antill -- ja***@and.org
Need an efficient and powerful string library for C?
http://www.and.org/vstr/

Nov 13 '05 #47
On 06 Oct 2003 22:23:36 -0700, Micah Cowan <mi***@cowan.name> wrote:


Alan Connor <zz****@xxx.yyy> writes:
On Tue, 7 Oct 2003 03:24:01 +0000 (UTC), Richard Heathfield <do******@address.co.uk.invalid> wrote:
>
>
> Alan Connor wrote:
>
>> From what I've read, I honestly don't see the need for anything BUT C
>
> C is fine for all your programming needs (if you like C, that is!), right up
> until you have to do something that doesn't work in much the same way on
> all machines. At that point, you have to start using platform extensions.
> But that's okay, because any platform extension worth its salt has C
> bindings anyway.
>


Good to know that. I aspire to a Linux distro that uses nothing but straight
ANSI C and shell scripts.


I don't believe it's possible to implement typical shells in
straight ANSI C without extensions, so this could be a
problematic goal.

-Micah


Most pipe dreams are "problematic" :-)

I really don't know what you mean by "extensions", although I will read up
on it in the FAQ asap.

But modern shells have all sorts of features that I could do perfectly well
without, that used to be done with independent utilities.

--
Later, Alan C
You can find my email address at the website: contact.html
take control of your mailbox ----- elrav1 ----- http://tinyurl.com/l55a
Nov 13 '05 #48
On Tue, 07 Oct 2003 01:37:21 -0400, James Antill <ja***********@and.org> wrote:


On Tue, 07 Oct 2003 03:59:15 +0000, Alan Connor wrote:
Good to know that. I aspire to a Linux distro that uses nothing but straight
ANSI C and shell scripts.


Why shell scripts, just install tcc and you can just do...

#! /bin/tcc -run
#include <stdio.h>

int main(void)
{
puts("Hello World");
return 0;
}

... :)

--
James Antill -- ja***@and.org
Need an efficient and powerful string library for C?
http://www.and.org/vstr/


Err, I couldn't a reference to tcc in the FAQ, the index to K&R2, and there's
no man page for it on my box....Nor is it in my list of available Debian
packages....

And I can't get on the internet for a while, so I give....

(but If I am reading that script correctly, it sounds like a rather more
limited shell than I had on my mind....The original sh would probably do
the trick, maybe the updated version called ash, wihich is a FreeBSD project
if I remember correctly. Tomsrtbt uses it (entire os on a floppy) and it's
pretty good. Got read, set,if,for,until,while,case, commandline history and
completiion and so forth.)

(:-)

--
Later, Alan C
You can find my email address at the website: contact.html
take control of your mailbox ----- elrav1 ----- http://tinyurl.com/l55a
Nov 13 '05 #49

"Alan Connor" <zz****@xxx.yyy> wrote in message
news:RC***************@newsread4.news.pas.earthlin k.net...
On 06 Oct 2003 22:23:36 -0700, Micah Cowan <mi***@cowan.name> wrote:


Alan Connor <zz****@xxx.yyy> writes:
On Tue, 7 Oct 2003 03:24:01 +0000 (UTC), Richard Heathfield <do******@address.co.uk.invalid> wrote: >
>
> Alan Connor wrote:
>
>> From what I've read, I honestly don't see the need for anything BUT C >
> C is fine for all your programming needs (if you like C, that is!), right up > until you have to do something that doesn't work in much the same way on > all machines. At that point, you have to start using platform extensions. > But that's okay, because any platform extension worth its salt has C
> bindings anyway.
>

Good to know that. I aspire to a Linux distro that uses nothing but straight ANSI C and shell scripts.


I don't believe it's possible to implement typical shells in
straight ANSI C without extensions, so this could be a
problematic goal.

-Micah


Most pipe dreams are "problematic" :-)

I really don't know what you mean by "extensions", although I will read up
on it in the FAQ asap.


"Extensions" are additional nonstandard language constructs
(e.g. keywords, modified versions of standard functions, etc.)
which an implementation might provide for access to platform
specific feature of the host system. C can also be 'extended'
by supplying platform specific libraries with a C implementation,
e.g. the Windows API supplied with compilers for Windows.

-Mike
Nov 13 '05 #50

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

Similar topics

3
by: William C. White | last post by:
Does anyone know of a way to use PHP /w Authorize.net AIM without using cURL? Our website is hosted on a shared drive and the webhost company doesn't installed additional software (such as cURL)...
2
by: Albert Ahtenberg | last post by:
Hello, I don't know if it is only me but I was sure that header("Location:url") redirects the browser instantly to URL, or at least stops the execution of the code. But appearantely it continues...
3
by: James | last post by:
Hi, I have a form with 2 fields. 'A' 'B' The user completes one of the fields and the form is submitted. On the results page I want to run a query, but this will change subject to which...
0
by: Ollivier Robert | last post by:
Hello, I'm trying to link PHP with Oracle 9.2.0/OCI8 with gcc 3.2.3 on a Solaris9 system. The link succeeds but everytime I try to run php, I get a SEGV from inside the libcnltsh.so library. ...
1
by: Richard Galli | last post by:
I want viewers to compare state laws on a single subject. Imagine a three-column table with a drop-down box on the top. A viewer selects a state from the list, and that state's text fills the...
4
by: Albert Ahtenberg | last post by:
Hello, I have two questions. 1. When the user presses the back button and returns to a form he filled the form is reseted. How do I leave there the values he inserted? 2. When the...
1
by: inderjit S Gabrie | last post by:
Hi all Here is the scenerio ...is it possibly to do this... i am getting valid course dates output on to a web which i have designed ....all is okay so far , look at the following web url ...
2
by: Jack | last post by:
Hi All, What is the PHP equivilent of Oracle bind variables in a SQL statement, e.g. select x from y where z=:parameter Which in asp/jsp would be followed by some statements to bind a value...
3
by: Sandwick | last post by:
I am trying to change the size of a drawing so they are all 3x3. the script below is what i was trying to use to cut it in half ... I get errors. I can display the normal picture but not the...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

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.