6
jestdotty
24d

all the solutions in rust are always subpar

and it's not even the ownership stuff it's the syntax like with errors with stuff

you just can't be concise so don't even try it

write everything out imperative

Comments
  • 3
    Rust is for men who like men.
  • 2
    Rust is for men who like men.
  • 4
    imperative doesn’t mean what you think it means.
  • 2
    @whimsical men including women :]
  • 3
    @whimsical > 'Rust is for men who like men.'

    Backdoor sex joke, eh? If they exercise proper hygiene, they won't get dirty.

    /jk
  • 2
    You can! You just have to learn the damn language

    What part of the `?` operator is not concise? It's one character. Don't overengineer your errors for no reason and just use anyhow

    I swear you're creating so many problems for yourself that don't have to exist
  • 5
    @jestdotty you could look it up yourself https://en.m.wikipedia.org/wiki/...
    but ok…

    imperative means that you describe the steps how to perform a task, one after another.

    It‘s kind of the opposite of declarative programming, where you describe what you want as the result.
  • 2
    @jestdotty let x = y.map_err(|e| *can touch error*)?;

    or better yet with anyhow just

    let x = y?;

    if you don't need any special error handling
  • 2
    @12bitfloat log and exit early
  • 2
    @jestdotty you still have no clue
  • 3
    @jestdotty I just love correcting people lol.
    Funny how people get aggressive defensive about that.
  • 3
    @jestdotty Yeah, to be fair that exact pattern has also frustrated me in Rust

    But if you just return Result<(), anyhow::Error> from your main function then `let x = y.context("oh noes!")?;` just works

    If you really don't want Results (or cant) you could also write a quick macro to avoid the double indentations of a match: https://play.rust-lang.org//...

    Rust is so flexible, you can always find a solution
  • 2
    @jestdotty everything that I have to say you aren’t able to comprehend anyway. That’s what I learned from our little exchanges so far.
    Anyway, gimme my XP points already :]
  • 2
    @jestdotty Check out the Rust playground link I posted, I didn't write that code just for fun

    Honestly makes me think you don't even try to understand my comments and then you cry about how rust is bad even after I showed you specific solutions to you problem

    >.>
  • 2
    @12bitfloat oh whoops I automatically adblock links in my mind and didn't even notice it
  • 2
    @jestdotty Yeah but you see how this simple macro made the "if error log and exit" thing so much nicer? Its about pragmatism! A little bit of complexity can make your life a whole lot easier sometimes
  • 2
    @jestdotty Yeah but no kinda

    I almost never use macros. What I'm saying is: Do what makes the most sense

    A lot of what you are complaining about is easily solved with a function or macro. Why is it a problem if it can be solved that easily?
  • 2
    @Lensflare > @whimsical men including women :]

    *men who think they are women ;P
Add Comment