Why do you like C more than other programming languages?

I

istillshine

There are many languages around: C++, JAVA, PASCAL, and so on. I
tried to learn C++ and JAVA, but ended up criticizing them. Is it
because C was my first programming language?

I like C because, comparatively, it is small, efficient, and able to
handle large and complex tasks.

I could not understand why people are using and talking about other
programming languages.
 
S

santosh

There are many languages around: C++, JAVA, PASCAL, and so on. I
tried to learn C++ and JAVA, but ended up criticizing them.

Then you are probably prejudiced. Each language has certain merits and
demerits. You must try not to approach other languages from a C point
of view and vice versa. You will likely end up judging them unfairly or
inappropriately.
Is it because C was my first programming language?

No. It's probably because you are, despite what you might tell yourself,
probably looking to criticise.
I like C because, comparatively, it is small, efficient, and able to
handle large and complex tasks.

I could not understand why people are using and talking about other
programming languages.

Because some types of programming are made more efficient by languages
specifically meant for them. C is a general purpose language and while
it can theoretically be programmed to do any computation possible on a
Turing machine, many tasks are rendered easier to accomplish with
specific languages. You will appreciate this if you attempt widely
varied programming tasks.
 
W

Walter Roberson

There are many languages around: C++, JAVA, PASCAL, and so on. I
tried to learn C++ and JAVA, but ended up criticizing them. Is it
because C was my first programming language?
I could not understand why people are using and talking about other
programming languages.

One uses the best tool for the task at hand.

At work, these days I mostly use two programming languages,
MATLAB and Maple.

MATLAB has been designed to provide interactive prototyping of a mix of
array operations and graphics; it is suitable for the needs of my major
task because that major task involves R&D of a package for visualizing
the results of performing various mathematical operations upon data
sets. Formal design is not especially practical in our environment,
as we change our mind several times a day about what we're trying to do,
as our experiences or further thoughts or additional papers tell us
more about what does or does not work, so a prototyping language is
appropriate for the task. When we've figured out what we want done
and how it should be done, a team will take it over and re-write it
in a structured language such as C or C++.

Maple I use to compute symbolic formulae. It has an extensive
library of symbolic manipulation routines; it would be completely
impractical for us to use C to write routines to do complicated
symbolic integration. No point in re-inventing the wheel!
I don't use Maple for any kind of hard-core numeric evaluation
of data: I use it to figure out good ways to express formulae.
For example, for solving simultaneous non-linear equations
and then finding a compact form for expressing the parametric
form of the intersection.
 
R

Ron Ford

One uses the best tool for the task at hand.

At work, these days I mostly use two programming languages,
MATLAB and Maple.

MATLAB has been designed to provide interactive prototyping of a mix of
array operations and graphics; it is suitable for the needs of my major
task because that major task involves R&D of a package for visualizing
the results of performing various mathematical operations upon data
sets. Formal design is not especially practical in our environment,
as we change our mind several times a day about what we're trying to do,
as our experiences or further thoughts or additional papers tell us
more about what does or does not work, so a prototyping language is
appropriate for the task. When we've figured out what we want done
and how it should be done, a team will take it over and re-write it
in a structured language such as C or C++.

Maple I use to compute symbolic formulae. It has an extensive
library of symbolic manipulation routines; it would be completely
impractical for us to use C to write routines to do complicated
symbolic integration. No point in re-inventing the wheel!
I don't use Maple for any kind of hard-core numeric evaluation
of data: I use it to figure out good ways to express formulae.
For example, for solving simultaneous non-linear equations
and then finding a compact form for expressing the parametric
form of the intersection.

I thought Walter might express an affinity to perl, which I've seen him
post when asked a question that needed a language appropriate to perl's
purview.

You never really can get away from C, try as you will. I have affairs with
syntaxes but find the influence of C is always right under the hood. In my
syntax of choice, fortran, they defined an ISO_C_BINDING last standard
around. It's public comments now for the new standard, so it's getting a
little thick there.
 
D

Dand

There are many languages around: C++, JAVA, PASCAL, and so on. I
tried to learn C++ and JAVA, but ended up criticizing them. Is it
because C was my first programming language?

I like C because, comparatively, it is small, efficient, and able to
handle large and complex tasks.

I could not understand why people are using and talking about other
programming languages.

I think on any low-level tasks its by far the best choice and in many cases
the only real alternative to assembly.

As for high-end PC software, I would probably say no. Try programming even a
simple windows API ap and you will see why, 1000 lines of code just to get
one window to appear.
 
J

jacob navia

Dand said:
I think on any low-level tasks its by far the best choice and in many cases
the only real alternative to assembly.

As for high-end PC software, I would probably say no. Try programming even a
simple windows API ap and you will see why, 1000 lines of code just to get
one window to appear.


This is not true.

You can use the windows API in C. Many compilers under windows
will generate a windows skeleton for you. lcc-win, for instance
needs 2-3 clicks in a "wizard" and you get all the basic framework
written for you.

The advantage of using the windows API is that you are NOT tied to
a specific library and you get the advantage of using and reusing
the same code in all versions of windows.

I started writing the IDE of lcc-win under windows 16 bits. It was
ported to 32 bits, then to 64 bits with much less effort than it
would have been if I was dependent on a third party library.

Take MFC for instance. The last version of it dated from
1998. Recently (some months ago) Microsoft decided to bring a new
update, the first since 1998. If you program using MFC you
would have been forced to use the API anyway since the library
wasn't updated.

Other libraries like Borland's or the hundreds of libraries that
were developed have all disappeared. Programming in C with the
raw API is a guarantee that your code will survive.
 
B

Bartc

There are many languages around: C++, JAVA, PASCAL, and so on. I
tried to learn C++ and JAVA, but ended up criticizing them. Is it
because C was my first programming language?

I like C because, comparatively, it is small,

C is deceptively small. It's so small that some ten years on hardly anyone
has managed to create a full compiler for the latest standard... and some
compilers have lists of options that are bigger than your entire
application!
efficient

It's not bad, but when I needed speed I had to use asm code.
, and able to handle large and complex tasks.

Yeah, it's able to.

I think it wasn't for it's #define statement to program your way of trouble,
C's usefulness would be seriously diminished.

In fact #define may well be the most important feature in C. (Although,
#define may also have hindered C's normal development as a language:
everytime someone proposes a genuine improvement, someone else will come up
with an ugly #hack, sorry, #define, macro to do the same job nearly, but not
quite, as well.)
 
W

Walter Roberson

I thought Walter might express an affinity to perl, which I've seen him
post when asked a question that needed a language appropriate to perl's
purview.

Yes, I use perl when I have something perl-ish to do. However,
my job duties changed a few years ago, from systems work to R&D,
so it is now far less common that perl is the right tool for
what I am doing these days; it was a good tool when I needed to do
practical text extraction and reporting such as using SNMP probes
to detect whether someone had illicitly moved a device to another port
in our network.
 
K

Kaz Kylheku

There are many languages around: C++, JAVA, PASCAL, and so on. I
tried to learn C++ and JAVA, but ended up criticizing them. Is it
because C was my first programming language?

No, that's not the reason. It's because if those are the alternatives you are
looking at---C++, Pascal, Java---then of course C looks damn good.
I could not understand why people are using and talking about other
programming languages.

Maybe because there are languages in which you can write things which would
require ten to one hundred times as much syntax in C, not counting the
code in the libraries that would have to be supplied to actually make that
syntax work.

Are you retarded or what?
 
L

Linonut

* Dand peremptorily fired off this memo:
I think on any low-level tasks its by far the best choice and in many cases
the only real alternative to assembly.

As for high-end PC software, I would probably say no. Try programming even a
simple windows API ap and you will see why, 1000 lines of code just to get
one window to appear.

Huh? Try gtk+, then.

I like C++ a lot, but have lately taken to writing stuff in C and then
wrappering it.

Python is not bad, though indenting the wrong lines of code by accident
can screw things up.

Perl is nice for word manipulations.

Ruby, well, I haven't used it enough, but....

I still prefer C/C++ -- the compile-time type-checking is very nice.
 
L

Linonut

* jacob navia peremptorily fired off this memo:
You can use the windows API in C. Many compilers under windows
will generate a windows skeleton for you. lcc-win, for instance
needs 2-3 clicks in a "wizard" and you get all the basic framework
written for you.

The advantage of using the windows API is that you are NOT tied to
a specific library and you get the advantage of using and reusing
the same code in all versions of windows.

Yeah, but, dude! It's /Windows/!!!
Other libraries like Borland's or the hundreds of libraries that
were developed have all disappeared. Programming in C with the
raw API is a guarantee that your code will survive.

At least until Microsoft gets Windows Presentation Foundation working.

Or you can adopt cross-platform GUI library's such as Qt, gtk, Fox,
Tk/Tcl, or wxWidgets.
 
H

Harold Aptroot

At least until Microsoft gets Windows Presentation Foundation working.
</snip>

If they decide to deprecate the whole raw windows API then programmers will
just ignore that version of windows and normal users will try to avoid it
because none of the programs they like work on it. In short, it will fail
even faster and more completely than Vista
So why would they do that? It'll only cost them money
 
J

jacob navia

Harold said:
</snip>

If they decide to deprecate the whole raw windows API then programmers
will just ignore that version of windows and normal users will try to
avoid it because none of the programs they like work on it. In short, it
will fail even faster and more completely than Vista
So why would they do that? It'll only cost them money

Exactly.
C# would not work, neither would .net. They all use at the end
the windows API.

Yes, They will bring new stuff, but... did you know?

I installed a pre-release of VISTA more than a year ago,
and what did I see in C:\ ?

AUTOEXEC.BAT
CONFIG.SYS

Microsoft has sometimes a funny attitude towards compatibility but
it has greatly contributed to their success.
 
B

Bartc

Richard Heathfield said:
Dand said:



You are exaggerating by a very, very, very great margin. To get one window
to appear, you need only call CreateWindow (or, if it is already created,
ShowWindow) - one line of code. If it is the *first* window of its type to
appear, then you must first set up an appropriate window class (not the OO
kind) - i.e. define and populate a reasonably small struct - and then call
a function to register the class.

A C program to show one window, and enter a message loop, is about 90 lines,
according to the skeleton code produced by Dev-C++.

So Dand was only exaggerating by an order of magnitude; you on the other
hand were exaggerating the other way by two orders of magnitude..
 
R

rahul

There are many languages around: C++, JAVA, PASCAL, and so on.  I
tried to learn C++ and JAVA, but ended up criticizing them.
I like C because, comparatively, it is small, efficient, and able to

At the same time, C is so small that you have to rely on third-party
libraries(graphics, networking, threading etc), losing portability in
the process. I am not trying to demean C but when you are considering
a language, you have to consider both sides of the coin.
handle large and complex tasks.
Agreed. If system as large and complex as Linux Kernel and Windows can
be written in C, pretty much anything can be written in C. But the
point is, how convenient is it going to be writing that "anything".
I could not understand why people are using and talking about other
programming languages.
You won't use a chain-saw to drive a nail, will you? It isn't about
what you can possibly do something in a particular language but its
about how easy it is. Consider perl - a text processing program
written in perl is way, way shorter than the equivalent written in
C(generally). But no one would consider writing a device driver in
perl.

At the end of the day, its not the language but the programmer.
 
C

CBFalconer

copx said:
.... snip ...

.... snip ...

If Microsoft, Borland, the companies behind GCC etc. wanted
too they could have released a fully conforming C99 compilers
in less than a year. There was and is simply no interest /
profit in doing that.

The basic reason is that, back in the 1990 era, compilers sold for
considerable dollars. Today they are generally free. This greatly
reduces the profit incentive.
 
N

Nick Keighley

maybe. Try
- a global substitution in a large code base.
(new -> NEW_) [perl]
- drawing a picture [python]
- querying a database [SQL]

even things like socket programming are cleaner in say
Python than C. Yes C can bind to libraries that do
these things but it can't do them out of the box.

[prediction 1: someone will submit code to do the above]
[prediction 2: "yes but XXXX can only do these things because of the
libraries" <yawn>]

Uou need to read a lisp book.
C is deceptively small. It's so small that some ten years on hardly anyone
has managed to create a full compiler for the latest standard...

I don't think it's the size that causes the problem. I think
there isn't enough demand for the new standard. The original
C89 has plenty of compilers. I reject your "C is deceptivly small"

and some
compilers have lists of options that are bigger than your entire
application!
:)




It's not bad, but when I needed speed I had to use asm code.

really? What was you application (if you're allowed to say)

Yeah, it's able to.

yup. Eg Unix.

I think it wasn't for it's #define statement to program your way of trouble,
C's usefulness would be seriously diminished.

I find this surprising

In fact #define may well be the most important feature in C.

I find this *really* surprising!
(Although,
#define may also have hindered C's normal development as a language:
everytime someone proposes a genuine improvement, someone else will come up
with an ugly #hack, sorry, #define, macro to do the same job nearly, but not
quite, as well.)

99% of my uses for #define fall into two groups

- simple constant definitions
- defines for #ifdef

and I try to keep the second group to a bare minimum.

Another 0.9% comes from hiding __LINE__ and __FILE__
in diagnostic calls.

Otherwise I don't heavily use #define. I don't like code
that does.

I have defined so huge macros that effectivly acted
as templates. Given my time over again I'd probably
have generated the code (it would have made debugging easier).
 
C

Chris H

CBFalconer said:
The basic reason is that, back in the 1990 era, compilers sold for
considerable dollars. Today they are generally free.

Generally they are not free. It is just one or two are.
This greatly
reduces the profit incentive.

GCC is no more C99 than any other others and there is no profit
incentive for GCC

The reason why [almost] no one has done a fully c99 compiler is because
there is no business case for it. There are not enough significant
users who want C99

If there were 99% of the worlds compilers would be C99 by the end of the
year.
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top