HackerTrans
トップ新着トレンドコメント過去質問紹介求人

arwalk

no profile record

コメント

arwalk
·11 か月前·議論
Sure. Did i dismiss the article? Or was I only saying that the example was bad?
arwalk
·11 か月前·議論
`FileError.AccessDenied` is a unique value in a unique error set. `error.AccessDenid` has not been defined anywhere and hence is just given an integer value at some point by the compiler.

As I stated before, this error wouldn't even exist in the first place in no codebase ever: look how the method that fails returns a `FileError` and not an `anyerror`

It could be rightly argued that it still shouldn't compile though.
arwalk
·11 か月前·議論
I'm not saying that zig has the same level of safety than rust, i'm just saying that grabbing a knife by the blade is not an argument for using a spoon.

The error presented in this example would not be written by any zig developer. Heck, before this example i didn't even knew that you could compare directly to the global error set, and i maintain a small library.

zig and rust do not have the same scope. I honestly do not think they should be compared. Zig is better compared to C, and rust is better compared to C++.
arwalk
·11 か月前·議論
The real problem is not about the if-else, its that he's comparing to the global error set, and not to the FileError error set he created specifically to define AccessDenied.
arwalk
·11 か月前·議論
The example is a bit dubious. Sure, it compiles just fine, because the author is not using errors properly in zig. Here, he uses the global error set with `error. AccessDenid`, and as stated, it compiles just fine because when you reach the global error set, it's integers all the way down.

If the author had written `FileError.AccessDenid`, this would not have compiled, as it would be comparing with the `FileError` error set.

The global error set is pretty much never used, except when you want to allow a user to provide his own errors, so you allow the method to return `anyerror`.
arwalk
·2 年前·議論
> Polling numbers (actual gauge of public sentiment)

Polls have never been faithful of actual public sentiment on any political subject since the end of times. People will not give their true opinions in polls on any subject that could be perceived as complex. Also it is actually very hard to have a good representation of the entire population of your country.

Just take the crosstabs of the survey you linked: about the 2024 election vote, in this survey, 70% of people polled are negative toward trump. The 2024 election results gave almost 50% of the popular vote to trump.

My point is only that this poll do not bring any valuable information here, just like any poll. The public sentiment toward Luigi Mangione seems favorable in appearance, but twitter is not representative of the US population either. So, who knows?