[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Why not follow the C-style syntax?

howa

6/17/2006 9:32:00 AM

I am wondering why Ruby or Python not follow c-style syntax, just like
what php does.

Are there any advantages in the current Ruby syntax implementation over
the traditional C-style syntax?

10 Answers

Robert Klemme

6/17/2006 9:56:00 AM

0

howachen@gmail.com wrote:
> I am wondering why Ruby or Python not follow c-style syntax, just like
> what php does.

Why should they?

> Are there any advantages in the current Ruby syntax implementation over
> the traditional C-style syntax?

Just look at a program written in C and Ruby. The clean and clutter
free syntax of Ruby is one of its major assets. Also, C is not an OO
language so its support for OO constructs is logically weak to nonexistent.

Kind regards

robert

howa

6/17/2006 10:15:00 AM

0


Robert Klemme ??:

> howachen@gmail.com wrote:
> > I am wondering why Ruby or Python not follow c-style syntax, just like
> > what php does.
>
> Why should they?
>
> > Are there any advantages in the current Ruby syntax implementation over
> > the traditional C-style syntax?
>
> Just look at a program written in C and Ruby. The clean and clutter
> free syntax of Ruby is one of its major assets. Also, C is not an OO
> language so its support for OO constructs is logically weak to nonexistent.
>
> Kind regards
>
> robert

how about Java/C++ like syntax?

I just want to know the "rationale" behind ruby or python synatax,
since no matter how simple or how clear it is, people always don't want
to learn a new language...a little bit risky...

zycte

6/17/2006 11:24:00 AM

0

You learn the ruby language in a few days, the syntax in an hour.
Syntax is one of the main reasons I use the language. It doesn't get in
your way, as C/C++/Java syntax sometimes does (oh, crap, on line 529 I
forgot to place that f**** ";" again...

It's easy for the writer, it's clean for the reader, and it is usually
a lot shorter, although not only Ruby's syntax is accountable for this.

On 2006-06-17 12:15:18 +0200, howachen@gmail.com said:

>
> Robert Klemme 寫��
>
>> howachen@gmail.com wrote:
>>> I am wondering why Ruby or Python not follow c-style syntax, just like
>>> what php does.
>>
>> Why should they?
>>
>>> Are there any advantages in the current Ruby syntax implementation over
>>> the traditional C-style syntax?
>>
>> Just look at a program written in C and Ruby. The clean and clutter
>> free syntax of Ruby is one of its major assets. Also, C is not an OO
>> language so its support for OO constructs is logically weak to nonexisten
> t.
>>
>> Kind regards
>>
>> robert
>
> how about Java/C++ like syntax?
>
> I just want to know the "rationale" behind ruby or python synatax,
> since no matter how simple or how clear it is, people always don't want
> to learn a new language...a little bit risky...


Robert Klemme

6/17/2006 12:21:00 PM

0

howachen@gmail.com wrote:

> how about Java/C++ like syntax?
>
> I just want to know the "rationale" behind ruby or python synatax,
> since no matter how simple or how clear it is, people always don't want
> to learn a new language...a little bit risky...

Additionally to what's been said already, did you ever consider that
having the same or similar syntax in a new language can actually make it
*harder* to learn it? This may cause more confusion than help learning.

Kind regards

robert

Friedrich

6/18/2006 6:04:00 AM

0

howachen@gmail.com writes:

> I am wondering why Ruby or Python not follow c-style syntax, just like
> what php does.
Your queston implies that you find the C-style syntax the to be
preferred one or maybe the "best" one. I can not follow that argument
to any extend.

Regards
Friedrich

--
Please remove just-for-news- to reply via e-mail.

S Wayne

6/18/2006 7:55:00 AM

0

howachen@gmail.com wrote:
> I am wondering why Ruby or Python not follow c-style syntax, just like
> what php does.
>
> Are there any advantages in the current Ruby syntax implementation over
> the traditional C-style syntax?

I read K&R 25 years ago and spent 15 years programming in C. I learned
Java as my first OO language, and it was helpful that it had a C like
syntax. However, the C/Java syntax has a lot of drawbacks, and it often
gets in the way of OO thinking.

Java is really an OO =based= language, while Ruby is an OO language.
The difference is not trivial. If you prefer C syntax, stick to Java.
However, you will be doing yourself a big favor if you learn Ruby, as
it will teach you a great deal more about OO design and programming
than simply learning Java might.

Michael Perle

6/18/2006 11:54:00 AM

0

howachen@gmail.com wrote:
> I just want to know the "rationale" behind ruby or python synatax,
> since no matter how simple or how clear it is, people always don't want
> to learn a new language...a little bit risky...

To make me bellieve this statement, I read it like this:
It is very risky for a programmer not to learn a new
programming language from time to time.

The book "The pragmatic Programmer" proposes to learn
other programming languages just to get new ideas and
to adopt other ways of thinking; just for fun.

This is why I tried Ruby -- and stayed with it.

Some personal opinions:
I stopped testing C++ years ago because finally it is
not a purely oo language. Perhaps the price for keeping
it "C-style".
What I dislike in Java is again the "C-style" and the
primitive types.
Perl one of the few "really modern" languages I saw
before Ruby, but after learning Ruby it is hard to
really like its Perl's OO approach.
But others might see it differently.

MP

senthil.nayagam@gmail.com

6/18/2006 12:19:00 PM

0

lets stop coding for the machines and compilers, lets code for the joy
of coding.

regards
A.Senthil Nayagam
http://senthiln...


howachen@gmail.com wrote:
> I am wondering why Ruby or Python not follow c-style syntax, just like
> what php does.
>
> Are there any advantages in the current Ruby syntax implementation over
> the traditional C-style syntax?

Dumaiu

6/18/2006 3:30:00 PM

0

Frankly, I'd be interested to hear what differences between the
syntaxes of C and Ruby our friend has seen that he actually considers
significant. To me the ALGOL-influenced languages look more similar
than not, i.e., you can still fill them with as many parentheses and
semicolons as you want... . Such differences as exist in Ruby are,
happily, usually simplifications. I can say that the syntax of C++ is
rigid because it's so god-awfully difficult to compile anyway.

mathew

6/18/2006 11:36:00 PM

0

howachen@gmail.com wrote:
> I am wondering why Ruby or Python not follow c-style syntax, just like
> what php does.

Because C syntax was not designed with object-oriented programming in
mind. Unlike PHP, Ruby was intended to be an OO language from the outset.


mathew
--
<URL:http://www.pobox.com/...
My parents went to the lost kingdom of Hyrule
and all I got was this lousy triforce.