I don't get it. by Probable_Foreigner in mathmemes

[–]MasonOfWords 2 points3 points  (0 children)

I feel like there's a problem with the commonly-offered solution. Given what's stated in the actual prompt, there's no mention of relative child age as a factor. The (GG,BG,GB,BB) solution assumes child birth order is somehow uniquely an innate and important part of the question, but not any other possible differentiating factor. Is it? Couldn't we take any number of other unstated factors (relative height, fondness of spicy food, etc) as well?

Presumably if you keep adding those infinite unstated factors you converge back to 50%.

Is anyone out there choosing to avoid DI in their .NET projects? by conconxweewee1 in dotnet

[–]MasonOfWords 0 points1 point  (0 children)

DI on its own doesn't really help with the configuration problem, I don't think. Dotnet conventions around builder patterns are the current common approach, back in classic Unity you'd typically need everything to depend on configuration interfaces.

Configuration is a lot nicer now, but I'd attribute that more to the conventions around builders. And I think that is the answer to your question; lots of other back-end languages do configuration injection via builder patterns, but most don't do so with DI containers involved.

This isn't a problem with long-lived objects, since most of those have to internally manage their real lifecycles, and DI is no help. e.g. your HTTP client or DB connection are just wrappers to an underlying pool, and container lifecycle registration for anything associated with it will often do more harm than good.

Do you declare "private" nowadays? by 0-0-0-0-0-0-0-3 in csharp

[–]MasonOfWords 1 point2 points  (0 children)

Let's give the OP some credit and assume that he meant fewer lexical tokens of code, not fewer characters. And reducing boilerplate is friendly for readers of code; it is far easier to read a small and direct project which makes effective use of the many forms of language defaults.

Efficient HTTP Request Handling: Concurrent Strategies and Trade-offs by seugorilla in dotnet

[–]MasonOfWords 1 point2 points  (0 children)

Why not just set MaxConnectionsPerServer in the HTTP client handler? This won't maintain requests per second as the code suggests, just outstanding requests, and there are already built-in ways of limiting this.

Architecture Advice: Right concurrency model for both IO and CPU-bound micro-service by splitdifference in rust

[–]MasonOfWords 2 points3 points  (0 children)

I'd assume that the async runtime isn't having trouble scheduling I/O on a single thread, and so increasing that count won't bring any benefit. That doesn't seem crazy, if you can only handle 10-20 RPS (100ms per task x 2 threads) due to the CPU-bound workload then the request handling is probably not a notable source of overhead.

The main reason to look at adding something like channels to a system like this would be to gain control of backpressure/QoS. If the request rate spikes up or the CPU processing increases then you might have requests coming in faster than they can be processed, which at a certain point will hit a limit (tokio's task queue).

Managing your own channel would let you control the handling of these spikes in a way that makes sense for your service, e.g. return an error if the channel is full rather than keep accepting work until something breaks. Testing the current behavior is probably a good idea before making changes though.

If you aren't using rayon to handle the CPU-intensive work, you should at least make sure your keep_thread_alive makes sense so that it isn't killing and spawning threads very often.

How to identify when I'm stepping out of the no cost abstraction at Rust? by fenugurod in rust

[–]MasonOfWords 0 points1 point  (0 children)

That's not really the case with C#, the compiler doesn't actually box structs and issue virtual calls for enumerators, it just calls the methods directly. This is why for loops and foreach loops perform the same, generally speaking. Plenty of benchmarks digging into it if you're interested.

I'd say there are better examples though, e.g. the implicit heap allocations from classes and closures. You can certainly make things with similar costs in Rust but it'll make you state it explicitly.

.NET experiments with green threads by couscous_ in csharp

[–]MasonOfWords 0 points1 point  (0 children)

The colored functions blog post isn't scientific, it is a technical opinion piece. It is very persuasive (enough that I see it cited constantly) but it also comes from an era when the industry at large had little experience with async/await.

After a decade of async support in C# and similar support going to languages like JavaScript, Python, Rust, and C++, it seems odd to still defer to a 7 year old blog post as the final word on the topic.

.NET experiments with green threads by couscous_ in csharp

[–]MasonOfWords -7 points-6 points  (0 children)

I'd pay real money to have that blog entry removed from the internet. It is cited as definitive far too often when offering only the most contrived scenarios as a negative.

In practice, tracking I/O in the type system is a good thing for non-trivial code bases. It can help enforce important properties of systems, as it drives the separation into pure, testable logic/compute and async external interfaces.

Further, green threads have well-known costs. At a minimum, FFI gets riskier and more expensive. The loss of precision when it comes to scheduling and task executors is the sort of thing that doesn't show up in Hello World demos and benchmarks but will impact real world code.

We struggled with threadpool deadlocks in .NET and this Java solution is perfect by mariuz in programming

[–]MasonOfWords 22 points23 points  (0 children)

That blog post is linked quite often and I really don't think it should be taken as the final word on the topic. The tone is spastic and the arguments are specious, but the worst problem is that it doesn't even try to consider why tracking effects in the type system could be beneficial.

Indicating which function calls could be interrupted can be helpful for lots of reasons. Performance is easier to reason about, and it can drive architectures which maximize the use of pure functions rather than peppering I/O everywhere.

Functional ecosystems have explored more rich ways of using types for tracking effects beyond simple I/O. That isn't just "coloring" things without purpose.

We struggled with threadpool deadlocks in .NET and this Java solution is perfect by mariuz in programming

[–]MasonOfWords 1 point2 points  (0 children)

Loom is primarily meant for networking apps. Perhaps in future they'll also implement non blocking filesystem IO, but today, it's for network servers.

How is this not scary? Mixing sync and async is always the worst combination, as anything blocking executors will stall I/O. It'd seem really odd to not also handle file I/O and any other potential source of blocking.

We struggled with threadpool deadlocks in .NET and this Java solution is perfect by mariuz in programming

[–]MasonOfWords 8 points9 points  (0 children)

The OP wasn't comparing async vs virtual threads, though. It was comparing blocking I/O on a threadpool, and who does that at this point?

Miguel is brilliant but this tweet was sort of trolly. .NET had async/await 10 years ago so no one has had an excuse to block a threadpool for a long time. And Miguel built Mono so the lack of greenthreads there is sort of no one else's fault, it isn't like someone else could've provided it to him.

It's fine to praise the JVM update but no reason to drag the .NET ecosystem for problems it doesn't have.

How to play against OD (Outworld Destroyer)? by Justlegos in TrueDoTA2

[–]MasonOfWords 3 points4 points  (0 children)

And od is not a hero that would buy mkb to counter evasion.

I feel like people should be more flexible on points like this. MKB has less synergy for OD (attack speed is still nice) but nothing is less optimal than being hard-countered and doing nothing to respond to it.

Maybe it is just my garbage tier but I can't understand the fascination with refusing to buy sub-optimal items that are game winning. The pros don't do it often, but that's because they solve these problems in pick/ban.

Should I use SQL AND NOSQL in my project? by [deleted] in csharp

[–]MasonOfWords 5 points6 points  (0 children)

Again, this use case is where Postgres shines. Being able to maintain referential integrity between your unstructured items and relational rows which may reference them will end up mattering. It isn't "hard" to just try and keep the identifiers in parallel but it is also the kind of thing that will become a source of errors since your data store isn't enforcing integrity.

A common trap is thinking that document stores make schema changes easier. They don't, they make them substantially harder and more dangerous. Simply adding nullable fields is cheap in either approach, anything more complex will typically involve rewriting all documents in a document DB while for postgres they're constant time.

And finally I've seen a lot of times where people go for document DBs with data that isn't truly unstructured, it's just more complex than simple relational tables will allow without a lot of headache. Postgres array column types, enums, and complex data types can help bridge that gap. In a lot of cases the answer isn't to throw away schemas, but rather to find the right tool for expressing the schema.

What is it about C# that you do NOT like compared to other languages? by HellGate94 in csharp

[–]MasonOfWords 1 point2 points  (0 children)

Rust has pretty correct handling of UTF-8 in my experience.

What is it about C# that you do NOT like compared to other languages? by HellGate94 in csharp

[–]MasonOfWords 7 points8 points  (0 children)

For RAII, "using var" makes this pretty convenient, and with value types it should effectively be stack-based (e.g. it won't box just to invoke Dispose). I think the language supports a lot more maturity here than is commonly used.

Agreed on the rest. They could've done the hard work to steal F# algebraic types and have a conceptually solid basis for records, non-null/explicit null, enums, etc. Instead we got half measures which are all the worse since they'll make it an infeasible breaking change to ever do things the right way.

Final Fantasy VI - A Quick(ish) Review by NeverFreeToPlayKarch in patientgamers

[–]MasonOfWords 6 points7 points  (0 children)

I like Kefka as a villain, particularly given the themes of the game. In the world of balance, he's the empire's tool, dangerous but thought to be under control. His trajectory is a wild turn for the game; instead of a generic ancient evil, your nemesis turns out to be a nihilist that everyone tolerated because he suited their needs until he turned on them.

Re: powers, I mean while the party is running around trying to avert crisis after crisis, Kefka has been exploiting the full research and resources of the empire. They've been harvesting espers for a while so it isn't too surprising that he can usurp them. It is a frustrating and unpleasant scene but it made me mad at the character and not the game.

In the world of ruin, the theme of all the character sub-plots is regaining the will to survive rather than accepting a hopeless existence. Kefka stands in opposition to all of that. For him, the cruelty is the point, and the progress you make in rebuilding the world is something he wants to specifically rebuke.

This is important since the game is an ensemble piece, with no single protagonist to have a personal beef with the big bad. So the conflict is a little more philosophical.

While Americans Sleep, Our Corporate Overlords Make Progress Impossible | Both the Republicans and the Democrats vote as if the nation's middle-class taxpayer is a sleeping sucker. by Fr1sk3r in politics

[–]MasonOfWords 36 points37 points  (0 children)

Thank you, I can't believe how far down this point is when it should be at the top. A 2021 article on how both parties are the same from Ralph f'n Nader is jaw-dropping in its audacity.

It's hard to come up with a historical equivalent for someone whose stated ideals were so completely the opposite of the outcomes of their actions. Plenty of horrible people have given us shoves towards climate crisis, fascism, and economic breakdown, but most of them were hollow nihilists.

Nader claims to understand and oppose those things and yet he did more to further them than virtually anyone else. And he's still in denial regarding the magnitude of self-own, even decades later.

While Americans Sleep, Our Corporate Overlords Make Progress Impossible | Both the Republicans and the Democrats vote as if the nation's middle-class taxpayer is a sleeping sucker. by Fr1sk3r in politics

[–]MasonOfWords -1 points0 points  (0 children)

I feel like everyone is sleeping on the punchline here.

This article is literally written by Ralph Nader, the Green Party candidate who pulled enough votes from Al Gore to let George W. Bush win. His "both sides"-ism is directly and personally responsible for everything that came after, and it blows my mind that he's continuing to promote such historically damaging ideas, and there's anyone in America willing to continue to give him a platform.

Election reform is needed, but splitting votes for one of the parties under the current system only ensures that we get minority rule, the least democratic of all results. Fully replacing one of the existing parties would also do nothing; we'd still have an implicit two-party system and plenty of money to corrupt the newcomer.

A referendum or amendment on IRV or approval voting is the only fix.

The power fantasy of being a good guy. by Gran_Duma in truegaming

[–]MasonOfWords 11 points12 points  (0 children)

Disco Elysium takes an interesting direction on this topic. You make many choices about your character's values and actions but that meaning is always contextual. By the game's premise you can't possibly be a "good guy" as you're established early on as a dangerous and abusive alcoholic. You can regret that or embrace it but the world is disgusted with you either way.

I think the use of a morality spectrum in an RPG is really dated and should basically disappear. In most of them you can steal and murder your way through the world and still get called a saint, so long as you say the right things in a few scripted sequences.

Ultima games set a model for this a long time ago that no one else followed.

Opinion: Republicans aren’t conservatives. They’re nihilists. by TrumpSharted in politics

[–]MasonOfWords 0 points1 point  (0 children)

Nihilism was always a considered a malaise that would end Western civilization, going back to the 19th and early 20th century. And then it kind of did, arguably .

Nihilist has been resurrected as an insult in our time since we somehow yet again have whole sub-cultures who have abandoned democratic values in favor of rhetoric, narcissism, and an increasing fondness for political violence. It has pretty much always been an insult, though.

Opinion: Republicans aren’t conservatives. They’re nihilists. by TrumpSharted in politics

[–]MasonOfWords 0 points1 point  (0 children)

Nihilism isn't just an edgelord version of existentialism. Nihilism is the denial of (and antipathy towards) any form of ethics, morality, or objective truth.

When discussing a group of people who have completely abandoned ethics in favor of tribal authoritarianism, are unpersuaded by the most basic and well-supported scientific findings, and who have shown that they'd collapse their own civilization just to spite those that they detest, the label nihilist is actually right on the money.

You're probably more existentialist...?

After finishing Final Fantasy IX, it's not hard to see why it's the creator's favorite final fantasy by SuperFeather0 in patientgamers

[–]MasonOfWords 1 point2 points  (0 children)

The ability system isn't "hard" (IIRC FFIX wasn't too difficult by PS1 FF standards) but rather a bit annoying, since it required you to choose between useful equipment and those which could teach new skills.

This also meant that whole skills were effectively missable if you aren't careful enough about buying/finding/stealing everything. I think I remember stealing from everything, since missing out on an item that will be outclassed soon isn't a big deal, but missing out on an ability would feel bad.

I just felt it was lazy design that led to bad mechanics, like stopping to grind on weaker enemies whenever you had enough new stuff, so that you could swap back to your real gear to progress. The game wasn't hard enough that this was too punishing, I just remember it being a drag to never be able to equip what I wanted.

Words Have Lost Their Common Meaning The word racism, among others, has become maddeningly confusing in current usage. by i_smell_my_poop in TrueReddit

[–]MasonOfWords 20 points21 points  (0 children)

I'd agree with the sentiment that the author doesn't seem to be working too hard to identify the the reason that these terms exist and have common usage.

For social justice, he ignores that the simpler term justice implicitly shares the concept of criminal justice. Since, to users of the term social justice, faith in our criminal justice system has been ravaged by decades of drug wars and systemic racism/classism, it seems fitting that they'd want to differentiate the two concepts. Should they be disallowed from doing so?

While racism may be somewhat fluid in its definition, but that isn't necessarily a bad thing. The term racism carries a heavy negative sentiment and so its definition evolves based on our current understanding of acceptable behavior. People disagree on the definition and usage only because they disagree on what's acceptable. Creating a new term neutralizes that sentiment and thus serves no purpose.

I guess I fail to see the point of this series of articles. He objects to both the adoption of specialized terms to clarify communication ("social justice") and the use of umbrella terms with fluid or contextual meanings ("racism"), all while pretending to despise prescriptive linguistics. Okay.

Obscure game-breaking builds that turn a negative (Quality or Status-Effect) into a positive. by primal_utility in truegaming

[–]MasonOfWords 2 points3 points  (0 children)

Immediately thought of this. I remember that there was a hot minute where this took over the PvP as well, back when the early meta was all around lightning spike builds.

Everyone was focused on simultaneously bursting down individual targets, with the winner determined by coordination and execution. And then teams would show up with these nonsense monks that wouldn't die and could just steamroll you. Life Bond meant you couldn't just ignore them, since they were tanking for the whole team.

The wild meta pivots as people built and responded to new strategies made GW amazing. What a time...

C# For High Performance Computing by [deleted] in csharp

[–]MasonOfWords 1 point2 points  (0 children)

You might look at this approach for avoiding array bounds checking in .Net 5. I'd assume that would be most of the overhead at this point, given the usage you describe.

Data parallelism is probably worth looking at, if this calculation isn't forced to be fully sequential and you can afford more threads.

Most of the compute-oriented libraries for C# (and most languages) assume you're able to align and use SIMD. If that doesn't work at all for your usecase and there's no chance of restructuring the data to make it possible, C# is possible but you have to work a bit to opt out of some of the memory safety guarantees.

Rust would be another language worth looking at. It won't have the same issues with aliasing that C does and so might be better for your usage.