Hacker News new | past | comments | ask | show | jobs | submit login

Well, what are the options for detecting the end of a statement? You can have a language where all possible statements are clear about where the end is from just the statement alone. You can have a language where each statement has to be on a separate line, and only on one line (or where you specially mark a continuation of a statement from the previous line). Or you can have a termination marker. As far as I can tell, that's pretty much the list of possible options.

Note that Lisp has taken the first approach: It's clear (by closing the opening paren) when you're done with a statement.




Technically, of course, there are no statements in Lisp; there are only expressions (forms, Lisp calls them).

The artificial distinction between statements and expressions is a source of endless annoyance to me when I'm working (as I do, for my day job) in a language that has it. In Lisp I can say things like

  (when (some (lambda (x) ...) some-list)
    (do-something))
There, I've written a loop in the predicate of a conditional (the 'some' expression is true if the function passed to it returns true on any element of the list). Statement-oriented languages have generally not had an elegant way to do that, though admittedly that is changing somewhat, as lambda expressions and higher-order functionals become more popular.

The point is, I think this complaint, about the statement/expression distinction, has a lot more substance than complaints about either parentheses or semicolons.


Python handles this really well.

A statement can span multiple lines. And it has no termination marker.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: