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

C Syntax

P: n/a
Why is C syntax so uneasy on the eye?

In its day, was it _really_ designed by snobby programmers to scare away
potential "n00bs"? If so, and after 50+ years of programming research,
why are programming languages still being designed with C's syntax?

These questions drive me insane. Every waking minute...
Nov 14 '05 #1
Share this Question
Share on Google+
177 Replies


P: n/a
Why is Chinese syntax so uneasy on the eye?

In its day, was it _really_ designed by snobby linguists to scare away
potential "n00bs"? If so, and after 5000+ years of civilization,
why do Chinese people still using that funny syntax?

These questions drive me insane. Every waking minute...
Nov 14 '05 #2

P: n/a

"C# Learner" <cs****@learner.here> wrote in message
news:uL**************@TK2MSFTNGP11.phx.gbl...
Why is C syntax so uneasy on the eye?
I don't find it so, but that's really a subjective issue.
Of course for folks who are new to it, it does take some
'getting used to'.

In its day, was it _really_ designed by snobby programmers to scare away
potential "n00bs"?
No, I think it's simply trying to be concise and 'to the point'.
If so, and after 50+ years of programming research,
why are programming languages still being designed with C's syntax?
Some are, some use other types of syntax. If you don't like it,
well, use something else. :-)

These questions drive me insane. Every waking minute...


"Think about snakes."
-Tony Robbins.

:-)

-Mike
Nov 14 '05 #3

P: n/a
C# Learner wrote:
Why is C syntax so uneasy on the eye?

In its day, was it _really_ designed by snobby programmers to scare away
potential "n00bs"? If so, and after 50+ years of programming research,
why are programming languages still being designed with C's syntax?

These questions drive me insane. Every waking minute...


If you want COBOL, you know where to find it.

--
Er*********@sun.com

Nov 14 '05 #4

P: n/a
C# Learner <cs****@learner.here> wrote in
news:uL**************@TK2MSFTNGP11.phx.gbl:
These questions drive me insane. Every waking minute...


I would sleep more often then.

--
- Mark ->
--
Nov 14 '05 #5

P: n/a
C# Learner wrote:
Why is C syntax so uneasy on the eye?


Because it's so pretty. That it is "uneasy on [your] eye" is your
problem. Not to worry; there's a solution for your problem. Jesus said
it, and it appears three times in the Gospels:

Matthew 5:29 And if thy right eye offend thee, pluck it out, and cast
it from thee: for it is profitable for thee that one of thy members
should perish, and not that thy whole body should be cast into hell.

Matthew 18:9 And if thine eye offend thee, pluck it out, and cast it
from thee: it is better for thee to enter into life with one eye, rather
than having two eyes to be cast into hell fire.

Mark 9:47 And if thine eye offend thee, pluck it out: it is better for
thee to enter into the kingdom of God with one eye, than having two eyes
to be cast into hell fire:

Nov 14 '05 #6

P: n/a
C# Learner wrote:

Why is C syntax so uneasy on the eye?

In its day, was it _really_ designed by snobby programmers to scare away
potential "n00bs"? If so, and after 50+ years of programming research,
why are programming languages still being designed with C's syntax?

These questions drive me insane. Every waking minute...


Go troll somebody else.

*plonk*


Brian Rodenborn
Nov 14 '05 #7

P: n/a
Alex Moskalyuk wrote:
Why is Chinese syntax so uneasy on the eye?


<snip>

You make a perfectly valid counter-argument.

I think we can conclude, then, that humans, in general, are a pretty
/stupid/ species. Note that this is /not/ a shallow thought.

Another example showing human stupidity, which is also related to
natural languages, is the fact that there are /so many/ natural
languages spoken by humans. Of cource, more than one natural language
is redundant, and causes problems involved with translation.

By the way, it's nice to see someone actually being able to provide a
decent counter-argument on a newsgroup without having to resort to
name-calling.
Nov 14 '05 #8

P: n/a
Have you ever looked into Perl or Lisp code?

C suddenly starts making perfect sense.

What's uneasy to you? Curly braces, parentheses, keywords, or something
else?
--
Alex Moskalyuk
_____________________________
http://www.techinterviews.com

"C# Learner" <cs****@learner.here> wrote in message
news:O2**************@TK2MSFTNGP10.phx.gbl...
Alex Moskalyuk wrote:
Why is Chinese syntax so uneasy on the eye?


<snip>

You make a perfectly valid counter-argument.

I think we can conclude, then, that humans, in general, are a pretty
/stupid/ species. Note that this is /not/ a shallow thought.

Another example showing human stupidity, which is also related to
natural languages, is the fact that there are /so many/ natural
languages spoken by humans. Of cource, more than one natural language
is redundant, and causes problems involved with translation.

By the way, it's nice to see someone actually being able to provide a
decent counter-argument on a newsgroup without having to resort to
name-calling.

Nov 14 '05 #9

P: n/a
C# Learner <cs****@learner.here> writes:
By the way, it's nice to see someone actually being able to provide a
decent counter-argument on a newsgroup without having to resort to
name-calling.


While your original flamebait wasn't particularly an example of decency
on your part, at least have the decency to stop posting off-topic *now*,
please.

If you really believe that the intention of Alex' reply was to start
an elaborate discussion about the Chinese language in comp.lang.c,
I recommend that you stay off Usenet until you have learned to pick up
hints.

Off-topic, therefore Followup-To: poster.

Martin
--
,--. Martin Dickopp, Dresden, Germany ,= ,-_-. =.
/ ,- ) http://www.zero-based.org/ ((_/)o o(\_))
\ `-' `-'(. .)`-'
`-. Debian, a variant of the GNU operating system. \_/
Nov 14 '05 #10

P: n/a
Alex Moskalyuk wrote:
Have you ever looked into Perl or Lisp code?

C suddenly starts making perfect sense.

What's uneasy to you? Curly braces, parentheses, keywords, or something
else?


One of the biggest flaws in C syntax, in my opinion, is the required
parentheses for test conditions.

Here's a very simple example:

void Foo
{
if (FooBar(Parse(Process(GetInput())))
DoSomething();
}

Imagine if, instead, we could write the following:

void Foo
{
if FooBar(Parse(Process(GetInput())):
DoSomething();
}

Python uses such a construct for test conditions.

Another nicety about Python is the fact that whitespace is used for
defining code blocks. This makes code much clearer than the equivalent
C code, which requires block being/end markers.

Here's a very simple Python code sample:
http://www.kernelthread.com/hanoi/html/py.html .

Try staring at it for one minute.

After having done so, take a look at this:
http://www.kernelthread.com/hanoi/html/c.html .

Even if one's accustomed to C syntax, the former is still clearer and
easier-to-read, don't you think?

Every time I see code that conforms to C's basic syntax, I cringe; yet I
write such code every day.

Why C? Why?!
Nov 14 '05 #11

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Eric Sosman wrote:
| C# Learner wrote:
|
|> Why is C syntax so uneasy on the eye?
|>
|> In its day, was it _really_ designed by snobby programmers to scare
|> away potential "n00bs"? If so, and after 50+ years of programming
|> research, why are programming languages still being designed with C's
|> syntax?
|>
|> These questions drive me insane. Every waking minute...
|
|
| If you want COBOL, you know where to find it.
|

I resemble that remark! :-)

FWIW, if you want a computer language that's really "uneasy on the eye", try
APL or RPG2. Even Lisp isn't very easy to read.

OTOH, I've had to read through pages of Java recently (analysis and design of
a new web component for my corporate masters, requiring review of our current
j2ee web apps), and if Java is the new "readability", then give me C any day.
Worse spaghetti code than you could find in any assembly program. I have no
doubt that C# and C++ are just as bad.


- --
Lew Pitcher

Master Codewright & JOAT-in-training | GPG public key available on request
Registered Linux User #112576 (http://counter.li.org/)
Slackware - Because I know what I'm doing.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFAtS6VagVFX4UWr64RAi+RAKCnP8xUHTt6WJpucgZ6Aq 6E1fmMoQCgndgX
eofd4o3IJyR9thmZlRXZwPg=
=PX6r
-----END PGP SIGNATURE-----
Nov 14 '05 #12

P: n/a
As a long time programmer of many languages I've always found the explicit
statement bounding in C to be quite nice. For me it improves readability as
my seasoned internal tokenizer is capable of finding code blocks more quickly
by using the braces and parenthesis than by scanning whitespace. Whitespace
also breaks down quite fast when you start using non fixed width fonts and
mixing tabs and spaces. Arguably you could say, don't do that, but at least
with something of the nature of C and it's explit block scoping you can easily
write a pretty printer and avoid any ambiguity that would otherwise exist.

Take the following excerpt from a Python tutorial:
Tuple syntax

From a syntax viewpoint, you create a tuple by placing a sequence of items
inside a pair of enclosing parentheses and separating them by commas. Note that
the parentheses can be omitted when such omission will not lead to ambiguity.

Note that they point out you can leave out parens only when it won't lead to
ambiguity. C doesn't make that mistake. They make sure there is no ambiguity,
and if you leave out a parens it doesn't make the statement ambiguous, it makes
it
a different or erroneous statement altogether.
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers
"C# Learner" <cs****@learner.here> wrote in message
news:eu**************@TK2MSFTNGP10.phx.gbl...
Alex Moskalyuk wrote:
Have you ever looked into Perl or Lisp code?

C suddenly starts making perfect sense.

What's uneasy to you? Curly braces, parentheses, keywords, or something
else?


One of the biggest flaws in C syntax, in my opinion, is the required
parentheses for test conditions.

Here's a very simple example:

void Foo
{
if (FooBar(Parse(Process(GetInput())))
DoSomething();
}

Imagine if, instead, we could write the following:

void Foo
{
if FooBar(Parse(Process(GetInput())):
DoSomething();
}

Python uses such a construct for test conditions.

Another nicety about Python is the fact that whitespace is used for
defining code blocks. This makes code much clearer than the equivalent
C code, which requires block being/end markers.

Here's a very simple Python code sample:
http://www.kernelthread.com/hanoi/html/py.html .

Try staring at it for one minute.

After having done so, take a look at this:
http://www.kernelthread.com/hanoi/html/c.html .

Even if one's accustomed to C syntax, the former is still clearer and
easier-to-read, don't you think?

Every time I see code that conforms to C's basic syntax, I cringe; yet I
write such code every day.

Why C? Why?!

Nov 14 '05 #13

P: n/a
["Followup-To:" to to microsoft.public.dotnet.languages.csharp]

Martin Dickopp wrote:
C# Learner <cs****@learner.here> writes:
By the way, it's nice to see someone actually being able to provide a
decent counter-argument on a newsgroup without having to resort to
name-calling.
While your original flamebait


My intention was /not/ to start a flame war, but to start a healthy
discussion on the subject of C and why its basic syntax is present in so
many modern programming languages.

If I had asked that question simply and directly, I doubt that many
would've given it a second thought. This is unfortunate detail to keep
in mind when posting to USENET, or other such Internet forums. There
needs to be a little spice to get a discussion going. This is what was
provided by myself in my thread-starter.
wasn't particularly an example of decency
on your part, at least have the decency to stop posting off-topic *now*,
please.
Oh, now that Martin's joined the fray, we're no longer allowed to
continue a discussion which has a sub-thread which is /ever so slightly/
off-topic. Hmph.
If you really believe that the intention of Alex' reply was to start
an elaborate discussion about the Chinese language in comp.lang.c,
Please take the time to /read/ the messages you're replying to. My
reply only just touches on the subject of the Chinese language. My
intention was /not/ to start an elaborate discussion about the Chinese
language.
I recommend that you stay off Usenet until you have learned to pick up
hints.
http://www.winternet.com/~mikelr/flame12.html
Off-topic, therefore Followup-To: poster.


I have no intention to e-mail my reply directly to you, so I disregarded
that follow-up. From the tone of your reply, it seems that had I given
you my e-mail address, I'd be harassed!

I've set follow-ups to microsoft.public.dotnet.languages.csharp, since
people in there are cool. However, my experience has shown that the
people in comp.lang.c, on the other hand, are a bunch of snobby a*******s!

I've posted in that group before and I got flamed in reply almost every
time. I also lurk in that group and notice that even regulars get
/regularly/ flamed there, for little or no reason.

Yeah, yeah, call me a troll. Whatever. This is my opinion, and you
asked for it by /flaming/ me.

Anyway, as I said, I'm not going to e-mail you, and may well proceed to
plonk you due to your heavy-handedness and your apparent snobby attitude.

Goodbye.
Nov 14 '05 #14

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

C# Learner wrote:
| Why is C syntax so uneasy on the eye?

I would disagree with that assertion; I do not find C syntax "uneasy on the eye".

| In its day, was it _really_ designed by snobby programmers to scare away
| potential "n00bs"?

"It's day" is hardly over, and the designers of C had other things on their
minds than attempting to scare away neophytes.

| If so, and after 50+ years of programming research,
| why are programming languages still being designed with C's syntax?

Perhaps because it works?

| These questions drive me insane. Every waking minute...

These are trivialities. Learn five or six computer languages (or three or four
that are entirely unrelated to each other), /then/ formulate your opinion.

Just remember, the computer doesn't care what language the program is written
in; it's all machine language to the CPU. Computer 'language' is for /human/
consumption, and is designed to meet the needs of the programmer and his/her
environment. Some languages are exceedingly suscinct (i.e. APL or RPG), and
some are very verbose (i.e. COBOL, SNOBOL, PL/I, Assembly (any processor)).
Some languages are procedural, some are OO, some are list processors, some are
macro languages. Learn a few, see what they do and where they are used.

Only then can you conduct a reasonable conversation on the topic.

- --
Lew Pitcher

Master Codewright & JOAT-in-training | GPG public key available on request
Registered Linux User #112576 (http://counter.li.org/)
Slackware - Because I know what I'm doing.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFAtTl+agVFX4UWr64RAntoAJ9pk9dL4gzdc9Vk56pcID MtV7yj4gCfY7k0
sTaxl6obapbLPdS7z9Hy6HI=
=jJJD
-----END PGP SIGNATURE-----
Nov 14 '05 #15

P: n/a
Lew Pitcher wrote:

[...]
| In its day, was it _really_ designed by snobby programmers to scare away
| potential "n00bs"?

"It's day" is hardly over, and the designers of C had other things on their
minds than attempting to scare away neophytes.
By "its day" ("it's day" is grammatically incorrect, by the way), I
actually meant the days around which it was designed. I phrased it
incorrectly -- my mistake.

[...]
| These questions drive me insane. Every waking minute...

These are trivialities. Learn five or six computer languages (or three
or four
that are entirely unrelated to each other), /then/ formulate your opinion.
Well, I have learned BASIC, C-like languages (C and C++), Delphi
(formerly named 'Object Pascal') and Smalltalk.

So, basically, I've learned a couple of procedural languages, and a
couple of OO ones.
Just remember, the computer doesn't care what language the program is
written
in; it's all machine language to the CPU. Computer 'language' is for
/human/
consumption, and is designed to meet the needs of the programmer and
his/her
environment.
Exactly -- and this is why I see high-level language syntax to be so
important.

I feel that popular, modern-day high-level languages are tainted by a
specific syntax that has carried over through decades, one which I feel
is somewhat inhibitive. I feel it's inhibitive in the sense that code
written in it needs to conform to a syntax that could be nicer, and make
for easier-to-read source code.
Some languages are exceedingly suscinct (i.e. APL or RPG), and
some are very verbose (i.e. COBOL, SNOBOL, PL/I, Assembly (any processor)).
Some languages are procedural, some are OO, some are list processors,
some are
macro languages. Learn a few, see what they do and where they are used.

Only then can you conduct a reasonable conversation on the topic.


I don't understand why I'd need to learn a few more languages to
understand that C's basic syntax could be nicer.
Nov 14 '05 #16

P: n/a

[Attn: My newsfeed does not carry the group
microsoft.public.dotnet.languages.csharp. If someone would please
forward this message there, I'd be very grateful. Thanks.]

On Wed, 26 May 2004, Alex Moskalyuk wrote:

Why is Chinese syntax so uneasy on the eye?

In its day, was it _really_ designed by snobby linguists to scare away
potential "n00bs"? If so, and after 5000+ years of civilization,
why do Chinese people still using that funny syntax?

These questions drive me insane. Every waking minute...
The reason Martin responded (elsebranch) so harshly to this post
is because you didn't follow Usenet etiquette. Seen in the proper
context, your post (a properly-threaded response to thread "C Syntax")
is a highly amusing counterargument to the original "n00b"'s attitude.
*However*, you failed to quote any context in your post, and then
you changed the subject line, leaving not even a "Re:" to indicate
that this was a response to a previous post (except to header-divers).
The result is that your post looks like a random off-topic post
on the Chinese language, cross-posted to two mutually unrelated
newsgroups. Which is why you got flamed.

Here is how you could have replied so as to conform to proper
netiquette and avoid p---ing people off:

==begin example==
Subject: Re: C Syntax

On Wed, 26 May 2004, C# Learner <cs****@learner.here> wrote:
Why is C syntax so uneasy on the eye?

In its day, was it _really_ designed by snobby programmers to scare away
potential "n00bs"? If so, and after 50+ years of programming research,
why are programming languages still being designed with C's syntax?

These questions drive me insane. Every waking minute...

Why is Chinese syntax so uneasy on the eye?

In its day, was it _really_ designed by snobby linguists to scare away
potential "n00bs"? If so, and after 5000+ years of civilization,
why do Chinese people still using that funny syntax?

These questions drive me insane. Every waking minute...

==end example==

You see? It's now crystal clear what you intend, and the humorous
effect is preserved (in fact, it's *created*, for those people with
flaky newsfeeds who didn't read the original message (yet)).

Maybe in news:microsoft.public.dotnet.languages.csharp, you get
little enough traffic that this sort of response is common and
appropriate. But news:comp.lang.c is an incredibly high-traffic
group, so clear communication is essential. At best, a rude or
ignorant post wastes everyone's reading time; at worst, half a dozen
regulars write flames and/or lectures like this one, which then
waste everyone's time reading *again*. ;-)

Hope this clears things up.

And just for the record: Yes, you're right about Chinese. :)
http://www.pinyin.info/readings/texts/moser.html
[not all correct IMHO, but pretty darn close, and funny too]

-Arthur
Nov 14 '05 #17

P: n/a
"C# Learner" <cs****@learner.here> wrote in message
news:eu**************@TK2MSFTNGP10.phx.gbl...
Alex Moskalyuk wrote:
Have you ever looked into Perl or Lisp code?

C suddenly starts making perfect sense.

What's uneasy to you? Curly braces, parentheses, keywords, or something
else?
One of the biggest flaws in C syntax, in my opinion, is the required
parentheses for test conditions.


I think you confuse a flaw with part of the language specification.

Here's a very simple example:

void Foo
{
if (FooBar(Parse(Process(GetInput())))
DoSomething();
}

Imagine if, instead, we could write the following:

void Foo
{
if FooBar(Parse(Process(GetInput())):
DoSomething();
}

I'm imagining, and I'm reminded of BASIC.
Python uses such a construct for test conditions.

Another nicety about Python is the fact that whitespace is used for
defining code blocks. This makes code much clearer than the equivalent
C code, which requires block being/end markers.

Here's a very simple Python code sample:
http://www.kernelthread.com/hanoi/html/py.html .

Try staring at it for one minute.

Have just done so, this code (admittedly having never even looked at Python
before) seems completely unreadable to me. Maybe I'm just used to C syntax.
After having done so, take a look at this:
http://www.kernelthread.com/hanoi/html/c.html .

Even if one's accustomed to C syntax, the former is still clearer and
easier-to-read, don't you think?
No, not really. Python may be easier for you because that may be what you're
used to looking at, but C and PHP are what I do (PHP's syntax is more
similar to C's than Python's) and their syntax makes perfect sense to me. It
seems to me there may not be a "better" way; just different ways - although
it does seem to me that Python code would be prone to breaking when cnped
between things which do not preserve tab formatting for example (such as
some newsreaders).

One of the things I like about C is that whitespace most often doesn't
matter and I can control exactly how I want my program to look and read
rather than have it laid out for me by the language specification.

Every time I see code that conforms to C's basic syntax, I cringe; yet I
write such code every day.

Why C? Why?!


This is the kind of question which could easily attract a lot of annoyance.
Obviously this entire post is off-topic. Python is not C, C will never be
Python and you've cross-posted to C# which is not C either.

Nov 14 '05 #18

P: n/a
On Wed, 26 May 2004 19:56:05 -0400, Lew Pitcher
<lp******@sympatico.ca> wrote in comp.lang.c:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Eric Sosman wrote:
| C# Learner wrote:
|
|> Why is C syntax so uneasy on the eye?
|>
|> In its day, was it _really_ designed by snobby programmers to scare
|> away potential "n00bs"? If so, and after 50+ years of programming
|> research, why are programming languages still being designed with C's
|> syntax?
|>
|> These questions drive me insane. Every waking minute...
|
|
| If you want COBOL, you know where to find it.
|

I resemble that remark! :-)

FWIW, if you want a computer language that's really "uneasy on the eye", try
APL or RPG2. Even Lisp isn't very easy to read.
You haven't liven until you've seen badly written PL/M (note the 'M').

Their equivalent of C's switch...case still gives me nightmares after
all these years.
OTOH, I've had to read through pages of Java recently (analysis and design of
a new web component for my corporate masters, requiring review of our current
j2ee web apps), and if Java is the new "readability", then give me C any day.
Worse spaghetti code than you could find in any assembly program. I have no
doubt that C# and C++ are just as bad.


--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Nov 14 '05 #19

P: n/a
Kieran Simkin wrote:
"C# Learner" <cs****@learner.here> wrote in message
news:eu**************@TK2MSFTNGP10.phx.gbl...
[...]
After having done so, take a look at this:
http://www.kernelthread.com/hanoi/html/c.html .

Even if one's accustomed to C syntax, the former is still clearer and
easier-to-read, don't you think?


No, not really. Python may be easier for you because that may be what you're
used to looking at,


Aha, but I only saw Python code for the /first/ time yesterday. :-)
but C and PHP are what I do (PHP's syntax is more
similar to C's than Python's)
Cool.
[...]
Every time I see code that conforms to C's basic syntax, I cringe; yet I
write such code every day.

Why C? Why?!
This is the kind of question which could easily attract a lot of annoyance.


Okay, I accept that. I don't mean to annoy -- it's just my style of
writing. If I've annoyed then I apologize to all those affected.

Also, I guess I'm just trying to make a point and get heard here; and,
at the same time, I want to hear what those who are more experienced
than me have to say on the matter -- especially C gurus!

For the record, I don't /hate/ this C syntax of which I talk. I just
have a feeling of disbelief, perhaps, that some badly-implemented (in my
opinion) syntactial elements of the C language have passed through to
modern programming languages.
Obviously this entire post is off-topic. Python is not C, C will never be
Python and you've cross-posted to C# which is not C either.


Hmm... I have to disagree. I feel that this discussion is about C's
basic syntax and its ubiquity in popular modern-day languages.

If such a discussion is off-topic for comp.lang.c, then I honestly don't
know quite where it would be /on/-topic. In fact, I even considered
renaming the subject of this post to 'Re: C Syntax', but didn't want to
enrage people by doing so.

In any case, this was also posted to
microsoft.public.dotnet.languages.csharp since I wanted to hear some
opinions from those people too, and that is also the group which I read
more.
Nov 14 '05 #20

P: n/a
"C# Learner" <cs****@learner.here> wrote in message
news:eu**************@TK2MSFTNGP10.phx.gbl...
One of the biggest flaws in C syntax, in my opinion, is the required
parentheses for test conditions.
Without the parens you would need a "then" keyword of some kind. It seems
like an even trade.
Another nicety about Python is the fact that whitespace is used for
defining code blocks. This makes code much clearer than the equivalent
C code, which requires block being/end markers.
OTOH, C not using whitespace to mean anything gives programmers lots of
flexibility in how they format their source code to improve readability.

Block begin/end markers are very useful, and having such things explicit
arguably makes things easier for both the compiler and subsequent coders.
Here's a very simple Python code sample:
http://www.kernelthread.com/hanoi/html/py.html .

Try staring at it for one minute.

After having done so, take a look at this:
http://www.kernelthread.com/hanoi/html/c.html .

Even if one's accustomed to C syntax, the former is still clearer and
easier-to-read, don't you think?


That depends on the reader; the C version is far clearer to me. You also
put error-checking into the C version that's not in the Python one, which is
unfair when considering code length.

S

--
Stephen Sprunk "Stupid people surround themselves with smart
CCIE #3723 people. Smart people surround themselves with
K5SSS smart people who disagree with them." --Aaron Sorkin

Nov 14 '05 #21

P: n/a
"C# Learner" <cs****@learner.here> wrote in message
news:eS**************@TK2MSFTNGP09.phx.gbl...
These are trivialities. Learn five or six computer languages (or three
or four
that are entirely unrelated to each other), /then/ formulate your opinion.

Well, I have learned BASIC, C-like languages (C and C++), Delphi
(formerly named 'Object Pascal') and Smalltalk.

So, basically, I've learned a couple of procedural languages, and a
couple of OO ones.


And which one do seems you the best?
Which one seems to have the best syntax?

All your languages are Algol-derivative, so they share equivalent
syntactic constructs and all them are similar.

Try to learn something truly alternative. Try FORTRAN 77, the language
without any flame wars about indentation. Try LISP, the language with
syntax based on two symbols. Then come back.

When personally I met C, I already knew BASIC and Pascal and I was amused
by the expressiveness and brevity of C's syntax. I still think that
for (i=0;i<10;i++) {...}
is much better than
for i:=0 to 9 do begin ... end;
Some languages are exceedingly suscinct (i.e. APL or RPG), and
some are very verbose (i.e. COBOL, SNOBOL, PL/I, Assembly (any processor)). Some languages are procedural, some are OO, some are list processors,
some are
macro languages. Learn a few, see what they do and where they are used.

Only then can you conduct a reasonable conversation on the topic.


I don't understand why I'd need to learn a few more languages to
understand that C's basic syntax could be nicer.


Suggest some improvements and I'll say you, why you're wrong ;-)

Nov 14 '05 #22

P: n/a
[I'll do the courtesy of a reply at the risk of getting flamed by the
comp.lang.c police.]

I. Appel wrote:
"C# Learner" <cs****@learner.here> wrote in message
news:eS**************@TK2MSFTNGP09.phx.gbl...
These are trivialities. Learn five or six computer languages (or three
or four
that are entirely unrelated to each other), /then/ formulate your
opinion.
Well, I have learned BASIC, C-like languages (C and C++), Delphi
(formerly named 'Object Pascal') and Smalltalk.

So, basically, I've learned a couple of procedural languages, and a
couple of OO ones.


And which one do seems you the best?
Which one seems to have the best syntax?


I'd say Delphi has the clearest syntax.

[...]
I don't understand why I'd need to learn a few more languages to
understand that C's basic syntax could be nicer.


Suggest some improvements and I'll say you, why you're wrong ;-)


Simply:

1) Remove the need to specify parentheses for test conditions --
substitute a test condition terminator, such as Python's ':'.

2) Remove begin/end code block markers and require indentation instead.
Nov 14 '05 #23

P: n/a
C# Learner <cs****@learner.here> wrote:
[I'll do the courtesy of a reply at the risk of getting flamed by the
comp.lang.c police.]
[No police around, only conscious people.]
I. Appel wrote:
"C# Learner" <cs****@learner.here> wrote: <snip>
Well, I have learned BASIC, C-like languages (C and C++), Delphi
(formerly named 'Object Pascal') and Smalltalk.

So, basically, I've learned a couple of procedural languages, and a
couple of OO ones. <snip>

Note:
"Procedural" and "OO" are not mutually exclusive language concepts.
Smalltalk is a functional language.
I don't understand why I'd need to learn a few more languages to
understand that C's basic syntax could be nicer.


Suggest some improvements and I'll say you, why you're wrong ;-)


Simply:

1) Remove the need to specify parentheses for test conditions --
substitute a test condition terminator, such as Python's ':'.

2) Remove begin/end code block markers and require indentation instead.


Who or what is keeping you from designing a language incorporating the
worst of BASIC/Pascal/Python/FORTRAN/etc. worlds? Not that it will
ever have a fighting chance to be used by anyone for anything but as
an example of a language with a syntax "uneasy to the eye".

"Doctor, it hurts when I look at C."
"Well, then don't."

Regards
--
Irrwahn Grausewitz (ir*******@freenet.de)
welcome to clc: http://www.ungerhu.com/jxh/clc.welcome.txt
clc faq-list : http://www.faqs.org/faqs/C-faq/faq/
clc OT guide : http://benpfaff.org/writings/clc/off-topic.html
Nov 14 '05 #24

P: n/a
Lew Pitcher wrote:
I resemble that remark! :-)


You resemble[1] that remark? Are you intangible?

Do you also resent[2] that remark?

[1] to be like or similar to
[2] to feel or express annoyance or ill will at

Nov 14 '05 #25

P: n/a
C# Learner <cs****@learner.here> wrote:
Why is C syntax so uneasy on the eye?


Beware the troll! This is cross-posted inappropriately.

Richard
Nov 14 '05 #26

P: n/a
"Justin Rogers" <Ju****@games4dotnet.com> wrote:
Note that they point out you can leave out parens only when it won't lead to
ambiguity. C doesn't make that mistake. They make sure there is no
ambiguity, and if you leave out a parens it doesn't make the statement
ambiguous, it makes it a different or erroneous statement altogether.


C has plenty of ambiguity:

- Braces are optional if there is only one statement for if() or for() or
while(). (But not for do ... while(), switch, or structure/union
declarations.)

- If a statement has multiple side effects, the order in which those side
effects take place can be unknown.

- The right shift operator may or may not sign extend signed integers. Its
implementation defined.

- The size of an integer is platforms specific.

- The number of bits in a bytes is platform specific.

- Try this one on for size:

char a = -1, b = -2;
unsigned short x = (1 > 0) ? a : b;

printf ("x = %d\n", x);

What do you think is printed out? Explain it.

--
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/
Nov 14 '05 #27

P: n/a
Paul Hsieh wrote:
"Justin Rogers" <Ju****@games4dotnet.com> wrote:
Note that they point out you can leave out parens only when it won't lead to
ambiguity. C doesn't make that mistake. They make sure there is no
ambiguity, and if you leave out a parens it doesn't make the statement
ambiguous, it makes it a different or erroneous statement altogether.


C has plenty of ambiguity:

- Braces are optional if there is only one statement for if() or for() or
while(). (But not for do ... while(), switch, or structure/union
declarations.)


The braces are also optional on switch and do-while statements:

do something(); while (not_finished());

switch (expression)
statement;

Struct or union declarations are not relevant: their components are
declarations, not statements.

None of your other examples were syntactically ambiguous.

Jeremy.
Nov 14 '05 #28

P: n/a
In <uL**************@TK2MSFTNGP11.phx.gbl> C# Learner <cs****@learner.here> writes:
Why is C syntax so uneasy on the eye?


Uneasiness is in the eye of the beholder...

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #29

P: n/a
C# Learner wrote:
Simply:

1) Remove the need to specify parentheses for test conditions --
substitute a test condition terminator, such as Python's ':'.


#define if if (
#define then )

int main(int argc, char **argv)
{
if argc-1 == 0 then return 666;
return 0;
}

Nov 14 '05 #30

P: n/a

In article <V7********************@news20.bellglobal.com>, Lew Pitcher <lp******@sympatico.ca> writes:

FWIW, if you want a computer language that's really "uneasy on the eye", try
APL or RPG2. Even Lisp isn't very easy to read.
APL?!! APL is beauty itself, manifesting as a swell set of new
keyboard caps. C'mon - just look at that cute little rho, or the
noble edifice of the dotted-quad.

Of course, few languages can produce source as readable as ETA's.[1]
OTOH, I've had to read through pages of Java recently (analysis and design of
a new web component for my corporate masters, requiring review of our current
j2ee web apps), and if Java is the new "readability", then give me C any day.
Worse spaghetti code than you could find in any assembly program. I have no
doubt that C# and C++ are just as bad.


It's possible to write highly readable code in Java, of course, just
as it is in C, but many Java programmers for some reason seem to suffer
from a variety of common style deficiencies. I've seen a lot of Java
source which was apparently written in an editor with a 200-character
line length, for example.

As untold commentators have pointed out untold times, a talented
programmer can produce a mess in any language. There *are* languages
which make it more or less convenient to produce readable source, but
for all but the worst offenders it's possible. (The only real
counterexample I can think of would be an evil esoteric language,
even then perhaps only if it didn't permit comments. I don't think
Unlambda[2] has any provision for comments, for example. If it had
them, even an Unlambda program might be rendered readable, for
suitably small values of "unreadable".)

1. http://www.miketaylor.org.uk/tech/eta/doc/
2. http://www.eleves.ens.fr:8080/home/m...rams/unlambda/

--
Michael Wojcik mi************@microfocus.com

Vinegar keeps more flies away than honey does.
Nov 14 '05 #31

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Grumble wrote:
Lew Pitcher wrote:
I resemble that remark! :-)

You resemble[1] that remark? Are you intangible?


Old joke, obviously forgotten.

- --
Lew Pitcher
IT Consultant, Enterprise Application Architecture,
Enterprise Technology Solutions, TD Bank Financial Group

(Opinions expressed are my own, not my employers')
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)

iD8DBQFAtd2LagVFX4UWr64RArazAJ0W5D7pR59pWn/nCYBpIbPSRP4YZgCgohYK
Wmdduf6UQMxLBkRVJdhNwnA=
=hfB0
-----END PGP SIGNATURE-----
Nov 14 '05 #32

P: n/a
"C# Learner" <cs****@learner.here> wrote in message
news:eF**************@TK2MSFTNGP12.phx.gbl...
These are trivialities. Learn five or six computer languages (or three
or four
that are entirely unrelated to each other), /then/ formulate your
opinion.
Well, I have learned BASIC, C-like languages (C and C++), Delphi
(formerly named 'Object Pascal') and Smalltalk.

So, basically, I've learned a couple of procedural languages, and a
couple of OO ones.


And which one do seems you the best?
Which one seems to have the best syntax?


I'd say Delphi has the clearest syntax.


Delphi is boring. IMO syntax of C is much more funny.
[...]
I don't understand why I'd need to learn a few more languages to
understand that C's basic syntax could be nicer.
Suggest some improvements and I'll say you, why you're wrong ;-)


Simply:


Well, rephrasing Paul Graham, I should say "Don't wait until C will become
as
clear as Python, use Python instead".
1) Remove the need to specify parentheses for test conditions --
substitute a test condition terminator, such as Python's ':'.
Actually in C it is permitted to build much more complicated conditions.
It's generally bad programming style, but that feature requires parenteses.
2) Remove begin/end code block markers and require indentation instead.


Block markers vs. indentation is IMO eternal flame war.
Nov 14 '05 #33

P: n/a
Lew Pitcher wrote:
Old joke, obviously forgotten.


Obviously :-)

Nov 14 '05 #34

P: n/a
On Thu, 27 May 2004 00:56:59 +0100, in comp.lang.c , C# Learner
<cs****@learner.here> wrote:
One of the biggest flaws in C syntax, in my opinion, is the required
parentheses for test conditions.
if (FooBar(Parse(Process(GetInput())))
DoSomething();
(he prefers)
if FooBar(Parse(Process(GetInput())):
DoSomething();


Okay, I'll bite. Why on earth do you consider this in any way an
improvement? What difference does it make to anything?
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 14 '05 #35

P: n/a
On Thu, 27 May 2004 04:36:24 +0100, in comp.lang.c , C# Learner
<cs****@learner.here> wrote:
Aha, but I only saw Python code for the /first/ time yesterday. :-)


*shrug*
Me too. And C is much easier to read. YMMV.
Obviously this entire post is off-topic. Python is not C, C will never be
Python and you've cross-posted to C# which is not C either.


Hmm... I have to disagree. I feel that this discussion is about C's
basic syntax and its ubiquity in popular modern-day languages.


But the topic of CLC is the C /language/ and using it, not whether there's
a neater way to structure the language. You could try talking about that
over in comp.std.c, but I warn you, you'll get roasted in about 2 seconds.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 14 '05 #36

P: n/a
On Thu, 27 May 2004 04:36:24 +0100, in comp.lang.c , C# Learner
<cs****@learner.here> wrote:
Aha, but I only saw Python code for the /first/ time yesterday. :-)


*shrug*
Me too. And C is much easier to read. YMMV.
Obviously this entire post is off-topic. Python is not C, C will never be
Python and you've cross-posted to C# which is not C either.


Hmm... I have to disagree. I feel that this discussion is about C's
basic syntax and its ubiquity in popular modern-day languages.


But the topic of CLC is the C /language/ and using it, not whether there's
a neater way to structure the language. You could try talking about that
over in comp.std.c, but I warn you, you'll get roasted in about 2 seconds.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 14 '05 #37

P: n/a

Irrwahn Grausewitz wrote:
[...snip...]
Smalltalk is a functional language.


How do you define "functional language" ?
Nov 14 '05 #38

P: n/a
On Thu, 27 May 2004 03:40:42 +0100, "Kieran Simkin"
<ki****@digital-crocus.com> wrote:
Another nicety about Python is the fact that whitespace is used for
defining code blocks.


What you call a nicety <sic>, I call a liability.

--
Al Balmer
Balmer Consulting
re************************@att.net
Nov 14 '05 #39

P: n/a
On Thu, 27 May 2004 04:36:24 +0100, C# Learner <cs****@learner.here>
wrote:
Also, I guess I'm just trying to make a point and get heard here; and,
at the same time, I want to hear what those who are more experienced
than me have to say on the matter -- especially C gurus!

For the record, I don't /hate/ this C syntax of which I talk. I just
have a feeling of disbelief, perhaps, that some badly-implemented (in my
opinion) syntactial elements of the C language have passed through to
modern programming languages.


Forgive me if I'm wrong, but my impression is that you don't have a
deep enough understanding of the C language, and indeed of programming
languages in general, to appreciate the reasons for the syntax
features you're commenting on. Take your original example of
eliminating the deli meters around the conditional in an if statement.
Think about what this would mean for compound conditions. Combine that
with the Python-style blocking and then think about an if statement
which tests for several conditions, requiring more than one line to
write.

As you study and understand the language, you'll find that it's all
nicely consistent, and that there are good reasons for most of the
features which seem odd to you. One of the characteristics of C is
terseness, and extra parens aren't required by the language for no
reason.

Also, think about the fact that language inventors and implementers
are, by and large, a pretty bright bunch. In general, they probably
have more and wider experience in the field than you do, and some of
them might even be as smart ;-) Those features which have passed
through to modern languages have done so for a reason.

--
Al Balmer
Balmer Consulting
re************************@att.net
Nov 14 '05 #40

P: n/a
On Thu, 27 May 2004 11:09:58 +0200, Grumble <a@b.c> wrote:
Lew Pitcher wrote:
I resemble that remark! :-)


You resemble[1] that remark? Are you intangible?

Do you also resent[2] that remark?

[1] to be like or similar to
[2] to feel or express annoyance or ill will at


It's a joke. Obviously not a cross-cultural one.

--
Al Balmer
Balmer Consulting
re************************@att.net
Nov 14 '05 #41

P: n/a

On Thu, 27 May 2004, Alan Balmer wrote:

As you study and understand the language, you'll find that it's all
nicely consistent, and that there are good reasons for most of the
features which seem odd to you. One of the characteristics of C is
terseness, and extra parens aren't required by the language for no
reason.


Not that I'm disagreeing, but *is* there any ambiguity avoided
by requiring parens around the condition in a 'do...while' loop?
E.g., what problem, if any (besides lack of symmetry), is introduced
by the "reform"

do stmt; while expr;
do { block } while expr;

replacing

do stmt; while (expr);
do { block } while (expr);

(Also, there's no ambiguity avoided by the requirement of a semicolon
following the label of a 'goto'. Just defusing potential "do you
know you're being utterly ridiculous" responses. ;)

-Arthur

Nov 14 '05 #42

P: n/a
> Delphi is boring. IMO syntax of C is much more funny.

Delphi is Pascal with maybe a few bells and whistles.
Therefore, it's based on an older language than C, maybe that's why
it's a bit boring.

Well, rephrasing Paul Graham, I should say "Don't wait until C will become
as
clear as Python, use Python instead".


If you really think Python has clearer syntax than C, well, think twice.
One terrible fact is this indentation thing in Python to delimit code
blocks. One tab or space is left behind, and the whole thing is screwed.
To me, it's an unacceptable syntax issue.
Nov 14 '05 #43

P: n/a
Lew Pitcher wrote:
Grumble wrote:
Lew Pitcher wrote:
I resemble that remark! :-)


You resemble[1] that remark? Are you intangible?


Old joke, obviously forgotten.


Kids :-)

--
Chuck F (cb********@yahoo.com) (cb********@worldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!
Nov 14 '05 #44

P: n/a
In <bu********************************@4ax.com> Alan Balmer <al******@att.net> writes:
On Thu, 27 May 2004 03:40:42 +0100, "Kieran Simkin"
<ki****@digital-crocus.com> wrote:
Another nicety about Python is the fact that whitespace is used for
defining code blocks.


What you call a nicety <sic>, I call a liability.


None of the programming languages assigning semantics to indentation
has ever become mainstream. There must be a reason...

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #45

P: n/a
"Michael Voss" <mi**********@lvrREMOVE.deCAPS> wrote:

Irrwahn Grausewitz wrote:
[...snip...]
Smalltalk is a functional language.


How do you define "functional language" ?


I don't - others already did. If you're interested in this subject
I suggest to Go Ogle for the comp.lang.functional FAQ - it contains
a nice explanation of functional vs. procedural programming paradigms.

Ob the portion you snipped: While both C++ and Smalltalk are OO
languages, the former is a mere procedural, the latter a mere
functional language.

Regards
--
Irrwahn Grausewitz (ir*******@freenet.de)
welcome to clc: http://www.ungerhu.com/jxh/clc.welcome.txt
clc faq-list : http://www.faqs.org/faqs/C-faq/faq/
clc OT guide : http://benpfaff.org/writings/clc/off-topic.html
Nov 14 '05 #46

P: n/a
In <Pi**********************************@unix45.andre w.cmu.edu> "Arthur J. O'Dwyer" <aj*@nospam.andrew.cmu.edu> writes:

Not that I'm disagreeing, but *is* there any ambiguity avoided
by requiring parens around the condition in a 'do...while' loop?
E.g., what problem, if any (besides lack of symmetry), is introduced
by the "reform"

do stmt; while expr;
do { block } while expr;

replacing

do stmt; while (expr);
do { block } while (expr);


To me, symmetry in the language syntax is an overriding concern. The
last thing I'd want to have to remember is when "while" requires a
parenthesised controlling expression.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #47

P: n/a
On Thu, 27 May 2004 11:55:45 -0400 (EDT), "Arthur J. O'Dwyer"
<aj*@nospam.andrew.cmu.edu> wrote:

On Thu, 27 May 2004, Alan Balmer wrote:

As you study and understand the language, you'll find that it's all
nicely consistent, and that there are good reasons for most of the
features which seem odd to you. One of the characteristics of C is
terseness, and extra parens aren't required by the language for no
reason.


Not that I'm disagreeing, but *is* there any ambiguity avoided
by requiring parens around the condition in a 'do...while' loop?
E.g., what problem, if any (besides lack of symmetry), is introduced
by the "reform"

do stmt; while expr;
do { block } while expr;

replacing

do stmt; while (expr);
do { block } while (expr);

(Also, there's no ambiguity avoided by the requirement of a semicolon
following the label of a 'goto'. Just defusing potential "do you
know you're being utterly ridiculous" responses. ;)

Symmetry and the avoidance of special cases. Prevents ambiguity in my
head, if nowhere else :-)

--
Al Balmer
Balmer Consulting
re************************@att.net
Nov 14 '05 #48

P: n/a
Alan Balmer wrote:
On Thu, 27 May 2004 04:36:24 +0100, C# Learner <cs****@learner.here>
wrote:
[...]
Forgive me if I'm wrong, but my impression is that you don't have a
deep enough understanding of the C language, and indeed of programming
languages in general, to appreciate the reasons for the syntax
features you're commenting on.
I believe that I appreciate the reasons for these features. What I'm
saying is that I think that there are better (in terms of allowing the
user of the language to write readable code) alternatives that could
have been implemented instead.
Take your original example of
eliminating the deli meters around the conditional in an if statement.
Think about what this would mean for compound conditions. Combine that
with the Python-style blocking and then think about an if statement
which tests for several conditions, requiring more than one line to
write.
a) Valid C syntax:

if (foo &&
bar) {
foobar();
}

b) Similar code to the above but using my suggested syntax changes:

if foo &&
bar:
foobar();

Why wouldn't (b) be feasible here?

Everything from 'if' to ':' is considered the condition. After the
newline after ':', whitespace is required to form a code block.
As you study and understand the language, you'll find that it's all
nicely consistent, and that there are good reasons for most of the
features which seem odd to you.
The only way in which they seem odd to me is that they make code much
less readable than it could be, in my opinion.

Okay, if you don't agree with the 'if'..':' idea, then how about
changing the parentheses required for test conditions for a different
pair of characters? An ideal pair would be a pair that isn't used
elsewhere in the language, for readability's sake.
One of the characteristics of C is
terseness, and extra parens aren't required by the language for no
reason.
My point is that a different construct could be substituted in each case.
Also, think about the fact that language inventors and implementers
are, by and large, a pretty bright bunch. In general, they probably
have more and wider experience in the field than you do, and some of
them might even be as smart ;-)
So those who invented C's syntax are necessarily brighter than those who
invented, say, Python's syntax?
Those features which have passed
through to modern languages have done so for a reason.


I honestly wonder what that reason is.

Regards
Nov 14 '05 #49

P: n/a
Mark McIntyre wrote:
On Thu, 27 May 2004 00:56:59 +0100, in comp.lang.c , C# Learner
<cs****@learner.here> wrote:

One of the biggest flaws in C syntax, in my opinion, is the required
parentheses for test conditions.


if (FooBar(Parse(Process(GetInput())))
DoSomething();

(he prefers)

if FooBar(Parse(Process(GetInput())):
DoSomething();


Okay, I'll bite. Why on earth do you consider this in any way an
improvement? What difference does it make to anything?


I believe that it'd improve code readability. Have you noticed how, in
langauges which use such syntax, people often write something like:

if ( FooBar(Parse(Process(GetInput())) )

i.e. they use spaces because of the fact that parentheses are used both
in test conditions and function calls. As far as I see, when doing so,
they're just attempting to work around a syntactical design flaw of the
language.
Nov 14 '05 #50

177 Replies

This discussion thread is closed

Replies have been disabled for this discussion.