[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: G6HOyvVbIAAbGpt.jpg (123 KB, 1080x802)
123 KB
123 KB JPG
I agree with her.
>>
How much did he spend on those implants I wonder
>>
>>107266712
May we see the early life?
>>
>>107266712
Wouldn't make a difference. Raheesh will continue using or_panic() instead of properly handling the error up the call stack.

unwrap also was a bad name, it should have been 'get' like in every other fucking language. unwrap makes no sense, neither does expect.
>>
>>107266712
this is retarded on multiple levels:

* if you want to critique the name "unwrap", you must start with the name, as nothing is actually "unwrapped", since we are talking about sum types with two variants, not a wrapper type.

* the _with() suffix in rust nomenclature is used for passing closures instead of values, and this name doesn't tell you "with what" exactly, so the alternative would have to be .or_panic_with_message(), which is too long, and discourages what should be used instead of the "no message" method.

* attributing errors caused by laziness to "bad naming", is itself lazy analysis.

* this is all moot bikeshedding since the interface is ("deeply") stable ;)

>noooooo r*ddit spacing wa wa
>>
Why not? Cniles don't read the spec and don't understand Rust. Just rename to panic so these stupid old farts don't misuse unwrap.
>>
>>107266712
literally just add in exceptions. the no-exceptions experiment failed, it was a disaster, we can move on now. we literally solved error handling and a bunch of autistic transsexuals threw it away because it wasn't mathematically pure.
>>
>>107266712
Mara Bos's suggestion to rename Rust's .unwrap() to .or_panic() and .expect() to .or_panic_with() is a hot take that highlights a real point of confusion for many Rust developers, especially newcomers.

While the proposed names are more explicit about the function's behavior, the likelihood of them being adopted by the Rust language team is low due to the high cost of breaking backward compatibility for such a fundamental and frequently used method.

Best Practices with unwrap()
Instead of renaming, the established Rust best practice is to use alternatives to .unwrap() for robust, production-ready code, treating .unwrap() as a tool mainly for:

Testing: In unit tests where a panic indicates a failed test.

Prototypes/Examples: For quick, non-critical code or tutorials.

Guaranteed Success: When you are absolutely certain, by logic or external guarantees, that the value cannot be None or Err (though .expect() is often preferred even here for a clear panic message).

For general-purpose code, developers should prefer:

Pattern Matching: Using a match expression for complete control over the Some/Ok and None/Err branches.

.map()/.and_then(): For fluent, declarative transformation of the inner value.

? Operator: The try operator to propagate errors back to the caller gracefully.
>>
>>107266904
Nah, it's still better than hidden exceptions.
>>
>>107266904
A Cnile left .unwrap in production, rofl. Do you leave assert in prod builds too? nvm you have no idea what i'm talking about
>>
>>107266866
>talking about sum types with two variants, not a wrapper type
One of the variants is a wrapper type, retard.
>>
>>107266913
Is this meant to be a low quality shitpost or do you genuinely think anyone cares about your retarded copy and pasted LLM response?
>>
>>107266927
ad hom. Find something actually wrong with the post or shut your bitch mouth.
>>
>>107266918
* variants are not types in rust (yet)
* both variants are tuple ones in the case of Result
>>
>>107266712
can you name 5 widely used codebases that use this renaming?
>>
>>107266915
c doesn't have exceptions, hence why it crashes the program on assertion failures. like certain other languages i might name.

>>107266914
designing programs to handle random unexpected failure objectively worked better than this crap. you cannot design perfect programs, design them to fail instead.
>>
>>107266914
>exceptions are hidden control flow! much better to just panic and crash and take down half of the web! its no longer hidden control flow!
lmfao rustfags
>>
>>107266913
bro what is this bit kek

>>107266927
it's been going on all day for every thread
>>
>jeet tards don't know that we will also have effects as a part of function signatures in nextgen langs, while they are still trying to argue, with zero knowledge, for exceptions because they are used in the two wage-slave langs they know
lol
>>
>>107266915
of course you leave asserts on in production. what else would you do? keep the system running with broken invariants so it can corrupt customers' disks and give some random guy a billion dollars? it's only an issue if you're using asserts to handle errors, but that's not what they're for
>>
>>107266712
Coding in rust should be punished with forced de-transitioning.
>>
>>107266971
I'm not talking about hidden control flow.
I am talking about hidden exceptions. Each line is a minefield with hidden exceptions.
With Result you opt into exception with unwrap or expect.
Cniles don't have tripple digit IQ.
>>107266959
Designing to fail comes with a performance overhead.
>>
>>107266712
>her
>>
>>107267037
>what else would you do?
>it's only an issue if you're using asserts to handle errors
and this cloudflare cnile retard did just that
>>
>>107266712
>tranny
>leaves enormous fake HRT tits popping out in every single picture
and (((they))) still want you to believe this isn't a fetish thing, right.
>>
>>107267114
>tits popping out in every single picture
so average female-socialized behavior in the year 2025. yeah this is really earth-shattering.
>>
>>107266712
Zig doesn't have this problem. No zig program aborts on failure, despite errors being values like in rust.
>>
>>107267151
>akshually our no-error-context stackful errno is better
lol
>>
>>107266712
I don't. unwrap means what it says, unwrap the fucking monad.
>>
>>107267081
>Each line is a minefield with hidden exceptions.
Thats the entire point.
Once again, you would rather have your program crash and take out half the internet then add a "hidden exception" which would bubble up and be handled eventually, thus avoiding the crash.
Rustfags will never write real systems software.
>>
>>107267459
>add a hidden exception
>add
Nigger, the exception is already baked in and its hidden. Catching it is optional.
Cnile or a nocoder? Can't tell the difference these days
>>
>>107267137
>female
>>
>>107267082
>>107267509
Stop acting like you wouldn't
>>
>>107266712
>her
>>
>>107267035
>effects as a part of function signatures
Those are callbacks, Rakesh. Algebraic effects are not that.
>>
>>107266712
How can you be a tranny and still be bad at rust? The effects of unwrap is pretty much rust 101
>>
>>107266756
based fellow early life enjoyer
>>
>>107268527
what the fuck are you on about?
>>
>>107267558
God imagine ruthlessly ravaging the pathetic failed male Rust troon with your huge throbbing Cnile C-had C-ock.
>>
>>107268727
Lease gay cnile
>>
>>107266756
You can see the milkers right there!
>>
>>107266866
>Le sum types
It's literally Option<T>, Result<T, E>, these are wrappers for T.
>>
she's kinda right you know



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.