3 ms·
I can handle parentheses. What really gets me? Semicolons. Most useless character in programming language history. Every time I switch from a language that doe
by BeetleB 9y ago
I can handle parentheses.
What really gets me? Semicolons. Most useless character in programming language history. Every time I switch from a language that doesn't require them to one that does, the pirates run away from me.
- outworlder 9y agoThis. At least parentheses have a useful purpose and can even help you when writing code (paredit and the like). Semicolons are only there to help compiler writers. It would be ok if they were allowed, but optional. How many times do you really have to write more than one statement per line?
- cptn_brittish 9y agoThe issue is these days everytime I hear optional I think of semicolons in JavaScript where they are optional except for one or two edge cases I can't remember off the top of my head. Optional is good as long as its a complete you can do it this way or that way like gradual typing in some languages.
- outworlder 9y agoIndeed. I meant really optional, not something like automatic semicolon insertion, where they are there, they are required by the grammar, but you are allowed to omit them in some cases.
- etiam 9y ago> the pirates run away from me Nice expression. Is it a pop culture reference I have missed?
- AnimalMuppet 9y agoI suspect (but do not know) that the reference is "swearing like a pirate". BeetleB is (I think) saying that semicolons lead to swearing that even the pirates are offended/appalled. (It took me reading it a few times to get that, and I'm still not certain it's right.)
- BeetleB 9y agoYep. Maybe I should have said the pirates around me start blushing.
- AnimalMuppet 9y agoWell, 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.
- ScottBurson 9y agoTechnically, 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.
- BeetleB 9y agoPython handles this really well. A statement can span multiple lines. And it has no termination marker.