Why Ruby?

spir denis.spir at gmail.com
Sat Dec 11 03:16:17 PST 2010


On Sat, 11 Dec 2010 10:29:20 +0100
"Jérôme M. Berger" <jeberger at free.fr> wrote:

> 	There is a major syntax issue with Ruby. This line:
> 
> foo(a, b)
> 
> does not mean the same thing as this line:
> 
> foo (a, b)
> 
> 	!!WT?

It is an issue for us, because we are used to non-significant spacing. But non (yet) programmers instead expect _everything_ to be significant, including spacing; more generally, they expect 2 different pieces of code to mean something different for the machine (however irrelevant the difference to our trained eyes). The fact that in mainstream languages one can express the same semantics using a wide variety of (very or slightly) distinct idioms is highly confusing and unexpected (not only about spacing).

This is also contradictory to the well-know fact (everyone "knows" that) that code for the machine must be written exactly (or copied exactly as is), that any tiny error may lead to a completely different process, and to a potential calamity. Non-significant spacing also demands thinking about text as single-dimensional stream of terminals, which is both rather abstract and opposite the obvious concrete 2-dimensional layout of text (code).

On the other hand, once one knows what a difference (like the one above) means, that's it. Simpler, easier, matches expectations.


Denis
-- -- -- -- -- -- --
vit esse estrany ☣

spir.wikidot.com



More information about the Digitalmars-d mailing list