4 ms·
When people tell me that Rust is nice to write it feels like gaslighting. I want a smooth path from not having code to having running code and Rust doesn't offe
by jstx1 4y ago
When people tell me that Rust is nice to write it feels like gaslighting. I want a smooth path from not having code to having running code and Rust doesn't offer this at all.
- unshavedyak 4y agoI think it depends on what alternate paths the person is thinking of. I throw most GC languages out. So now my path is mostly (not all) Rust, C, C++, etc. Rust is great in that regard, for me at least. The stdlib is awesome, crates are awesome, powerful features like Iterators are awesome, and being confident in the code i produce is awesome. Which isn't a knock at C, but C just isn't for me.
- wyager 4y agoI'm not sure how to interpret the "smooth path" thing in a way that applies to most languages but not rust.
- xvedejas 4y agoWhen you find the path you need smoothest is the path from compiling/running code to _correctly working_ code, I think that's where Rust shines. Yes, writing code that will compiler is harder; and yes, you _will_ learn to more effortlessly write code that compiles.
- Ygg2 4y agoThat's subjective. I find it mostly natural (until you get into type bound fuckery) but I can't for love of God get good at Prolog or Lisp.
- JohnFen 4y agoGood point. I'm finding Rust unpleasant (but expect that once I've crested the learning curve, this will change), but I find Lisp very intuitive and pleasant. Probably has something to do with how we conceptualize things.
- emschwartz 4y agoDepending on what language you're coming from, I think that's totally fair. A part of Rust that I very much appreciate is that once you write Rust code and get it to compile, there's a pretty good chance that it's going to do what you expect. As someone who is new to Rust, it's definitely no small feat to get the code to compile in the first place. But I think that's one of the main things people tend to love once they get over the initial hump of grokking all the different ways of passing variables around.
- no_wizard 4y agoI wonder if this is hurts testing culture with Rust. People think the compiler is magical enough they doing out a lot of energy into writing good tests still
- dcow 4y agoYou still need functional tests in rust.
- tialaramex 4y agoIMO more than made up for by providing the tooling out of the box. It's easier to write your basic tests in Rust than it is in many languages because the Rust ecosystem already knows how to do unit testing and doc tests as supplied. If you write comments with triple slashes, they're (Markdown format) documentation in Rust. If you use that Markdown to write an example of how to use something in your documentation, Rust's out of box tooling will assume that it should check your documented code works, by default. So you go from "I wrote an example in the source code of how to call my foo() function" to "I have basic HTML document for foo() and a test proving foo() basically works" in zero steps. /// Appends an element to the back of a collection. /// /// # Examples /// /// ``` /// let mut vec = vec![1, 2]; /// vec.push(3); /// assert_eq!(vec, [1, 2, 3]); /// ```
- unshavedyak 4y ago> But I think that's one of the main things people tend to love once they get over the initial hump of grokking all the different ways of passing variables around. Agreed. I think the GP comment really underestimates how smooth Rust feels to Rust devs who have gotten over that hump. I've programmed in many languages and i confidently do not feel i am slower in Rust than other languages. Maybe not faster, but not slower in development speed. But what i do get, for development speed, is the ability to solve large problems with many, many tools. I found this quite annoying in Go. In Rust, it's great. Complex problems are still complex, and Rust doesn't inherently simplify them - but it gives me the tools to come at problems in many ways. Which if you need it is invaluable.
- tialaramex 4y agoFor me at least, Rust smooths the path from not having code to having code which is correct. Out of Rust, C#, Python, Go, Java, and C, which I've spent non-trivial time writing, Rust comes easy first for the likelihood that my program actually does what I intended once it runs. Python is last, while C gets special commendation for being almost as unlikely as Python but with the extra fun of more Undefined Behaviour so when it doesn't work it's far more difficult to track down why not. Edited: However, I don't see why my parent got down-voted.
- mcronce 4y agoI'm with you. Getting something working is a lot quicker when the "cargo check; fix errors; cargo check" loop catches the vast majority of your bugs than building a container image, uploading it to staging, and finding the magical combination of inputs that triggers that code path.
- crispinb 4y ago> tell me that Rust is nice to write it feels like gaslighting There's a weird ideology or cultural attitude prevalent in Rust circles which does, indeed, involve endless gaslighting of anyone having difficulties with the language (at any level). It involves, amongst other things, insisting that the language is essentially so easy to write that any difficulties anyone has are not, in fact, difficulties, and the person claiming to experience them is not, in fact, doing so. It's a form of group-identity narcissism I'm sure anyone will recognise as it's not unique to Rust (and seems to be something tech circles are particularly prone to, for, I suspect, demographic reasons). My guess is this will diminish with Rust because of its fast growth in user numbers. It already seems more prevalant in some forums than others (stay away, for example, from the official Rust user forums, which are noxious).
- selfmodruntime 4y agoYou‘re correct. What feels nice about Rust is that its typing system is tightly coupled with solutions that are impossible to use incorrectly. My Mutex wraps my value. There is no way to access my value without correctly locking it first. I can‘t not handle all of my enum variants when matching. To get to the value of my result, I am forced to unwrap it, thereby handling a possible error. While arriving at a compiling solution can be annoying, it feels nice to be able to trust.
- jackmott42 4y agoPeople who say that are either delusional or speaking of the context of needing low level control. So it can be a lot nicer than writing C/C++/Fortran. It has lots of nice aspects, amazing package manager, amazing doc system, compiler errors. But fundamentally there is a whole new sort of thing to worry about compared to GC languages.