[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On Sun, 15 Jun 2003, Michael Vanier wrote:

> Off the top of my head (it's been a while):
> -- direct syntactic support for regexps
Although I agree in theory that a language shouldn't have syntactic
clutter this is such a common application (matching text) in practice
that I understand why its there. Would you have thought it better just to
have the (also now available) Regexp.new("anyre") "form" instead of
the now more common /anyre/?

> -- both the do...end and { } notation for function bodies
Yes, I see no big need although practice is to use the latter for
one-liners (array.map {|e| ...}) while do...end is reserved for more
complex, multi-line bodies.

Also, I haven't fully understood ruby's creator (matz) notion about
"Simplicity is not the goal; try to be natural, not simple" and trying to
keep "There's more than one way to do it" while still clearly taking a
stance against macros.

> -- perlish options to put keywords in different places
>    for conditionals (e.g. "foo() if /bar/")
Agreed. Matz seems to value succinctness/conciseness very high though so
this might be in their name (but macros would often make things even more
succinct I think so why not there? ;) ).

> Basically, ruby offends my notion of syntactic simplicity, which is also
> one of the things I really like about Smalltalk.  For that matter, even
> python is growing too much syntax for my taste (though it's still much less
> than ruby).
Can Smalltalker's/Pythonistas comment on the main benefits of
syntactic simplicity? Fewer things to learn,
less things to keep in the head, easier for others to read your code when
there are less options syntax-wise? More? I think this issue is
interesting and find it hard to take a stance myself.

I can see the logic in the python argument that a plain and easy syntax
is good for maintainability while on the other hand it *is* useful to
be able to extend the syntax and write domain-specific languages with

Are there any real-world examples on when the latter (lisp-way) of
extending the syntax has also benefitted long-term maintainability (or
examples where it has been harmful)?