C's syntax (was Re: Python Formatted C Converter (PfCC))
Erik Max Francis
max at alcyone.com
Mon Oct 23 11:36:21 EDT 2000
Alex Martelli wrote:
> I strongly disagree. C's syntax has glaring flaws, such as being
> unparsable "locally" -- i.e., without knowing what typedef's have
> been previously met. For example:
>
> foo * bar;
That's just the way the language works. It's neither good nor bad.
It's certainly not ambiguous and confusing unless you _try_ to write
pathological code.
> Even from a human-factors point of view, such syntactic
> tripwires (over which people DO keep stumbling...) as
> if(a=0) ... /* oops, an assignment...! */
Any reasonable compiler will warn about this.
> or
> foo* bar, baz; /* NOT two pointers... */
That's a programmer error. In declaring pointers, the * is a declarator
and binds to the variable, not the type. That's why coding styles such
as writing `int* p' end up only causing problems, because they imply
that the * binds to the type when it does not.
> or
> struct foo {
> int bar;
> } /* forgot a semicolon... */
So what?
> /* int can be omitted and is implied -- how CRAZY! */
Not in C99.
--
Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/ \ An ounce of hypocrisy is worth a pound of ambition.
\__/ Michael Korda
REALpolitik / http://www.realpolitik.com/
Get your own customized newsfeed online in realtime ... for free!
More information about the Python-list
mailing list