why still use C?

J

John Bode

Alan Connor said:
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 :)

No one language is universally best at everything. There are tasks
for which C is not the best choice. It would not be my first choice
for a graphical client, for example.
 
A

Alan Connor

Alan Connor said:
First, a 'prompt' will not typically accept machine language,
but interpret mnemonic 'commands' which are submitted to and
acted upon by the provider of such a prompt (typically
an operating system).


Dan has already pointed out my oversight regarding interpreted
languages. But aside from that, I still stand by what I said.

I don't need to type in, e.g. printf("Hello") etc. to run a
compiled C program.

-Mike

You lost me, Mike, and a ways back, I think.
 
A

Alan Connor

No one language is universally best at everything. There are tasks
for which C is not the best choice. It would not be my first choice
for a graphical client, for example.

Well this will work out well then, because I am not into the GUI at all.
 
M

Mike Wahler

Alan Connor said:
You lost me, Mike, and a ways back, I think.

Doesn't really matter, since we're not talking about C anymore
anyway. :) I'll try again: I'm saying that with a compiled language
such as C, once the program has been translated into executable
form, the source text is unnecessary for it to be executed.
Contrast an "interpreted" language, where the source is parsed
every time it's run. I suspect the "runtime" of the interpreter
is what you're referring to with "prompt", where I jumped to
the conclusion that you meant "operating system's command prompt".
Sorry for any confusion.

-Mike
 
M

Mike Wahler

Alan Connor said:
Well this will work out well then, because I am not into the GUI at all.

"GUI" is not the only thing that C is not best suited for, it's
only of of them. E.g. text parsing *can* be done with C, but
many feel that something like Perl is more suited to it. Darn
near "anything" can be done with C (which imo is a big reason
for its popularity), but many tasks are more quickly and "easily"
done with some other language(s). YMMV.

We're just advising you to not limit yourself to one or two
tools. Get out to the hardware store and fill up that toolbox. :)

-Mike
 
A

Alan Connor

Doesn't really matter, since we're not talking about C anymore
anyway. :) I'll try again: I'm saying that with a compiled language
such as C, once the program has been translated into executable
form, the source text is unnecessary for it to be executed.
Contrast an "interpreted" language, where the source is parsed
every time it's run. I suspect the "runtime" of the interpreter
is what you're referring to with "prompt", where I jumped to
the conclusion that you meant "operating system's command prompt".
Sorry for any confusion.

-Mike


Okay, let me ask you this:

Would it be practical to run an entire OS (or the vast bulk of it) with
an interpreted language?


-------------------------------------------------------------------------
Alan Connor said:
Well this will work out well then, because I am not into the GUI at all.

"GUI" is not the only thing that C is not best suited for, it's
only of of them. E.g. text parsing *can* be done with C, but
many feel that something like Perl is more suited to it. Darn
near "anything" can be done with C (which imo is a big reason
for its popularity), but many tasks are more quickly and "easily"
done with some other language(s). YMMV.

(I prefer sed and other utilities and the shell for text editing,
and would learn AWK before Perl, any day.)


We're just advising you to not limit yourself to one or two
tools. Get out to the hardware store and fill up that toolbox. :)

-Mike

One step at a time, Mike, although there is no disputing the wholesomeness
of that advice.

But I may decide to use only C and Sh. :)
 
T

Todd Stephens

gswork wrote in article said:
Sometimes i wonder if *nix programmers will ever use anything but c
and shell... (ah, of course they use other languages - but sometimes
it doesn't seemt that way).

Shell? Blech. I see most *nix programming moving towards Perl and Python,
with Python being my favorite of the two. Heavy text parsing is better
under Perl, but Python to me is far more versatile. Perl is just like
shell on steroids anyway.
 
M

Mike Wahler

Alan Connor said:
Okay, let me ask you this:

Would it be practical to run an entire OS (or the vast bulk of it) with
an interpreted language?

We're really way off topic now. I've sent you an email.

-Mike
 
A

Alan Connor

And a cryptic one, at that. I can't wait for it to fade a way, replaced
by more sensible tools.

Or at least offer itself as a complete *substitute* for the shell.
 
T

Todd Stephens

Alan Connor wrote in article
Or at least offer itself as a complete substitute for the shell.

Now there's a thought. I wonder how far off a Perl shell is. With syntax
that makes tcsh look like QBasic.
 
P

Peter Nilsson

Alan Connor said:
Would it be practical to run an entire OS (or the vast bulk of it) with
an interpreted language?

Although Java is not an operating system per se, it could possibly
come close.

Also, languages like Forth (which is an operating system in its own
right) sit somewhere between 'compiled' and 'interpreted'.
 
C

cody

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?

i see you have very much problems with people who are criticize your
favourite programming language.
when you have a problem with that nobody forces you to discuss here with us.
Obviously your knowledge of C is minimal.

what makes you believe that?
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?

dont be childish. i didn't troll so you shouldn't do this either.
when you feel my grammar or punktuation are wrong please point out the
passage and tell my what was wrong.
i'm german and my english is still not perfect.
Why should we care about your obviously illogical feelings?

prove that my thaughts are illogical.
C existed
long before C++ did, and is and was extremely successful.

the same is true for forth,fortran,cobol,pl/1 but does that mean it is
reasonable
to use these languages today?
It is the
most portable programming language in the world.

that is a fact i already learned in this discussion. and your first
argument.
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.

what is wrong with comparing languages?
Discussions of the relative merits of various programming languages
belong in 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.
 
C

cody

pieces of the application where speed really matters you can still use
Suck it and see.
?

int main(void)
{
const int new = 6; /* I rest my case */
return 0;
}

i though in standard C, there isn't such a thing like "const" you can only
use macros to fake them.
Poor baby.

void foo(struct MyStruct struct){}

in C you cannot omit the keyword "struct". when it compiles without "struct"
you probably using a C++ compiler.

Yes, there is. C is simple,
agreed.


agreed.

and very very fast. Those are important qualities.

not faster than C++. why should it?
but note that C++ is /not/ available on anything like as many
target platforms as C is.

that is true.
 
C

Chris Hills

cody said:
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++ doesn't fit on to many targets.
i don't get it why people program in C and faking OOP features(function
pointers in structs..) instead of using C++.

I don't understand either...
are they simply masochists

probably.


C is good for Modular programming. In many ways there is little to
choose between modular and OO programming.



/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/\
/\/\/ (e-mail address removed) www.phaedsys.org \/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
 
C

cody

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.

there should be no difference between the calls of

class A{ public: static void a(){ } }

and

void a(){}
C has constants. We usually use typedefs rather than struct
and enum tags.

is "const float PI=3.14" possible in plain C?
 
C

cody

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.
;)


agreed :)
 
C

cody

i don't get it why people program in C and faking OOP features(function
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.


so why is objective C used my nobody? except you maybe :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top