7 ms·
Coming from a modern language background like Swift it appalls me that I still have to use semicolons in Rust.
by spelunky 12y ago
Coming from a modern language background like Swift it appalls me that I still have to use semicolons in Rust.
- coldtea 12y agoSwift came out less 2 weeks ago. As a beta announcement. So most certainly nobody comes from a "modern language background like Swift". Plus, it's not like semicolons are any big deal. If they are in a language, you add them and move on. Dead simple to add, minimal noise, instantly familiar to most C-derivative programmers. The only comminity that regularly complaints about them are hipster (for lack of a better term) javascript programmers.
- userbinator 12y agoIn fact I like semicolons because they give a clear delimiter to each statement or expression leaving them out and relying on whitespace like newlines is to me less readable since we're used to reading sentences with punctuation and without that everything runs together and you have to mentally separate them out while parsing not to mention it makes ambiguous cases like in JavaScript possible
- Pxtl 12y agoHonestly, if semicolons are the one feature somebody mentions when comparing modern languages, I don't want to work with them. I like Python. I think Python's whitespace-based blocking is interesting. But it is not the most interesting part of the language, and anybody who obsesses over that kind of stuff is just bikeshedding.
- JOHN_BONER 12y agoWell, semicolons have special meaning in Rust. In some contexts, like the last expression in a function or other expression block, if you don't use a semicolon it will return the value that the expression evaluates to. If you do use a semicolon, it won't return that expression's value. This is good, because it lets you avoid writing the "return" keyword all over the place, but it also lets you avoid returning a value with just a single character!
- robert_tweed 12y agoStuff like this is what currently puts me off Rust, in spite of some initial excitement about the potential it has. This is like optimising for the least readable code possible. I imagine it's going to be a nightmare in practise. Developers always seem to be complaining about having to type this or that, when they should be much more concerned with what they have to read! Really, I couldn't care less about typing a few extra characters. I can type pretty fast anyway and usually spend more time thinking than I do typing. What I do care about is being able to tell exactly what some code does by glancing at it, without worrying too much about whether someone wrote = instead of ==. Rust seems to be setting itself up for loads of those kinds of errors by trying to make the syntax terse at the expense of making it readable. I have high hopes for Rust and will reserve judgement until it is stable; from what I've seen it's still in a high state of flux. However for now, I much prefer the KISS approach taken by Go, in spite of a couple of things missing from the language (that will probably get there in the end).
- Dewie 12y ago> Developers always seem to be complaining about having to type this or that, when they should be much more concerned with what they have to read! Or maybe they find terser syntax to be more readable. If verboseness was always more readable, if not necessarily more "writable", than terseness, then no one would have a problem with Java since it has good IDE support, including autocomplete and generation of boilerplate code. But it turns out that it's not just a matter of being lazy typists.
- 12y ago