C is a Middle level language....

C

Coos Haak

Op Sun, 21 Dec 2008 08:02:02 -0800 (PST) schreef (e-mail address removed):
Developed by Denis richi.............

Your spelling of his name is not even middle level.
 
K

Keith Thompson

Jujitsu Lizard said:
If you can't consistently write correct code, you SHOULD be using another
language.

Do you know anyone who *can* consistently write correct code?
I certainly can't; I make mistakes.
 
A

August Karlstrom

Jujitsu said:
If you can't consistently write correct code, you SHOULD be using another
language.

....which implies that C should not be used by anyone.


August
 
J

James Kuyper

Richard said:
August Karlstrom said:


Since anyone who can't consistently write correct code should not be
using /any/ programming language, we can draw the further
conclusion that nobody should be programming *at all*. Whilst I
don't actually agree with this rather extreme position, it would
certainly be tempting to use Sturgeon's Law to sack 90% of the
programmers out there, and then sit back and wait for the fabulous
stuff that the remaining 10% will eventually produce.

The remaining 10% will be swamped wasting their time and skills taking
care of the routine tasks that the other 90% used to take care of. They
won't have much time to spare to do anything "fabulous" (they will have
some time to spare).
 
T

Tomás Ó hÉilidhe

In C you can do marvelous things like:

a)Continuing to use a block of memory after it has been deallocated.

b)Returning a pointer to an automatic variable, which is then used after the
stack frame has expired.

c)Allowing an integer array index to roll over backwards, setting up to
corrupt (for example), unrelated memory or the stack frame.


All of those can be caught with:

gcc -Wall -fmudflap -lmudflap
 
P

Phil Carmody

Note to Keith - 'consistently' doesn't mean 'always'.
I'm sure Keith and Ian et al. do consistently write
correct code. I'd like to think I do too. But no-one
is perfect.
Which self correcting language would you recommend?

LOGO. You might not get what you initially intended, but at
least you can *always* call it "art".

Phil
 
X

xyzzybill

That would be Dennis Ritchie:

http://en.wikipedia.org/wiki/Dennis_Ritchie

C in my opinion is "just right".

The reason is that if you go too high-level, there are performance
implications.

C is, plus or minus a little, a structured assembler.

C gives you enough rope to hang yourself (no array bounds checking, etc.),
but on the other hand you can write those things yourself if you so desire
and you really won't take a performance hit over a "high-level" lanugage, as
your compiled code will do about the same things that the compiled
"high-level" language would do.

If you can't consistently write correct code, you SHOULD be using another
language.

I'm a big fan of C + datastructure tools. I find C + datadraw to be
higher performance than C alone, while more productive for EDA
applications than C++. The problems with higher level languages is
they make a lot of assumptions about the target application. They
assume we can afford some loss in performance, and that we mostly need
static inheritance rather than the ability to dynamically extend
objects that already exist in a database. Both assumptions are wrong
for most EDA programs. They also do simple one-class implementation
inheritance which isn't even capable of doing a decent performance
linked-list, because it optimally involves adding functionality to two
classes rather than just one. Graphs, the heart of most EDA
applications, are a PITA to describe generically in most high-level
languages, though Java does a better job than C++, IMO. Then there's
garbage collection. Modern languages assume they can help us by
eliminating the need to call "delete" on an object, but we have to
remove it from all database relationships anyway. They saved me one
line of code, but I still have to write my own destructors from
scratch.

There's a reason most new EDA applications are still written in C, and
it's not that programmers are stupid.
 
K

Keith Thompson

I'm a big fan of C + datastructure tools. I find C + datadraw to be
higher performance than C alone, while more productive for EDA
applications than C++. [...]

There's a reason most new EDA applications are still written in C, and
it's not that programmers are stupid.

That might make more sense if you told us what "EDA" means.
 
U

user923005

Let's start by making sure that we have the same definition of "consistent".

From dictionary.com:

Reliable; steady: demonstrated a consistent ability to impress the critics.

I don't think consistency as it is commonly used requires 100% success.  I
think 80% might be enough.

If I write 1000 lines of code and 2 are wrong ... that meets my definition.

Consistent makes no sense in this context. If 100% of the lines of
code are bad each and every time, then the code is consistent. If 50%
of the code is bad each and every time, then the code is consistent.
If 0% of the code is bad each and every time then the code is
consistent. So what has consistency told us? Nothing that I can
discern.

I suspect that the word we are searching for here is "reliable".

Bad and unreliable code can be written in any language.
Good and reliable code can be written in any language.

Excellence in reliability for the code base is going to be (in the
largest fraction) a function of the people chosen to do the job.

IMO-YMMV
 
J

jameskuyper

user923005 said:
[...]
If you can't consistently write correct code, you SHOULD be using another
language.
Do you know anyone who *can* consistently write correct code?
I certainly can't; I make mistakes.

Let's start by making sure that we have the same definition of "consistent".

From dictionary.com:

Reliable; steady: demonstrated a consistent ability to impress the critics.

I don't think consistency as it is commonly used requires 100% success. �I
think 80% might be enough.

If I write 1000 lines of code and 2 are wrong ... that meets my definition.

Consistent makes no sense in this context. ...

That's an ironic comment to make, given that the following discussion
completely ignores the context:
... If 100% of the lines of
code are bad each and every time, then the code is consistent. If 50%
of the code is bad each and every time, then the code is consistent.
If 0% of the code is bad each and every time then the code is
consistent.

In itself, that's correct. However, the context resolves all of the
uncertainty that you've introduced by ignoring the context. The
discussion wasn't about "consistent code". The context of this
subthread is the phrase "can't consistently write correct code", and
those few extra words rules out the possibility the phrase refers to
code that is consistently bad.
 
U

user923005

user923005 said:
[...]
If you can't consistently write correct code, you SHOULD be using another
language.
Do you know anyone who *can* consistently write correct code?
I certainly can't; I make mistakes.
Let's start by making sure that we have the same definition of "consistent".
From dictionary.com:
Reliable; steady: demonstrated a consistent ability to impress the critics.
I don't think consistency as it is commonly used requires 100% success. I
think 80% might be enough.
If I write 1000 lines of code and 2 are wrong ... that meets my definition.
Consistent makes no sense in this context. ...

That's an ironic comment to make, given that the following discussion
completely ignores the context:
...  If 100% of the lines of
code are bad each and every time, then the code is consistent.  If 50%
of the code is bad each and every time, then the code is consistent.
If 0% of the code is bad each and every time then the code is
consistent.

In itself, that's correct. However, the context resolves all of the
uncertainty that you've introduced by ignoring the context. The
discussion wasn't about "consistent code". The context of this
subthread is the phrase "can't consistently write correct code", and
those few extra words rules out the possibility the phrase refers to
code that is consistently bad.

I was replying to the definition provided in the post I responded to.
 

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