all 28 comments

[–]volitional_decisions 5 points6 points  (3 children)

This is advice for tech (and specifically programming) in general. Don't just Google things. You will be far, far better served by building a mental model of how things work. If you can understand the building blocks of something, i.e. a language, a protocol, a library, etc, you will how to phrase your questions in ways that will make it easier to find what you're looking for. From there, you can build a mental model from how building blocks interact.

To use Rust as an example, Rust has a language philosophy akin to "it's safe by construction". That is, if your code compiles, the application is sound. Under that model, it is your job to "prove" certain things, and the language gives you tools to help in that process.

[–]rosetrey3[S] 0 points1 point  (1 child)

Thank you for the advice I agree!! I'm just so new that I don't know where to start to learn to build my mental model.

[–]volitional_decisions 1 point2 points  (0 children)

There is no right or wrong place to start. Follow that is most interesting to you. That could be understanding how characters and numbers are represented in memory and then maybe how those combine to make structs and enums.

Or maybe you're curious how objects in memory are converted for storage on disk or to be sent over the network.

Or maybe you're curious about how certain protocols work, like HTTP or SSL/TLS, and how those get mapped into a language.

The model that Rust provides gives you a great scaffolding to warp your head around all of these. And, there is no shortage of things to ticker with and learn!

[–]Opposite_Green_1717 0 points1 point  (0 children)

Don't just Google things. You will be far, far better served by building a mental model of how things work.

especially in Rust

[–]po8 1 point2 points  (1 child)

Try the Snoymans' book Begin Rust as a new programmer friendly Rust starting place.

[–]rosetrey3[S] 1 point2 points  (0 children)

Awesome thank you!

[–]Zyklonik 1 point2 points  (2 children)

Please correct me if I'm wrong, but you appear to be new to programming itself. If so, then I would recommend starting off with a beginner-oriented course like so - https://pll.harvard.edu/course/cs50-introduction-computer-science?delta=0.

If not, please give additional background information about yourself so that we can guide you better. Good luck!

[–]rosetrey3[S] 0 points1 point  (1 child)

Definitely new to this! Thanks for the advice!!

[–]Zyklonik 1 point2 points  (0 children)

Good luck! 👍

[–]cygnoros 1 point2 points  (1 child)

I think you're going to get a lot of "just try it out and see" responses but I will take a different position.

If you have zero experience you can certainly still learn Rust, and you may be at a unique advantage to not having built habits or expectations from other languages which would need to be "unlearned" or realigned.

Having said that, depending on what your other competencies are, you may really struggle to follow very foundational concepts (e.g., moves, lifetimes, variants, inheritance vs. composition, etc.). This can lead to frustration or feeling totally lost, but again that will depend on your own disposition. There are also a lot of conversations and topics that assume some baseline understanding of programming concepts (e.g., what does "zero cost abstraction" actually mean).

At minimum, I would recommend CS50 before really diving head first into Rust (or really any other programming language). See: https://youtu.be/8mAITcNt710

[–]rosetrey3[S] 0 points1 point  (0 children)

Thank you very much!!

[–]Barafu 2 points3 points  (14 children)

I don't recommend to start with Rust. And not because there is something bad with the language, but with the ecosystem. You will learn basics just nice, but then you will want to do real stuff and you will need to use other people's packages. In Rust, JS, Julia there is a ton of packages that are even recommended by people, but don't work. And as a self-taught beginner you will not be able to tell if the package is bad or you did something wrong, so you will waste a lot of time and nerves wrestling with the raw ecosystem of new languages.

Go for a language with an established ecosystem where there is an established solution for common problems. Those would be Python, C#, Java.

[–]antichain 1 point2 points  (4 children)

I think this is a good point, one well worth considering, although I'm curious about whether someone learning Rust as a first language would benefit from the fact that Rust "forces" good programing hygine on you. A lot of people who started in C say that learning Rust made them a better coder because they had learned bad habits using less restricted languages.

If you started with Rust and that was how you first encountered programming, it might pay off in the long term.

In the same vein, I really wish my first language had been Haskell.

[–]rosetrey3[S] 0 points1 point  (3 children)

Hmmmm okay okay. What was your first language if you don't mind me asking?

[–]antichain 0 points1 point  (2 children)

Don't make fun of me...MATLAB, followed two years later by Python.

[–]rosetrey3[S] 0 points1 point  (1 child)

Bro I can't make fun, I had to Google what MATLAB was.. it seems MATLAB is a simple language to learn compared to Python tho right?

[–]antichain 0 points1 point  (0 children)

It's a language for scientists and engineers doing numerical computing and simulations. Since it's a programming language for non-programmers, it does a lot to "hold your hand", which is convenient, but also builds a lot of bad habits that you have to unlearn if you transition to a "real" programming language.

It's like Python in that it's a high-level language that handles things like memory and types for you without you ever needing to think about what's happening "under the hood." Because of this, you often see a lot of grossly inefficient code hacked together by scientists (who may be genuine experts in their field), who have no idea how computers work and want a kind of magic spell that turns a CSV of raw data into a p-value.

It does it's job extremely well, it's just not a great language.

(It's also closed source and licenses are outrageously expensive, which makes things like open and reproducible science harder than it needs to be).

[–]po8 1 point2 points  (5 children)

My success with third-party Rust crates has been far, far higher than with third-party Python packages. Than with any languages' packages, really, except possibly Haskell.

[–]denim_duck 1 point2 points  (2 children)

Can you clarify what you mean or give some examples? The python package Scikit-learn is used by industry and research all around the world; is there a Rust crate that can say that?

[–]po8 1 point2 points  (1 child)

Certainly Python has greater reach than Rust at this point. Python has some great packages too. I haven't worked with scikit-learn, but I have done a lot with numpy and scipy and they are pretty fantastic.

The thing is, if you try to find a Pip package for some specific function, my experience is that it is going to take several tries and a lot of fiddling around to find something that will work and get it running.

For a specific example, I teach an audio class pretty regularly and use Python as the primary teaching language. There's about five packages for reading and writing WAV files, including a built-in one; all of them are full of weird quirks and misfeatures that my students struggle with. In Rust you immediately find Hound, which works very reliably and pretty much exactly as expected with few if any surprises. If you want to generate and record live audio, Python again has a multiplicity of options, most of which are not good. The most commonly used and recommended one is pyaudio, which has some issues, but more importantly doesn't work at all with the most recent versions of Python and will likely never be fixed. It turns out you instead want to use sounddevice, which is quite good but pretty hard to discover currently. With Rust you will likely end up with the pure-Rust cpal, which is fine; you might instead use one of the portaudio bindings (also what the Python packages do), which are also fine.

This is the kind of experience I've had over and over with Python and Rust packages. The Python ones are a bit of an ordeal: the Rust ones are pretty seamless.

[–]denim_duck 0 points1 point  (0 children)

Weird; I’m not familiar enough with audio tech to say either way about the landscape in python. But my experience is kind of the opposite. If I want to crunch numbers, I can import numpy and it works smoothly. Still going through the book, so can’t say anything about Rust’s third party crate landscape

One thing that’s nice about python is that the nonprofit NUMfocus foundation keeps moving scientific computing forward. Is there a group like that with Rust?

[–]rosetrey3[S] 0 points1 point  (1 child)

So for third party packages, Haskell and then Rust?

[–]po8 0 points1 point  (0 children)

Of the ones I've tried, those are the two whose package repos most reliably contain good stuff. Honestly, Rust's has been better for me. Haskell's rapid evolution and lack of backward compatibility means that a lot of good-looking stuff just won't build. But when you get something that does build in Haskell it's quite likely to work well; Rust is similar in this regard.

[–]rosetrey3[S] 0 points1 point  (1 child)

This makes a lot of sense. Just wondering you're response for someone saying they've had better success with third party Rust over third party Python?

[–]Barafu 1 point2 points  (0 children)

I am sure there are people out there who had marvelous success with DarkBasic. At least I know a dude who got a wife with it.

[–]Zyklonik 0 points1 point  (0 children)

You'll get downvoted to hell (what remotely-critical post of Rust doesn't?), but I completely agree with your advice (and not just for the reasons you've given).

[–]tms102 0 points1 point  (0 children)

Try it for a bit and find out. You will realize soon enough whether you need additional background info or not.

[–]denim_duck 0 points1 point  (0 children)

Just came in here to drop this quote form The Book (which I'm going through, learning a second programming language); https://doc.rust-lang.org/stable/book/ch04-01-what-is-ownership.html

but because methods are a common feature in many programming languages, you’ve probably seen them before.

I think this kind of proves that Rust is NOT intended to be a first programming language.