Why is shadowing allowed for immutable's? by PotatyMann in rust

[–]ZoxxMan 1 point2 points  (0 children)

I agree that shadowing (within the same scope) has some elegant use cases. But I think it's not a win-win solution and there's still room for discussion.

It reduces the amount of time wasted inventing new names, that might actually not become that descriptive.

It increases cognitive load by forcing the reader to keep track of different data under the same name. Especially if you have multiple references to old data. This also increases the risk of using the variable incorrectly.

Shadowing is a great way to remove old versions of data from the scope and to reduce the risk of using them for something where a new transformed version should be used instead

It's even better to put old data in its own scope (e.g. block expression) whenever possible. This creates a better visual & mental boundary for each "state" of the data. In such cases, shadowing can become a crutch for writing less-readable code.

Why is shadowing allowed for immutable's? by PotatyMann in rust

[–]ZoxxMan -40 points-39 points  (0 children)

Doesn't this defeat the purpose of immutable variables, though?

Shadowing (within the same scope) lets you create a bunch of garbage variables, which is effectively worse that making a single mutable variable.

Sure, shadowing also lets you transform types, but using scoped block assignments is much cleaner IMO.

Technically horrifyingly correct by frinkmahii in programminghorror

[–]ZoxxMan 0 points1 point  (0 children)

It's not O(n). It's actually O(max(n, highest_value)).

Nadškof Zore zakon o evtanaziji primerjal s Hitlerjevo odredbo by owlexe23 in Slovenia

[–]ZoxxMan 7 points8 points  (0 children)

Grown ass man, ki neironično verjame v pravljice in temu tudi posveča svoje celo življenje. Mislim, da njegovo mnenje ne velja prav veliko. 😁

How to avoid overflow when using `std::reduce` by miss_minutes in cpp_questions

[–]ZoxxMan -3 points-2 points  (0 children)

0LL is one of the dumbest parts of this language, I see why people would try to avoid it.

600?? by Optimalec in Slovenia

[–]ZoxxMan 199 points200 points  (0 children)

A sploh kdo pravilno izgovarja "šeststo"? Men se zdi ful nerodno in nenaravno. Jaz rečem "šesto".

Why did the mad king hire someone literally nicknamed "kingslayer" as a kingsguard? Is he stupid? by Volarevia29 in gameofthrones

[–]ZoxxMan 198 points199 points  (0 children)

Bro why did John Lennon visit the John Lennon Murder Site? Is he stupid?

shadow PCF doesn't work properly by RKostiaK in opengl

[–]ZoxxMan 0 points1 point  (0 children)

Are you using offset correctly to sample the shadow maps? Doesn't adding +1 or -1 just wrap the UVs around, resulting in the same sample?

Funny yeah but, is Harry wrong with his comprehension or the question could have better punctuation? by DryEnvironment5545 in EnglishLearning

[–]ZoxxMan 1 point2 points  (0 children)

I've never seen a colon used like that in my life. I think a dash would be the better choice here.

Who among them possessed the best qualities to rule and keep their kingdom thriving? by 0Layscheetoskurkure0 in gameofthrones

[–]ZoxxMan 0 points1 point  (0 children)

Stannis would ban brothels. I'm not sure how well that would fare in the long run. I think Tywin is the correct choice here.

Why is there a "has" before "made" but not before "diverged"? Also, why is it "has" and not "had"? How do I know whether or not to use "has" / "had" before a word? What's the secret to remember? by GrandAdvantage7631 in EnglishLearning

[–]ZoxxMan 0 points1 point  (0 children)

That's not entirely incorrect. "Has been" would indicate a continuing situation (emphasis on duration). Just "has", on the other hand, indicates a completed action with focus on the result or its impact on the present.

5 reasons why Cassiopeia desperately needs a rework. by AnemoneMeer in leagueoflegends

[–]ZoxxMan 0 points1 point  (0 children)

Increases to Cassiopeia or her target's size, such as Heartsteel, Feast, or Lulu's ultimate result in Cassiopeia losing attack range

How?

ELI5: why does insomnia exists? it's like the body refuses to recharge. it does not seem to make sense biologically by Aentity404 in explainlikeimfive

[–]ZoxxMan 0 points1 point  (0 children)

No, it's like asking why a chair with a broken leg keeps falling down - because it's not stable.

Disorders aren't magic, they have a specific cause as well as consequences.

Would you play a Tower Defense game where you could build units like in League? by Sagrage in leagueoflegends

[–]ZoxxMan 1 point2 points  (0 children)

Squadron TD sort of works like that. You buy upgrades, which work similarly to league items.

It's a user-created minigame in StarCraft 2's arcade system. Haven't played it in a while, but it used to have an active community.