473,802 Members | 2,267 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why is C good??? any experts?

Hi,
I am new to C and curious to know some basic questions about C.
Why C is good?
In what way its better than any other languages?
If it is no longer a choice of programming language...why people still study
it?
And also its not an OO language either...is there any advantages in being
not an OO language?

I know one reason is that, IT started with C and so they are still using
them rather than changing it into new language.

Nov 14 '05
39 2865
Rob Thorpe <ro***********@ antenova.com> scribbled the following:
"Suresh" <gs*****@rogers .com> wrote in message news:<lE******* *************** @twister01.bloo r.is.net.cable. rogers.com>...
Hi,
I am new to C and curious to know some basic questions about C.
Why C is good?
In what way its better than any other languages?
I'm not sure that it is better than any other languages, but it has
certain advantages: * There are C bindings available for many libraries, probably more
than any other language.


People have been mistaking those bindings for the C language itself for
decades. I don't know if that counts as an advantage.

--
/-- Joona Palaste (pa*****@cc.hel sinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"We're women. We've got double standards to live up to."
- Ally McBeal
Nov 14 '05 #11
Joona I Palaste <pa*****@cc.hel sinki.fi> wrote in message news:<c6******* ***@oravannahka .helsinki.fi>.. .
Rob Thorpe <ro***********@ antenova.com> scribbled the following:
"Suresh" <gs*****@rogers .com> wrote in message news:<lE******* *************** @twister01.bloo r.is.net.cable. rogers.com>...
Hi,
I am new to C and curious to know some basic questions about C.
Why C is good?
In what way its better than any other languages?

I'm not sure that it is better than any other languages, but it has
certain advantages:

* There are C bindings available for many libraries, probably more
than any other language.


People have been mistaking those bindings for the C language itself for
decades. I don't know if that counts as an advantage.


It certainly doesn't for reading a newsgroup about it. It means
people ask all kinds of things that few on the group know and most
would be better looking elsewhere.
It also means that a lot of people think of nasty win32 SDK things
when they're thinking of C.
Nov 14 '05 #12

"Suresh" <gs*****@rogers .com> wrote in message
news:lE******** **************@ twister01.bloor .is.net.cable.r ogers.com...
Hi,
I am new to C and curious to know some basic questions about C.
Why C is good?
"Good" depends on context. There are some tasks for which C is most
definitely *not* the right choice.
In what way its better than any other languages?
Compared to many other languages, C is "small" (few keywords, relatively
simple syntax, etc.), meaning C compilers are relatively easy to write,
meaning C compilers are available for everything from mainframes to
microcontroller s. C is also very flexible, giving the programmer a wide
variety of tools to accomplish various tasks.
If it is no longer a choice of programming language...why people still study it?
Same reason people still study Fortran and COBOL -- there's a lot of legacy
code out there that needs to be maintained for whatever reason. It's almost
always cheaper to maintain an old program than to reimplement it in a new
language.
And also its not an OO language either...is there any advantages in being
not an OO language?

Mainly that the language is a little easier to learn (compared to something
like C++ anyway), and that the compilers are simpler to write. And not every
problem needs an object-oriented solution, anyway. There are cases for
which an object-oriented approach is overkill.
I know one reason is that, IT started with C and so they are still using
them rather than changing it into new language.


IT started long before C was around (whether it was called IT in those days
or not). What we consider IT probably started with COBOL.
Nov 14 '05 #13
"Suresh" <gs*****@rogers .com> wrote in message news:<lE******* *************** @twister01.bloo r.is.net.cable. rogers.com>...
Hi,
I am new to C and curious to know some basic questions about C.
Why C is good?
In what way its better than any other languages?
With few exceptions no programming language is either good or bad on
its own. Programmers can write good and bad code in any language out
there. The trick is to choose the appropriate language for the
application being developed. In a lot of cases where you want to have
good control over hardware and not have o deal directly with an
assembly language C is a good choice.
If it is no longer a choice of programming language...why people still study
it?
C is still widely used in many applications especially embedded
systems programming. As far as why is it often used to teach
programming, it is a fairly simple language to use for demonstrating
good programming practices and concepts so a lot of schools use it.
And also its not an OO language either...is there any advantages in being
not an OO language?
This is not exactly true. While C was not designed as an OO language
it is possible to implement virtually all of the functionalities of an
OO language such as Java or C++ in C. It is not as easy to do in some
cases and it would not make sense in all cases because it could make
the code somewhat convoluted. Where I work we do implement objects,
inheritence, polymorphism etc. in C when appropriate. This can help to
allow your code to be more reusable and fit more logically with an
OOAD approach (which we also use) than it might otherwise.

I know one reason is that, IT started with C and so they are still using
them rather than changing it into new language.


C was by no means the beginning of the programming languages. In fact
you can trace programming back as far as the 1800's (depending on who
you talk to maybe even farther).
Nov 14 '05 #14
On Fri, 30 Apr 2004, Suresh wrote:
Hi,
I am new to C and curious to know some basic questions about C.
Why C is good?
I feel it is a good language because it tends to have portable source
code, it is very mature, the library of standard functions is well defined
and understood, there is a wealth of code snippets and libraries
available and there are many programmers who know the language.

Additionally, as someone who comes from an assembly background, there is
something about C language that is intuitive for me. I have a certain
mindset and C language seems to mesh with it.
In what way its better than any other languages?
I would not say that it is better than any other language. Because it is a
mature language, the compilers for it have been around for a while. They
tend to generate code that is comparable to something most programmers
could do with hand assembly. Additionally, mixing assembly and C is
usually not very difficult. I can therefore write something in C, profile
it, find the hot spots, optimize them by hand in assembly.

I would not say that only C language has these features.
If it is no longer a choice of programming language...why people still study
it?
Moot. C language is still a language of choice.
And also its not an OO language either...is there any advantages in being
not an OO language?
Less overhead for small projects. How you design the program is different.
For someone who is used to procedural languages like C they might not take
to OO languages. Again, one strong reason to prefer one language over
another is because it just seems more intuitive.
I know one reason is that, IT started with C and so they are still using
them rather than changing it into new language.


Legacy code is a big reason why COBOL is still around. I would imagine
that there will be a need for C programmers to maintain old projects.
Currently, there are still new C projects being created. So C language
hasn't become a maintenance language yet.

--
Send e-mail to: darrell at cs dot toronto dot edu
Don't send e-mail to vi************@ whitehouse.gov
Nov 14 '05 #15
On Thu, 29 Apr 2004, E. Robert Tisdale wrote:
Chris Dutton wrote:
C is sometimes known as "portable assembler".
The key concept represented by this statement is that
C is closer to the machine that most other languages.


I don't know what that means.
Which "machine" is C "close to"?
Is C "farther" from machines that are not "close to"
the machine that C is "close to".
What sort of topology allows this sort of reasoning?


Have you never heard someone use the expression "close to" as a way of
saying "similar in attributes"? For example, Latin is close to Italian,
meaning that the structure of the Latin language shares many similarity
with the Italian language.

With assembly language there is a one to one correspondence to machine
language (unless we are talking about algebric assemblers). If something
is similar to assembly language then it is "close to" assembly language.
Because there is a one to one correspondence between assembly language and
machine language, it could be said that it is also close to machine
language or close to the machine.

For example, I will notice that certain statements in C language will
always produce the same machine language on a given machine. This is not
to say that for all C language there is a one to one correspondence with
machine/assembly language. How similar C code will be to the machine
language will differ for each compiler on each architecture.
It's possible to understand exactly what a C program is doing
because there isn't (necessarily) a lot of overhead going on.


People who claim to know "exactly what a C program is doing"
are almost never correct.


Depend who you are talking to. If you talk to Electrical Engineers,
people with a hardware design background or embedded programmers you will
find that they really do know what a C program is doing. Most of them will
code in C but optimize and debug in assembler.
You don't have to guess what other information the compiler
is including in order for things like polymorphism to work,


If you need to "guess" at these things,
you don't understand the programming language.


Strange, first you say that 'People who claim to know "exactly what a C
program is doing" are almost never correct.' and now you are implying that
people who understand a programming language don't need to "guess" at what
it is doing. So which is it?

--
Send e-mail to: darrell at cs dot toronto dot edu
Don't send e-mail to vi************@ whitehouse.gov
Nov 14 '05 #16
Neil Kurzman wrote:
CPUs execute Op-Codes. The CPU does not know about languages.
C gives you more control over what the CPU will get.
.NET and Java... are not under the Programmers control.
How is C more "under the programmers control" than .NET and Java?
C effectively the next step above Assembly.
What does that mean?
Java doesn't emit C code.
It gives more control over memory usage and hardware access.
Really?
Please show us an example of how C gives more control
over memory usage and hardware access.
You pay for the control with more responsibility.
More code to do the same task.
And you get to watch for buffer overruns and memory leaks.


What does that have to do with the hardware?

Nov 14 '05 #17
Darrell Grainger wrote:
E. Robert Tisdale wrote:
Chris Dutton wrote:
C is sometimes known as "portable assembler".
The key concept represented by this statement is that
C is closer to the machine that most other languages.
I don't know what that means.
Which "machine" is C "close to"?
Is C "farther" from machines that are not "close to"
the machine that C is "close to".
What sort of topology allows this sort of reasoning?

Have you never heard someone use the expression "close to" as a way of
saying "similar in attributes"? For example, Latin is close to Italian,

With assembly language


The correct term is *assembler*.
there is a one to one correspondence to machine language
(unless we are talking about algebraic assemblers).
Here are the first five lines of an assembler listing:

.file "main.c"
.text
.align 2
..globl loop
.type loop,@function

Please tell us
which machine language instructions correspond to these lines.
If something is similar to assembly language
then it is "close to" assembly language.
How is C "similar" to assembler?
Because there is a one to one correspondence
between assembly language and machine language, it could be said that
it is also close to machine language or close to the machine.
I don't dispute that
assembler *instructions* correspond to machine instructions.
For example, I will notice that certain statements in C language
will always produce the same machine language on a given machine.
I have noticed that certain statements in C language
will *not* always produce the same machine language on a given machine.
Generally, the emitted code depends upon context.
Different compilers emit different machine code
for the same C language statements.
Different options can cause the compiler to emit different machine code
for the same C language statements.
This is not to say that, for all C language,
there is a one to one correspondence with machine/assembly language.
How similar C code will be to the machine language
will differ for each compiler on each architecture.
How, then, can C language code be "close" to machine language code
on each of these different architectures?
Depend who you are talking to. If you talk to Electrical Engineers,
people with a hardware design background
I have a hardware design background.
or embedded programmers you will find that
they really do know what a C program is doing.
Most of them will code in C but optimize and debug in assembler.
Most of us don't do this anymore.
We use good optimizing compilers instead/
Strange, first you say that 'People who claim to know
"exactly what a C program is doing" are almost never correct.'
and now you are implying that
people who understand a programming language
don't need to "guess" at what it is doing. So which is it?


You need read the assembler listing emitted by you C compiler
to know exactly what your C program is doing.
The assembler will depend upon

1. the machine architecture,
2. the compiler and
3. the options that you chose to compile your program.

C programmers are notoriously bad at predicting
what assembler code will be emitted
when they port their programs from one platform to another.

Nov 14 '05 #18

"E. Robert Tisdale" <E.************ **@jpl.nasa.gov > wrote in message
news:40******** ******@jpl.nasa .gov...
With assembly language


The correct term is *assembler*.


God, I hate it when people said that. No, it is Assembly Language. The
assembler is the tool that converts it to machine code. Do you say
"compiler" instead of "C"?

Nov 14 '05 #19
Xenos wrote:
E. Robert Tisdale wrote:
With assembly language


The correct term is *assembler*.


God, I hate it when people said that. No, it is Assembly Language.
The assembler is the tool that converts it to machine code.
Do you say "compiler" instead of "C"?


According to the Free OnLine Dictionary Of Computing

http://wombat.doc.ic.ac.uk/foldoc/fo...embly+Language

Assembly Language

<language, robotics> (AL) A language for industrial robots developed at
Stanford University in the 1970s.

["The AL Language for an Intelligent Robot", T. Binford in Langages et
Methods de Programation des Robots Industriels, pp. 73-88, IRIA Press 1979].

["AL User's Manual", M.S. Mujtaba et al, Stanford AI Lab, Memo AIM-323
(Jan 1979)].

Nov 14 '05 #20

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

Similar topics

24
3618
by: matty | last post by:
Go away for a few days and you miss it all... A few opinions... Programming is a craft more than an art (software engineering, not black magic) and as such, is about writing code that works, first and foremost. If it works well, even better. The same goes for ease of maintenance, memory footprint, speed, etc, etc. Most of the time, people are writing code for a use in the *real world*, and not just as an academic exercise. Look at...
28
3312
by: David MacQuigg | last post by:
I'm concerned that with all the focus on obj$func binding, &closures, and other not-so-pretty details of Prothon, that we are missing what is really good - the simplification of classes. There are a number of aspects to this simplification, but for me the unification of methods and functions is the biggest benefit. All methods look like functions (which students already understand). Prototypes (classes) look like modules. This will...
39
7683
by: Mike MacSween | last post by:
Just spent a happy 10 mins trying to understand a function I wrote sometime ago. Then remembered that arguments are passed by reference, by default. Does the fact that this slowed me down indicate: a) That I don't know enough b) Passing arguments by ref is bad
20
5147
by: Clark | last post by:
Hi all. I'm looking for good C source code to study and be able to advance my C programming skills. Do you recomend any open source project in particular that in your opinion has good writen C code? Thanks.
17
3808
by: Kevin Hall | last post by:
C++ is one of my favorite languages to work in. This is because it has so many differrent strengths. But there is also a number of blemishes in the language -- some could potentially be fixed, others are not likely. I wanted to open a discussion on what people think are the good and bad things about C++. Here are my lists: Good things about C++ --------------------- - multi-paradigm language. - const-specifications
22
3435
by: Jon Skeet [C# MVP] | last post by:
I'm looking to write a C# book fairly soon, and the publisher I've approached wants me to do a bit of market research to find out what people like and don't like in this kind of book. I've read loads of reviews of best-selling books on Amazon, so I've got some ideas from there, but I'd be very interested in hearing what you all think makes a good C# book. I'm interested primarily in stylistic things - how light-hearted, what kind of...
206
8383
by: WaterWalk | last post by:
I've just read an article "Building Robust System" by Gerald Jay Sussman. The article is here: http://swiss.csail.mit.edu/classes/symbolic/spring07/readings/robust-systems.pdf In it there is a footprint which says: "Indeed, one often hears arguments against building exibility into an engineered sys- tem. For example, in the philosophy of the computer language Python it is claimed: \There should be one|and preferably only one|obvious...
0
9699
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10536
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10304
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9114
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7598
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6838
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2966
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.