Why not follow the C-style syntax?

H

howachen

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?
 
R

Robert Klemme

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
 
H

howachen

Robert Klemme 寫é“:
Why should they?


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...
 
Z

zycte

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.
 
R

Robert Klemme

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
 
F

Friedrich Dominicus

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
 
W

wrecklass1

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.
 
M

Michael Perle

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
 
D

Dumaiu

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,206
Messages
2,571,069
Members
47,677
Latest member
MoisesKoeh

Latest Threads

Top