Re: Chinese Syntax
From: C# Learner (csharp_at_learner.here)
Date: 05/26/04
- Next message: The Real Andy: "Re: how can I send an image to the printer???"
- Previous message: Drunkalot: "how can I send an image to the printer???"
- In reply to: Alex Moskalyuk: "Re: Chinese Syntax"
- Next in thread: Justin Rogers: "Re: Chinese Syntax"
- Reply: Justin Rogers: "Re: Chinese Syntax"
- Reply: Kieran Simkin: "Re: [OT] Chinese Syntax"
- Reply: Stephen Sprunk: "Re: Chinese Syntax"
- Reply: Mark McIntyre: "Re: Chinese Syntax"
- Reply: Viktor Lofgren: "Re: Chinese Syntax"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 27 May 2004 00:56:59 +0100
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?!
- Next message: The Real Andy: "Re: how can I send an image to the printer???"
- Previous message: Drunkalot: "how can I send an image to the printer???"
- In reply to: Alex Moskalyuk: "Re: Chinese Syntax"
- Next in thread: Justin Rogers: "Re: Chinese Syntax"
- Reply: Justin Rogers: "Re: Chinese Syntax"
- Reply: Kieran Simkin: "Re: [OT] Chinese Syntax"
- Reply: Stephen Sprunk: "Re: Chinese Syntax"
- Reply: Mark McIntyre: "Re: Chinese Syntax"
- Reply: Viktor Lofgren: "Re: Chinese Syntax"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|