4

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
  • 2
    Rust is for men who like men.
  • 1
    Rust is for men who like men.
  • 3
    imperative doesn’t mean what you think it means.
  • 0
    @whimsical men including women :]
  • 1
    @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
  • 0
    @Lensflare what's it mean then
  • 0
    @12bitfloat let Ok(x) = y else { can't touch the error }
  • 3
    @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.
  • 1
    @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
  • 0
    @Lensflare right... so write everything out imperative

    IDK why you're so crabby
  • 1
    @12bitfloat log and exit early
  • 1
    @jestdotty you still have no clue
  • 0
    @Lensflare well you're the one trying to be snob of knowledge here, so, whose fault is that?!
  • 1
    @jestdotty I just love correcting people lol.
    Funny how people get aggressive defensive about that.
  • 0
    @Lensflare I don't see a correction... you've said nothing lol

    but so be it. think you're special. I much rather you had something to say but it seems you're on another quest
  • 2
    @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
  • 0
    @12bitfloat yeah the solution is a match but uegh matches everywhere with that redundant Ok case line

    I'm nitpicking

    I must reduce my standards

    I'm too used to making javascript look like Haskell

    I must suffer more pain until I become better
  • 1
    @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 :]
  • 1
    @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

    >.>
  • 1
    @12bitfloat oh whoops I automatically adblock links in my mind and didn't even notice it
  • 0
    @12bitfloat right, cuz you mentioned macros

    not too sure of use cases of macros. soon rust will look like lisp I guess?

    but yeah I am being fatalistic and savage. that's kind of how I move in
  • 1
    @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
  • 0
    @12bitfloat but then it all looks like a macro call... you can't skim the code's structures to know what's going on lol
  • 1
    @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?
Add Comment