Re: why still use C?

From: Mike Wahler (mkwahler_at_mkwahler.net)
Date: 10/09/03


Date: Thu, 09 Oct 2003 20:36:03 GMT


"cody" <dont.spam.me.deutronium@gmx.de> wrote in message
news:bm1fk8$hpt5f$1@ID-176797.news.uni-berlin.de...
> that's what i call an answer :)
>
> > First, I will initially take at face value your statement
> > that you are not trolling. Let's see what happens after
> > you read the following:
> >
> > I'm writing this because you probably do not realize
> > that Mr. Klein is one of the select few people here
> > who are the most highly qualified to help people to
> > learn and work with with the C language, as well as
> > to explain its various strengths and weaknesses, and
> > to help you decide if C is the most appropriate tool
> > for a particular task.
>
> i didn't know who he was

A good reason to "look before you leap" :-)

>i only knew how he reacted to my
> question and his answer seemed to me a bit aggressive.

Many new visitors here get that impression.
People here have a wide variety of personalities.
Try to see past that, and I think you'll find this
place a good source of quality information.

>
> > > 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.
> >
> > Jack replied as he did because he *knows* that:
> >
> > 1. C does not assign an attribute of "normal" or "abnormal"
> > to functions.
> >
> > 2. C does not define anything called a "static method" or a
> > "method".
>
> i mean't "why C instead of C++". i assumed all C programmers would use C++

Why?

> and so i said that this is no problem since in C++ they cann still use
> c-functions

Nobody said that using C++ is a problem. Some said that
they're unable or unwilling to use it, for various reasons.

> or static functions as they are the same as c-functions, basically.

Functions declared as 'static' share the same characteristics
in C and C++, with one exception:

C++ defines a construct 'static member function' which has
no counterpart in C.

>
> iam sorry if i didn't made that clearer.
>
> > 6. C does indeed specify a keyword 'const' and its effect
> > when applied. A constant can also be expressed with a
> > macro.
>
> i didn't knew that.

Again, "Look before you leap" :-)

>
> > Another logical question, again probably designed to
> > cause to to stop and think about what you wrote.
> > No personal attacks. (Despite the belief to the
> > contrary by many, ignorance is not a character flaw,
> > it's simply a lack of education about one or more
> > subjects, easily rectified, and without any reason
> > for shame or embarrassment.)
>
> iam not an ignorant.

"Ignorant" is not a noun. It is an adjective, used to
describe a person's level of knowledge about a given
subject. As in, "I'm ignorant of the exact arrival
time of the train, since I don't have a schedule."
Or, "I'm ignorant about auto repair, I've lever learned
it." "Ignorant" means "Don't know."

Ignorance is not a character flaw. But in my opinion,
denial of it when it exists (which is what you seemed
to be doing), is.

>why do you think i asked this question?

To reduce your ignorance about C and C++,
I would hope.

> i only wanted reasons why people still use C. ok now i have got enough
> reasons.
>
> - C is simpler than C++
> - some people don't like OOP
> - some people don't want to learn OOP
> - some projects don't need OOP

OOP is not the only reason people use C++. C++
can be used with many other programming styles.

So make those last three:
  - some people don't like C++
  - some people don't want to learn C++
  - some projects don't need C++

> - some platforms dosn't provide a proper C++ compiler.
>
> i didn' know that i would create such a large discussion.

Now you know. :-)

>
> > >Or is your wisdom to be
> > > > inferred by your lack of proper capitalization, punctuation, and
> > > > grammar?
> >
> > Perhaps this remark is justified, perhaps not. It seems
> > that your irrefutable ignorance about C, combined with
> > your expression of conclusions without premises might
> > have caused him to associate your nonfluency with English
> > with your level of wisdom.
> >
> > I can understand this reaction, since when you wrote your
> > first post, (in this English-speaking newsgroup), you did not
> > indicate that English is not your native language, and
> > unfortunately, a significant number of people whose native
> > language *is* English post here with spelling, grammar,
> > etc. far worse than yours.
>
> so what do you advise? should i write in the subject of my next posting:
>
> "warning! german poster with probably wrong capitalization, punctuation
and
> grammar"

Actually, yes, something like that. But keep the subject
line only about the actual question. But then in the body
of your message, write a short note at the top:

"My native language is not English, please excuse errors,
 and ask if my message is not clear."

Many other non-English speakers post here, and this is
what most of them do.

If you post here very long, people will get to know you,
and this 'warning' will not be necessary every time.

>
> > The content of your post combined with the poor English
> > probably caused him to believe you were an American
> > or British troll.
>
> i didn't know that my english is so bad. i would be very grateful if
> somebody give me a hint what is wrong with my grammar.

Actually, after reading this, I believe your grammar seems
to have already improved. However, your capitalization needs
much work, though. :-)

Compare:

I didn't know that my English is so bad. I would be very
grateful if somebody gave me a hint about what is wrong with
my grammar.

You don't need to be perfect, nobody is. Just do the best
you can.

>
> > I understand very little German, but my few halfhearted
> > attempts to learn it quickly informed me that many more
> > words are capitalized in German than in English; it seems
> > that every noun is capitalized (only my impression, I'm
> > not certain.)
>
> that is correct all nouns, proper names and beginnings of a sentence are
> capitalised.

In English, capitalize the first word of every sentence,
and all pronouns (for example "I") and proper nouns.

>
> > If your defense of your English is that
> > you're German, I would have expected too many capital
> > letters, not none at all. :-)
>
> you underestimated my lazyness :-[=]

Yes, sometimes I get lazy, too.

>
> >
> > My brief 'learning' experiences with German also indicates
> > that it uses punctuation as well. Is it true that the
> > only punctuation characters used consistently are periods
> > and apostrophes, and that commas are optional, as your
> > messages seem to show?
>
> some commas in german are optional.

English has firm rules about commas, but hardly anyone
understand them all or agrees about them. I try to
use them where, if I were speaking, I would pause.
It seems to work for me.

> Is it true that sentences are begun in lower case?
>
> neither in english nor in german but my shiftkey is broken.
> i brough is to the workshop last week but it is still not ready :)

But how did you write "C", "C++", "OO", and "OOP" in
your messages?

>
> > 1. Why do you seem to feel that OOP is the solution to
> > all programming issues? Have you blindly believed
> > the 'mass media'?
>
> no, but you can use C++ without programming OOP sinc C++ is a hybrid
> language
> which supports various programming paradigms, including structured,oop,
> functional and more.

Yes. But then why did you write above:

> i only wanted reasons why people still use C. ok now i have got enough
> reasons.
>
> - C is simpler than C++
> - some people don't like OOP
> - some people don't want to learn OOP
> - some projects don't need OOP

Three out of four imply that C++ == OOP and nothing else,
which is simply not true.

So it seems to me that either you still believe this,
or have changed your mind.

By the way, C++ does not have direct support for functional
programming. What you probably mean is 'procedural programming'.

>
> > 2. OOP can be done in virtually any language. Why do
> > you feel that using a given language's available features
> > to implement OOP is somehow 'fake'?
>
> oop need language support at least to a certain level.

No. Whatever built-in support is not there can be
written using existing language features in virtually
any language. It could even be done in assembly language,
especially one which has macros, if you have enough time. :-)

>when people programm
> oop in C then it is certainly faked.

No. They use the language features which are available
to program in whatever paradigm they want. This does
not make it 'fake'. C++ is often preferred when doing
OOP, because of its built-in features which support it,
and help prevent making mistakes.

>
> > 3. Why do you believe that the insertion of a pointer to
> > a function into a structure causes the use of that
> > structure and its function pointer member(s) to become
> > a component of OOP or OOP itself?
>
> it was just an example how some people fake oop in c.

It's not 'fake'. Also, a function pointer inside a struct
can be (and is) used for other things besides OOP.

>
> > 4. Are you unaware of the several other concepts and
> > techniques which comprise OOP?
>
> yes. i have good knowlegde about c++,c# and java. a OO-language needs
> classes,ctors,dtors,virtual,abstract,static methods and access modifiers.

Some of those things people will say must exist as built-in
features in order to call a language a "true" or "pure" OO
language. There is always much debate about this, which I
doubt will ever result in any consensus.

But all of those concepts can be implemented in any language
at all. It often requires more work, but it can be (and is)
done.

> i consider operator overloading as optional.

It's a very useful tool, but is not an OO concept.
I also often see it overused and abused.

>
> does C++ have a concept of sealed classes? that are classes which cannot
be
> subclassed.

No. It doesn't need them. If you want to talk about
that further, post a question about it to comp.lang.c++

Many others have already asked about and discussed this
issue in that newsgroup, try reading the older messages
about it.

>
> > Why do you believe that C++ is the only language which
> > has features and constructs which directly support OOP?
>
> surely not. it was just an example cos c++ is the successor of c.

Not really. C++ was derived from C, but is not at all
intended to replace it.

>
> > You probably have a tool box in your garage. What's
> > inside? Just a hammer? Just a screwdriver? I suspect
> > it contains a variety of useful tools. This concept
> > does not disappear in the programming world.
>
> thats what i meant. why use a tool or another when you have a tool which
> combines both?

How large or heavy is the combined tool? How much
does is cost? I'd use the easiest to use tool that
does the job. C++ is a very large language compared
to C, and much more difficult to learn.

> why use C when you can use C++ which contains C? thats what i meant.

Another misconception. C++ does *not* contain C. It has
many similar things, but many of them which *look* exactly
the same, will *behave* differently in each language, often
very subtly. This misconception is a source of many bugs
and incorrect programs (and arguments. :-) )

> you can
> use c++,
> nobody will force you to use its additinal features.

But you must use the language itself, which is *different*
from C. The C standard library functions are all available,
but that's not the same thing as the *language*, which is
*not* the same.

>
> > > prove that my thaughts are illogical.
> >
> > I believe I've done that above. I've done this with the
> > intention of helping you. I'm curious as to how you will react.
>
> iam indeed grateful as you pointed out that my question was misunderstood
> here.

Perhaps. But we all know that you have misunderstood what
C and C++ are and are not. We tried to tell you this.

> i was wondering why some people didn't understand it, now i know why.

It doesn't really matter why, but you didn't understand
about C *or* C++. We tried to tell you this.

>
> > Are you saying that when a programming language reaches a
> > certain age it becomes obsolete or 'unreasonable to use'?
> > Why?
>
> no, i'm not saying that.

Your previous comments seem to indicate otherwise.

> > Have you never considered the *domain* of a particular
> > language? Are you unaware of the concept of "existing code
> > base?" Simple economics?
>
> nobody will throw away C. it still exists in C++

No, absolutely not.

>as C++ is fully backward
> compatible

No, absolutely not.

>(at least C94 if iam correctly informed)

You have not been correctly informed.

>
> > Would you have people throw away perfectly good code
> > which *already performs its task satisfactorily*
> > and write it all over again from scratch? Expend the
> > resources for design alterations often necessary when
> > moving to a new language? For testing and debugging?
> > For the extra hardware probably required for the necessary
> > "run in parallel" period? In a pointless, misguided quest
> > to be "modern?"
>
> surely not.

Your previous comments seem to indicate otherwise.

>
> > Are you suffering from the misconception that any given
> > single language is or can be the solution to all programming
> > issues?
>
> surely not.

Your previous comments seem to indicate otherwise.

>
> > If you want to discuss or learn about C, this is the place.
> > If you want to criticize it or compare it with other languages,
> > this is not the place.
>
> i wanted to learn about C why people still use it and now i know why :)

Much more than you wanted to hear, I suspect. :-)

>
> > There. I feel better now. :-)
>
> me to..
>
> now i know why iam always misunderstood here: it certainly is my bad
grammar
> :-)

That is only a small part of it. Most of us understood
you well enough to know what you were saying. You *definitely*
did *not* understand what C and C++ are and are not.
That's not a crime, or anything to be ashamed about,
all you need to do is learn. The best in the business
read and post here, and you can learn much about C from
them. I certainly have, and continue to learn more every
day. The same is true about C++ in the newsgroup comp.lang.c++

Good luck, and have a nice day.

-Mike



Relevant Pages

  • Re: DirectX in HLA
    ... I guess that you have a great knowledge of DirectX ... > understanding by looking at them in assembly language... ... > actually represents, really, is a means to "undo" the OOP so ... > is NOT an "OOPL" (object-orientated programming language), ...
    (comp.lang.asm.x86)
  • Re: DirectX in HLA
    ... I guess that you have a great knowledge of DirectX ... > understanding by looking at them in assembly language... ... > actually represents, really, is a means to "undo" the OOP so ... > is NOT an "OOPL" (object-orientated programming language), ...
    (alt.lang.asm)
  • Re: F is evil (was: XML::LibXML UTF-8 toString() -vs- nodeValue())
    ... So Futfizes symbols by accident. ... language, no matter if the programming language makes it easy or not. ... Sometimes this is because they don't speak English too well, ...
    (comp.lang.perl.misc)
  • Re: Can a low-level programmer learn OOP?
    ... I have also found some articles profoundly critical of OOP. ... If it does, you'll find it easier, else choose another programming style. ... Starting in 1999 I got back into programming, but the high-level-ness of PC programming and the completely foreign language of OOP repelled me. ... Dynamic languages like Smalltalk, Python or Ruby are much more lightweight in this area, and tend to favor a much more exploratory style - sketch a quick draft on a napkin, start coding, and evolve the design while you're coding. ...
    (comp.lang.python)
  • Re: For Henry to enjoy:
    ... Spoken language was the question Karla. ... based programming languages. ... English has been the undisputed lingua franca for the ... language taught in Russian schools, ...
    (soc.culture.baltics)

Loading