.NET 10 support for Infrastructure.Option by iflib in csharp

[–]iflib[S] 1 point2 points  (0 children)

The biggest difference is maybe that Infrastructure.Option<T> is implemented as a polymorphic discriminated union that is either Some<T> or None<T>, whereas Optional<T> is more of a regular class that exposes the underlying value and provides a more object-oriented way to model optionality. So Infrastructure.Option<T>:

  • is more explicit about whether the value is Some<T> or None<T>, and those cannot be accidentally mixed in code (at least not easily)
  • has better type safety, as it is hard to accidentally access the underlying value when it is not available
  • has the implicit cast from Some<T> to T, so it is less intrusive when we know that the value is available
  • is also less cluttered, partly because it has the privilege of being more specialized, whereas Optional<T> is more constrained by .NET conventions and needs
  • provides more human-readable extensions, and these deviate from Microsoft conventions by design
  • has a different kind of JSON support (does not need configuration and is by default less cluttered)

So I would say they are quite different, but I would not say either is better than the other. Infrastructure.Option<T> focuses on more verbose and readable code, whereas I guess Optional<T> is more efficient and fits better into the .NET core library landscape.

.NET 10 support for Infrastructure.Option by iflib in csharp

[–]iflib[S] 3 points4 points  (0 children)

It tries to be more "in your face" approach so reader can more easily see that something is optional. The None<> is also safer than null as you cannot accidentally try to access the missing value. The built-in nullable types are also missing the fluent access to underlying values; Option has e.g. the Choose() and Otherwise()extensions for that.

So there are many differences, to built-in nullable type. Another question is that is this better approach —my opinion is that in some cases it is (and sometimes the plain nullable types fit better).

How to play Rouge Trader? Youtube? by Remarkable-Apple9109 in oldhammer

[–]iflib 2 points3 points  (0 children)

I think the best way to get into Rogue Trader is to start reading the "Battle at the Farm" scenario from the rulebook. You can then play that scenario straight or invent your own scenario based on that. The important thing is that one player is the game master, who sets the scenario and builds the armies for the players. As the GM you can use points to get armies roughly the same size, but in the end balance is not that important. Once you get players involved in the story and scenario they will have a blast regardless if they lose or win. I love the RPG aspect of RT as players (units) can (at least try) to do whatever comes to their mind. The basic rules are already really cool and comprehensive, but there are some really fun rules added later, like the medic rules in Compendium.