ternary operator rules though
196
Community Rules
You must post before you leave
Be nice. Assume others have good intent (within reason).
Block or ignore posts, comments, and users that irritate you in some way rather than engaging. Report if they are actually breaking community rules.
Use content warnings and/or mark as NSFW when appropriate. Most posts with content warnings likely need to be marked NSFW.
Most 196 posts are memes, shitposts, cute images, or even just recent things that happened, etc. There is no real theme, but try to avoid posts that are very inflammatory, offensive, very low quality, or very "off topic".
Bigotry is not allowed, this includes (but is not limited to): Homophobia, Transphobia, Racism, Sexism, Abelism, Classism, or discrimination based on things like Ethnicity, Nationality, Language, or Religion.
Avoid shilling for corporations, posting advertisements, or promoting exploitation of workers.
Proselytization, support, or defense of authoritarianism is not welcome. This includes but is not limited to: imperialism, nationalism, genocide denial, ethnic or racial supremacy, fascism, Nazism, Marxism-Leninism, Maoism, etc.
Avoid AI generated content.
Avoid misinformation.
Avoid incomprehensible posts.
No threats or personal attacks.
No spam.
Moderator Guidelines
Moderator Guidelines
- Don’t be mean to users. Be gentle or neutral.
- Most moderator actions which have a modlog message should include your username.
- When in doubt about whether or not a user is problematic, send them a DM.
- Don’t waste time debating/arguing with problematic users.
- Assume the best, but don’t tolerate sealioning/just asking questions/concern trolling.
- Ask another mod to take over cases you struggle with, if you get tired, or when things get personal.
- Ask the other mods for advice when things get complicated.
- Share everything you do in the mod matrix, both so several mods aren't unknowingly handling the same issues, but also so you can receive feedback on what you intend to do.
- Don't rush mod actions. If a case doesn't need to be handled right away, consider taking a short break before getting to it. This is to say, cool down and make room for feedback.
- Don’t perform too much moderation in the comments, except if you want a verdict to be public or to ask people to dial a convo down/stop. Single comment warnings are okay.
- Send users concise DMs about verdicts about them, such as bans etc, except in cases where it is clear we don’t want them at all, such as obvious transphobes. No need to notify someone they haven’t been banned of course.
- Explain to a user why their behavior is problematic and how it is distressing others rather than engage with whatever they are saying. Ask them to avoid this in the future and send them packing if they do not comply.
- First warn users, then temp ban them, then finally perma ban them when they break the rules or act inappropriately. Skip steps if necessary.
- Use neutral statements like “this statement can be considered transphobic” rather than “you are being transphobic”.
- No large decisions or actions without community input (polls or meta posts f.ex.).
- Large internal decisions (such as ousting a mod) might require a vote, needing more than 50% of the votes to pass. Also consider asking the community for feedback.
- Remember you are a voluntary moderator. You don’t get paid. Take a break when you need one. Perhaps ask another moderator to step in if necessary.
Meanwhile Rust, where every control flow has a return value
it's great, instead of ?: bullshit we just use if/else like it always should have been:
let x = if y > 3 { 7 } else { 4 };
Yep
Ternary operators are the one thing I really miss from Go.
You can have my ternary operator when you pry it from my cold, dead hands.
I kind of love the idea of the ternary operator. C is all about being a procedural language, except this is of course a lie, because it does have mathematical expressions.
But then they realized that it's not just mathematical expressions where being purely procedural is kind of shit, so they wanted to introduce if-else expressions.
But oh no, we can't have it look like the if-else control flow element. This is where ~~madness~~ functional programming lies. Let's make it look like a mathematical expression instead, by choosing the ugliest syntax known to man.
But what really makes it a meme is that other languages decided they needed to look like C, so they copied this terrible design and even though JavaScript has almost nothing to do with C anymore, webdevs in particular get to suffer from the unreadable syntax all the more.
its not my fault return apple == red ? true : false
is so cute. :3
That
return a === b ? true : false
Is bothering me way too much. Just
return a === b
return true === (a === b) ? true : false
Now that I think of it, the return of false should be a casted integer. Just to add horror.
TypeScript library devs are shivering in cold sweat right now
# I mean, Crystal does have a ternary operator, too...
bar = case something
in "aaa" then true
in "bbb" then false
end
foo = if bar
69
else
42
end
;; Or CASE or IF or COND or whatever
(let* ((bar (ecase (something)
(:aaa t)
(:bbb nil)))
(foo (if bar 69 42)))
)
I've been called slurs before for using immediately invoked anonymous function expressions with switch cases in JS
const [val1, val2] = (() => {
switch(whatever) {
case "foo": return [1, 2];
case "bar": return [3, 4];
default: return [0, 0];
}
}))();
const [val1, val2] = ({
"foo": [1, 2],
"bar": [3, 4],
})[whatever] || [0, 0];
Yeah, the problem isn't "conditional expressions", it's "terse syntax", and operator rules that you need to just memorize because they're special and different. Also being limited such that you need to nest the extremely deeply if you, for whatever, you need to have a complex inline condition.
I like the case expression , although I mostly know it from erlang.