Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
notwithoutmyanus
Mar 17, 2009
So I read the OP, and I know a beginner-ish level of javascript, a middling level of python, and I dabble a little bit in SQL queries. I've never really broken into full developer understanding of any language I think, maybe lacking fundamentals. Is rust okay for me to dive in and try to make that big jump or is that a bad idea at this point? I feel holistically my programming background is not at all up to proper practice, but I'd rather make the things I want to make myself than end up hoping someone else can, starting with some baby steps. I do know some folks in my circles who develop who have felt strongly Rust is the language to want to learn.

Adbot
ADBOT LOVES YOU

notwithoutmyanus
Mar 17, 2009

prisoner of waffles posted:

seconded. if you want to learn programming in general and not in some specific arena that another language would do better (JavaScript or TypeScript would be this for web stuff, Rust would be one option for “””close to the metal”””, there’s other area-language pairings) Python is good.

On the other hand, Rust educational materials are supposed to be really good and extra guidance/constraints can be helpful when you start learning a generalist skill… the Rust books may presume some familiarity with programming concepts but it sounds like notwithoutmyanus has some of that familiarity?

Yeah I pretty much jumped right in on the book..Only weird thing to me so far is mentally processing :: and turbofish although I understand why it's there. I have done a little python and a bit more familiarity with JavaScript/Python as I used to write algorithms in JavaScript but I always struggled with large functions and never really built my own code incorporating libraries in a long time. So rust kinda fills the perfect niche it seems. I don't mind having to define types for variables, and before I even read the book at all I was kinda trying to write up a framework for what I wanted to grab from API 's by making a struct with all the variables underneath the API would spit out. Not sure if it was the right idea or not but it did make sense immediately.

Edit: I did look at golang a little but eh. I will stick with this.

notwithoutmyanus fucked around with this message at 13:30 on Dec 30, 2022

notwithoutmyanus
Mar 17, 2009
Well I haven't seen any other languages using :: or <> like that. In that sense I was more used to JavaScript with function.thing

notwithoutmyanus
Mar 17, 2009

Love Stole the Day posted:

MyStruct::my_function is like MyClass.prototype.my_function you probably already know this idk

right, but for me I internalize a lot of poo poo that I probably shouldn't, so it's basically me reading it going "this is different from (this)". Not saying it is, or that it's a problem with rust, it's me in processing what I see weirdly. To be clear, it's me being more a newbie to rust than some sort of "rust" issue.

notwithoutmyanus fucked around with this message at 18:59 on Dec 30, 2022

notwithoutmyanus
Mar 17, 2009
Does anyone have a good reference for functions with Dyn/when to use/when not to use?

notwithoutmyanus
Mar 17, 2009
I'm trying to wrap my head around this:

code:
fn main() {
    let mut a: [i32; 6] = [10, 20, 30, 40, 50, 60];
    println!("a: {a:?}");

    let s: &[i32] = &a[2..4];

    println!("s: {s:?}");
}


That part that throws me off is: let s: &[i32] = &a[2..4]; . Wouldn't specifying that you're borrowing cells 2-4 print out 20 30 and 40, not just 30 and 40? I know I'm wrong/missing something here, so why am I wrong?

Adbot
ADBOT LOVES YOU

notwithoutmyanus
Mar 17, 2009

Ralith posted:

Also, a .. range excludes its endpoint.

Ah! Thank you! This is the other side of what I was wondering. I did get the order, but this was what I missed. The other post made sense and I wasn't clear on that I understood reference to 2 = 3rd cell in the array, it was just...this, was what I was trying to understand.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply