Be advised: this thread is not for serious in-depth discussion of weighty topics (we have a link for that), this thread is not for anything Culture War related. This thread is for Fun. You got jokes? Share 'em. You got silly questions? Ask 'em.
- 127
- 2
What is this place?
This website is a place for people who want to move past shady thinking and test their ideas in a
court of people who don't all share the same biases. Our goal is to
optimize for light, not heat; this is a group effort, and all commentators are asked to do their part.
The weekly Culture War threads host the most
controversial topics and are the most visible aspect of The Motte. However, many other topics are
appropriate here. We encourage people to post anything related to science, politics, or philosophy;
if in doubt, post!
Check out The Vault for an archive of old quality posts.
You are encouraged to crosspost these elsewhere.
Why are you called The Motte?
A motte is a stone keep on a raised earthwork common in early medieval fortifications. More pertinently,
it's an element in a rhetorical move called a "Motte-and-Bailey",
originally identified by
philosopher Nicholas Shackel. It describes the tendency in discourse for people to move from a controversial
but high value claim to a defensible but less exciting one upon any resistance to the former. He likens
this to the medieval fortification, where a desirable land (the bailey) is abandoned when in danger for
the more easily defended motte. In Shackel's words, "The Motte represents the defensible but undesired
propositions to which one retreats when hard pressed."
On The Motte, always attempt to remain inside your defensible territory, even if you are not being pressed.
New post guidelines
If you're posting something that isn't related to the culture war, we encourage you to post a thread for it.
A submission statement is highly appreciated, but isn't necessary for text posts or links to largely-text posts
such as blogs or news articles; if we're unsure of the value of your post, we might remove it until you add a
submission statement. A submission statement is required for non-text sources (videos, podcasts, images).
Culture war posts go in the culture war thread; all links must either include a submission statement or
significant commentary. Bare links without those will be removed.
If in doubt, please post it!
Rules
- Courtesy
- Content
- Engagement
- When disagreeing with someone, state your objections explicitly.
- Proactively provide evidence in proportion to how partisan and inflammatory your claim might be.
- Accept temporary bans as a time-out, and don't attempt to rejoin the conversation until it's lifted.
- Don't attempt to build consensus or enforce ideological conformity.
- Write like everyone is reading and you want them to be included in the discussion.
- The Wildcard Rule
- The Metarule
Jump in the discussion.
No email address required.
Notes -
You know, this reminds me of another thing I immediately hated about Rust. They took unions and renamed them enums.
Now in fairness, I've worked in probably over a dozen codebases across 20 years and never once organically encountered anyone using a union. I've never encountered an API that uses unions as their preferred input or output types. It's a language feature I'm aware of, but in my professional and hobbyist work in C, C++, C#, Java, Python (ugh), Javescript (hurk) or anything I've forgotten, I've never seen them actually used. So if Rust wants to pull a fast one on people who slept through that day of class and never learned about a union, and pretend it's a fancy new enum they came up with. whatever. I even think it's kind of clever how they use them and really made them a core part of the language.
But it's also just so fucking presumptuous, to take two pretty well established language features, and mix them up. I tried to google a little, like, have other more modern languages been doing this for a while? All those dorky functional languages nobody does any actual professional work in? I didn't turn up shit. Seems Rust might be the first language to take unions and pretend they are enums. I mean, whatever, it's not hard, it doesn't stop me. I just hate it.
I use (and organically run across) unions fairly frequently. That being said, embedded codebases are rather niche.
In embedded you're not typically concerned too much about portability between completely different architectures or compilers anyway, meaning you can (relatively) safely rely on things like "the compiler will be sane and predictable about its rules for padding bytes".
Main usecases are:
More options
Context Copy link
Rust does have normal C++-style unions, though they're a late and fairly controversial addition for the reasons you mention. I'll admit that I've used them occasionally in internal code (especially networking or protocol development, where hardware developers love throwing in 'this next four bytes could be an int or a float' in rev 1.0.1a after you've built your entire reader around structs), but I'd probably ask anyone who used them as an input in an API what they were smoking.
In higher-abstraction languages than C++, that sorta behavior either isn't available and/or forgo the performance and memory-specific benefits for dumb-programmer-safety. TypeScript unions or Java sealed interfaces are doing the same thing at the level of a definition -- it's a field you can put any of a limited number of options in! -- and you'd absolutely never use them for overlapping purposes. On the other hand, C#'s even more limited than Java on that use case, and I come across places it'd make sense to use pretty regularly, so maybe I'm just bitching.
That may be why a lot of their more type-theory focused stuff fell under a different name than the TypeScript-style union types.
I think the Rust enum overload is downstream of a lot of the behaviors you'll see in Java or Kotlin; I've encouraged FIRST students to use similar designs to hold different configuration values for easy toggling of modes or states. Not sure who first made enums that broke from the C(++) limit of one-value-per, but given the amount of C++ code I've seen where enums were used to map various flags intended for bitwise addition, probably a pretty early one.
On behalf of hardware developers everywhere, I apologize. We didn't want to do that either, but when the potential new customer opines "what a nice piece of hardware you've got, if only it could take a float" and glances meaningfully at their suitcase full of cash... well, we shake our heads and roll up our sleeves.
More options
Context Copy link
More options
Context Copy link
Mixing up enums and unions? Not that I know of. Repurposing perfectly well-defined words in misleadingly confusing ways? Since before I was born, including with the most basic building blocks of code, by calling subroutines "functions". Maybe they'd never thought hard enough about side effects or imagined things like memoization, but at the very least they should have gotten the "a function is a rule that assigns to each input exactly one output" lecture by grade 8.
More options
Context Copy link
I'm annoyed at Rust for the same reason in the opposite direction. They added sum types, knew they added sum types, but called them "enums" - why?
Probably for the same reason Java did.
More options
Context Copy link
More options
Context Copy link
More options
Context Copy link