this post was submitted on 31 May 2025
591 points (98.7% liked)
Trans Memes
1820 readers
17 users here now
A place to post memes relating to the transgender experience.
Rules
- Follow lemmy.blahaj.zone community guidelines.
- Posts must be trans related.
- No bigotry.
- Do not post or link to pornography.
- If a post is tagged with a specific gender identity, keep the conversation centered on that identity.
- Posts that assume the viewer’s gender and/or contain potentially triggering content must be spoilered and tagged at the beginning of the post title. Example content-warning tags that you can copy include the following:
[CW: Assumes Viewer is Transmasc]
[CW: Assumes Viewer is Transfem]
[CW: Assumes Viewer is Nonbinary]
[CW: Transphobia]
[CW: Violence]
[CW: Weapons/Firearms]
[CW: Disturbing Imagery]
- Mods can be arbitrary.
Recommendations
- Include other tags in posts for example:
[Transfem/Transmasc/Non-binary]
- Include image description when possible.
- Link to source
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
That should be
private string? Gender
. Explicit nullables are your friends.let gender: Option<string>;
I like rust.
Which language(s) have
<type>?
now? Is that a new Java thing? JS/TS thing? I've never seen it.Edit: formatting
Kotlin has it as well
Syntax is a little different though, the above wouldn't complete
C#. Until semi-recently it was only used for value types (as reference types are supposed to be nullable by default) but these days you can enable explicit nullables, which means that you have to explicitly specify nullability even for reference types.
I like explicit nullables. It's not much more work to type those question marks and it adds a safeguard against
null
showing up where it shouldn't.I specifically ~~inspired~~ insisted on it for this picture because the code on the sign uses capitalized names for something that isn't a class, which is a very C# thing to do.
That sounds similar in purpose to Haskell's 'Maybe' or Rust's 'Option' enum, right?
I still think that the null type was a mistake that introduces unnecessary bugs. But I'm glad to see more languages are taking measures against it
Someone can correct me if im wrong but I think nullable in C# still doesnt force you to do a null check before accessing properties or methods, however I believe it does give a type error when using a nullable type where non-nullable is expected, which is good. So it might not be 1-to-1 but it fulfills a similar purpose for sure.
Coming from a rust background I would have sure appreciated my workplace enabling the nullable feature on our main codebase from the start. I've run out of patience for null errors :(
Thanks for the info!
I'm a novice in these matters, but it's definitely a thing in C#.
yeah don't even force people into identifying their gender as empty string since it's a social construct anyway