7 ms·
As someone who recognizes himself as beginner programmer, i do not consider the borrow checker as my major issue with the language. Heck, i haven't even reached
by rishav_sharan 7y ago
As someone who recognizes himself as beginner programmer, i do not consider the borrow checker as my major issue with the language. Heck, i haven't even reached that issue.
Everytime that I have turned away from Rust, despite trying half a dozen times is due to its super busy and alien looking syntax. I just can't parse the code.
- paavohtl 7y agoWhat other languages do you have experience with? IMO the syntax is not wildly different from other statically typed curly bracket languages. IMO the most alien thing it has in terms of syntax is the use of a single quote for lifetime parameters ('a), but even that is based on the type parameter syntax for already existing languages (OCaml, F#, Standard ML).
- rishav_sharan 7y agoCrystal and vanilla es6 are my favoured languages. I also adore elixir. I have recently done some toy projects in f# using xelmish. I have written small projects in python, nodejs and lua. I have also tried Nim and wren. So while i am not much of a programmer, I love trying new languages. Out of all the languages that I tried, Rust and lisp are the two which scared me off outright just based on the syntax
- leshow 7y agoI don't see where you're coming from honestly. It has familiar C-style syntax, it has type parameters in the form java does with <>.
- rishav_sharan 7y agoSeeing my own list, i don't think i am comfortable with either c or java. So that's probably why. C, java, c++ are other notable languages i never could get into.
- leshow 7y agojavascript also has C style syntax, which you claimed to be familiar with. It's subjective, so I can't say that you're wrong. I just don't get it.
- skohan 7y agoHonestly I have a hard time understanding why you're being downvoted for expressing an opinion.
- MrBuddyCasino 7y agoRust is unpleasant to look at. I know its silly, but that my biggest gripe with it as well, aside from sometimes overly complex type signatures due to generics. As a reference, I consider Python and Kotlin to be a e s t e t i c.
- slezyr 7y agoAnd crystal lang, for static typed language example. https://crystal-lang.org/reference/overview/http_server.html https://crystal-lang.org/reference/overview/http_server.html
- skohan 7y agoI'm so not a fan of the ruby-style blocks. I never understood the appeal of typing "end" a million times instead of a single close brace.
- munmaek 7y ago{} blocks are used but for one line methods/closures. Since programming has nothing to do with typing speed, there isn't much difference between `end` and `}` other than `end` making more sense in ruby's english-like syntax.
- skohan 7y ago> Since programming has nothing to do with typing speed I have heard this a lot, and I am not sure I agree. I agree that the limiting factor for how long a project takes to finish is never going to be how fast you can type, but when I am really in flow I am actually typing pretty quickly, and I don't really like more friction when it's not necessary. Of course it's a matter of taste, but the argument that it's english-like never made sense to me either. There is no english sentence construct with "do ... end" or "wile ... end".
- leshow 7y agoThe problem with 'end' IMO is that you have to actually read the word, with } you don't. Of course, this is all useless to argue about. I quite like that lots of languages look different.
- pdpi 7y agoHonestly, I don't see any intrinsic problems with Rust's syntax that makes it unusually ugly. Rather, I think the problem is that the syntax is 100% fine in isolation, but has some issues when taken together with experience in other languages — when you skim the code, some parts of it beg to be looked at like C++, while other parts push you to read it like a functional language. Unsurprisingly, neither fully works, which makes the experience jarring. Once you accept that Rust is its own language with its own rules and stop trying to borrow (hah!) from your experience with other languages, it feels much better.
- guiriduro 7y agoOh yeah, I totally get that with Nim's * (export symbol), just can't get past my 20 years ago c++ pointer syntax brain wiring, even though I've barely touched it since. Always needs a double-take, which spoils reading flow.
- sagichmal 7y ago> Honestly, I don't see any intrinsic problems with Rust's syntax that makes it unusually ugly. You literally just got a user experience report claiming that it is.
- munmaek 7y agoIt's coming from someone who isn't comfortable with C or Java either. There's no winning over everyone. Of course Rust's syntax will be completely jarring if you're coming from Crystal or Ruby. In my personal experience it's a little jarring at first and then it completely goes away.
- spease 7y agoI’m comfortable with C/++ and Java, to a greater extent than a lot of people I’ve worked with. There are still things in Rust that are papercuts: * The need to put :: before <> in expressions for generic parameters, but not in type signatures. * Using :: instead of just . even though most of the time the naming convention will delineate the difference anyway * Error handling with futures * Self-referential structs * Passing a shared pointer through multiple move closures IMHO the frustration involved in these things is not typically worth being more explicit. The :: thing may seem a bit pedantic, but it is simply more physical effort (Shift-colon-colon vs dot) and creates more visual noise. If/when all of the things above are addressed, I think Rust could give Python a run for its money.
- _bxg1 7y agoMaybe it's my background (Java and JS with a little bit of C++), but I don't find it alien at all. I do find it really clunky in a handful of situations, mostly having to do with lots of nested containers (Option<Arc<Box<...), but luckily those are uncommon for most use-cases.
- skohan 7y agoThe bit which seems the most cumbersome to me is working with things like str/String and Path - it seems like there's always a lot of finagling and long chains of method calls to get things into the right type representation for a particular use-case. I'm still not so experienced though so maybe it gets better.
- _bxg1 7y agoI think what helps with that is building up a mental model of where things actually live in memory. If you create a new String, you're putting it on the heap. Which makes sense, because strings can be of any arbitrary length. It also makes sense, then, that you can mutate these heap-strings, because they have room to grow. In contrast, the only strings that can go on the stack (so you don't need String::new) are ones whose lengths are known at compile-time. So, a string literal (str). There are many things like this in Rust where if you just follow the compiler errors until you can make it happy, things will end up really convoluted and baffling. They'll also probably not perform as well. To really use Rust you have to absorb what's actually going on underneath its protections, and not just the errors that surface from them. This isn't easy, and is probably the dividing line between people who stick with it and people who decide it's not for them. You get about 50% of this picture for free (thinking in terms of stack, heap, references) if you've done C/C++ before. The other 50% is completely unique to Rust. But the key is to read the Book, follow guides, etc. Rust isn't really something you can learn just by hacking it out on your own, unfortunately.