By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,159 Members | 888 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,159 IT Pros & Developers. It's quick & easy.

2 C || ~ 2 C

P: n/a
Is there any aspect in language C, that you would change if you were
to design that language today? I think it's a mature language and it
doesn't need any refinement. What do you think? What about C99 contra
C89? Is C language constantly evolving language? Where would you put
the limit for the improvements for the language C? If it ain't broke,
why fix it? Sorry for my broken English, I'm still learning.

Mar 20 '07 #1
Share this Question
Share on Google+
13 Replies


P: n/a
kl**********@gmail.com writes:
Is there any aspect in language C, that you would change if you were
to design that language today?
Yes, and I suspect most of us could come up with long lists of things
we'd like to change. Of course, a lot of the changes I'd like would
break existing code, which means they just aren't going to happen (at
least not in any language called "C").

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Mar 21 '07 #2

P: n/a
kl**********@gmail.com wrote, On 20/03/07 23:16:
Is there any aspect in language C, that you would change if you were
to design that language today?
Yes. Several. For example I would have a "proper" enumerated type,
mandatory prototypes (or some other mechanism for ensuring that the
parameters passed to a function are correct).
I think it's a mature language and it
doesn't need any refinement. What do you think? What about C99 contra
C89?
It has some improvements, but could have done more in some areas and I'm
less than convinced of the usefulness of other changes.
Is C language constantly evolving language?
Yes and no. Compiler writers add extensions some of which might make it
in to a new standard, most of which won't.
Where would you put
the limit for the improvements for the language C?
There is so much existing code that it is difficult to change a lot of
things even where, with hindsight, it would be better if they were
different.
If it ain't broke,
why fix it?
Ah, but it is broken in lots of ways.
Sorry for my broken English, I'm still learning.
Your English is perfectly understandable, although you are using commas
where you should not.
--
Flash Gordon
Mar 21 '07 #3

P: n/a
On Mar 20, 4:16 pm, klaushuot...@gmail.com wrote:
Is there any aspect in language C, that you would change if you were
to design that language today? I think it's a mature language and it
doesn't need any refinement. What do you think? What about C99 contra
C89? Is C language constantly evolving language? Where would you put
the limit for the improvements for the language C? If it ain't broke,
why fix it? Sorry for my broken English, I'm still learning.
We can't turn back the clock, but I would make strings carry lengths
and I would have true n-dimentional arrays (that know their size).
If C always knew the real, exact size of things, there would be a lot
less security holes in it.
But if a frog had wings, he wouldn't scrape his butt on the rocks.

Mar 21 '07 #4

P: n/a
kl**********@gmail.com wrote:
Is there any aspect in language C, that you would change if you were
to design that language today?
Replace all of the logic operators ( &&, ||, !) with keywords ( and,
or, not) which are easier to read and type and not useful variable
names either. I would also add an xor operator so its possible to do
(a xor b) instead of ((a and not b) or (not a and b)).

I would probably leave the bitwise operators as they are.

Erik
--
+-----------------------------------------------------------+
Erik de Castro Lopo
+-----------------------------------------------------------+
"The plural of anecdotes is not data."
-- Lee Revell on LAD mailing list

Mar 21 '07 #5

P: n/a
In article <46********@news.peopletelecom.com.au>,
Erik de Castro Lopo <er***@mega-nerd.comwrote:
>kl**********@gmail.com wrote:
>Is there any aspect in language C, that you would change if you were
to design that language today?

Replace all of the logic operators ( &&, ||, !) with keywords ( and,
or, not) which are easier to read and type and not useful variable
names either.
#include <iso646.h>
I would also add an xor operator so its possible to do
(a xor b) instead of ((a and not b) or (not a and b)).
!=

>I would probably leave the bitwise operators as they are.
They're also covered.
dave

--
Dave Vandervies dj******@csclub.uwaterloo.ca
If only... there were people unburdened by the Hippocratic Oath on
ambulances, so they could usefully be fitted with rocket launchers.
--Maarten Wiltink in the scary devil monastery
Mar 21 '07 #6

P: n/a
Erik de Castro Lopo wrote:
kl**********@gmail.com wrote:
>Is there any aspect in language C, that you would change if you
were to design that language today?

Replace all of the logic operators ( &&, ||, !) with keywords
( and, or, not) which are easier to read and type and not useful
variable names either. I would also add an xor operator so its
possible to do (a xor b) instead of ((a and not b) or (not a and b)).
Check iso646.h. Available since C95.

--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>

"A man who is right every time is not likely to do very much."
-- Francis Crick, co-discover of DNA
"There is nothing more amazing than stupidity in action."
-- Thomas Matthews
--
Posted via a free Usenet account from http://www.teranews.com

Mar 21 '07 #7

P: n/a
dj******@caffeine.csclub.uwaterloo.ca (Dave Vandervies) writes:
In article <46********@news.peopletelecom.com.au>,
Erik de Castro Lopo <er***@mega-nerd.comwrote:
[...]
> I would also add an xor operator so its possible to do
(a xor b) instead of ((a and not b) or (not a and b)).

!=
That's not quite equivalent unless you're able to assume that both
operands are either 0 or 1. A logical xor operator would do something
like (!!a != !!b), or equivalently, (!a != !b).

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Mar 21 '07 #8

P: n/a
CBFalconer wrote:
Erik de Castro Lopo wrote:
>kl**********@gmail.com wrote:
>>Is there any aspect in language C, that you would change if you
were to design that language today?

Replace all of the logic operators ( &&, ||, !) with keywords
( and, or, not) which are easier to read and type and not useful
variable names either. I would also add an xor operator so its
possible to do (a xor b) instead of ((a and not b) or (not a and b)).

Check iso646.h. Available since C95.
Yes, but I would also remove the &&, || etc operators.

Erik
--
+-----------------------------------------------------------+
Erik de Castro Lopo
+-----------------------------------------------------------+
"Code is more often read than written and thus making it
readable is more important than making it writable."
-- Marcin 'Qrczak' Kowalczyk
Mar 21 '07 #9

P: n/a
Erik de Castro Lopo wrote:
CBFalconer wrote:
>Erik de Castro Lopo wrote:
>>kl**********@gmail.com wrote:

Is there any aspect in language C, that you would change if you
were to design that language today?
Replace all of the logic operators ( &&, ||, !) with keywords
( and, or, not) which are easier to read and type and not useful
variable names either. I would also add an xor operator so its
possible to do (a xor b) instead of ((a and not b) or (not a and b)).
Check iso646.h. Available since C95.

Yes, but I would also remove the &&, || etc operators.
Do you enjoy breaking several decades worth of code? Adding language
features is relatively easy. Removing features is a dangerous game to play.
Mar 21 '07 #10

P: n/a
Clever Monkey wrote:
Erik de Castro Lopo wrote:
>CBFalconer wrote:
>>Erik de Castro Lopo wrote:
kl**********@gmail.com wrote:

Is there any aspect in language C, that you would change if you
were to design that language today?
Replace all of the logic operators ( &&, ||, !) with keywords
( and, or, not) which are easier to read and type and not useful
variable names either. I would also add an xor operator so its
possible to do (a xor b) instead of ((a and not b) or (not a and b)).
Check iso646.h. Available since C95.

Yes, but I would also remove the &&, || etc operators.
Do you enjoy breaking several decades worth of code? Adding language
features is relatively easy. Removing features is a dangerous game to play.
I didn't see any requirement that the newly-designed language be
backwards compatible with existing C code.

If I were hacking && and ||, I'd consider arranging that `A || B`
was `A` if it were true and `B` if it (A) were false, rather
than normalising to booleans.

--
Chris "running away, rapidly" Dollin
RIP John "BNF, Fortran, FP" Backus 3Dec1924 - 17Mar2007

Mar 21 '07 #11

P: n/a
kl**********@gmail.com wrote:
Is there any aspect in language C, that you would change if you were
to design that language today?
Why not ask a master ? See the "Critique" section in

http://cm.bell-labs.com/cm/cs/who/dmr/chist.html

Oddly enough, he doesn't apologize for null-terminated strings :-)
--
pa at panix dot com
Mar 21 '07 #12

P: n/a
Erik de Castro Lopo wrote:
kl**********@gmail.com wrote:
>Is there any aspect in language C, that you would change if you were
to design that language today?

Replace all of the logic operators ( &&, ||, !) with keywords ( and,
or, not) which are easier to read and type and not useful variable
names either. I would also add an xor operator so its possible to do
(a xor b) instead of ((a and not b) or (not a and b)).
One possible objection to xor is that it can't have the
short-circuiting behaviour that the other logical operators
have. I don't see it actually causing problems though.

--
imalone
Mar 21 '07 #13

P: n/a
On 20 Mrz., 15:16, klaushuot...@gmail.com wrote:

No the answer is not to change C, the answer is to use another
langauge for your main development and use the high level assembler C
only for the parts where it is usefull/necessary.

Everything else seems to be useless.

You can't C into a good application development language for the new
millenium.

Mar 21 '07 #14

This discussion thread is closed

Replies have been disabled for this discussion.