Over on Blue Sky, @dimillian posted a screenshot of code that stopped me in my tracks. It was just normal Objective-C code that he was considering rewriting in Swift. As he says, "it's not complicated, it's just verbose”.
But Swift still has plenty of ceremony. And it continues to evolve. Generics for example started off much more verbose. Swift 1.0 didn't even have protocol extensions. There's more that could be improved though. It would be lovely to just write `var body: View` and have it do the right thing (i.e. not return an existential). And again, there would be concern that's too "implicit”. That that `some` is load bearing. That the right landing place is you always have to state `any` or `some`.
Every line, almost every other keyword, has examples. Even the dropped trivia, like unnecessary semicolons and parens, has complexity and downsides, that the grammar and parser do an excellent job of hiding from you.
The most celebrated appear on the second line: type inference means you wouldn't need to explicitly type `NSInteger cellIndex =`, just `let cellIndex =`. But still, type inference has its detractors. Much better to be explicit. Much safer. Much more readable.
But the most dominant technique on display is the most controversial one: implicit defaults, that let you drop more syntax.
You see if from the very first character, because Swift's default visibility is internal, so you don't need to mark internal methods with a sigil or keyword.
And in almost every case, there is a very reasonable objection to that implicit rule. In this case, that internal methods might allow unintentional exposing of private invariants to other parts of your code.
Swift has a lot of techniques for reducing ceremony and increasing readability that you can see in action if you think about what the equivalent code would be. That includes things like string interpolation, and a built-in concept of mutability and value types so you don't need NSMutable variants. And of course it does away with pointers in most cases. It has optionals so there's one way to spell “not found”, with sugar for handling them.
Evolution can go the other way too. The `any` keyword for existentials for example (hopefully as a step towards swapping `any` and `some` to give us `var body: View`).
But attempts to add back in ceremony in pursuit of clarity are usually heading in the wrong direction. Take the proposal to require explicit self on member access. The rejection quotes @inthehands: "anything that is widely repeated becomes invisible”
I would go further though. Anything repeated gets in the way, reduces clarity.
Another evolution that I love is the `if let x {` shorthand, instead of the (common) boilerplate `if let x = x {`. It simplifies and clarifies this common idiom.
Once you know about it – each one of these is a thing for a newcomer to learn. But you learn a language once, then use it for years. Over-optimizing for beginners is the wrong trade-off. These simplifications aren't complex to explain and remember. And Swift's clean look attracts users from both high- and low-ceremony languages.
America might sleepwalk into bizarrely voting for something that's bad for everyone next week. There's still time to reach out to someone in your life who might be wavering, and convince them to go vote for Harris instead of staying home, despite misgivings.
The news about how General Milley and Matthis–old white dudes they'll respect–genuinely think he's a fascist and a threat to America maybe hasn't broken through to them. They think another Trump term will be OK like the last one because people will keep him in check, so it'll be fine. It's different now. There'll be no Gary Cohns or John Kellys. Full on fascism is bad for business.
Remind them split ticket voting is a thing. They can vote D for President, and R all the way down after that.
The center-right men worry that Harris will raise their taxes, or heard from racists like Sacks that she's “stupid”. They hate Trump, but they think he'll be better for them financially.
Trump has said he wants to overrule the Fed on interest rates, risking the economy. Trump's tariff idiocy will bring back inflation, and unlike taxes a moderate congress can't stop tariffs. Tax-free social security will balloon the deficit. Deportations of workers harm the economy. These are WSJ-endorsed views.
Forget your MAGA-pilled relatives, they're gone. There’s two completely different kinds of people you probably know one of who are persuadable:
Normie pro-business upper-middle-class men who think Trump will be better for their personal finances, and leftists convinced some light fascism will move America towards socialism.
Both are underestimating just how bad Trump would be for their interests. Call them and talk them off the ledge.
You have to be really full-on can't look the other way racist for the NYT to break glass and call a political rally racist in a headline, instead of giving it the usual thesaurus and euphamism treatment.
Nobody can claim to be on the fence after this. No “I'm a double hater” excuses. You either accept this, or take a stand against it.
Rudy Giuliani to rapturous applause just told the audience:
“The Palestinians are taught to kill us at two years old. […] They may have good people. I’m sorry, I don’t take a risk with people that are taught to kill Americans at two.”
Yes, the current administration has been awful on Gaza. But there's no doubt a Trump presidency would be far far worse. Trump has publicly said many times he thinks Bibi should go further, that he has been held back.
As for the left wing person in your life who is angry that Biden/Harris haven't done more (Roe was overturned on their watch!), the idea that a quick dose of the bad stuff will bring America home to the DSA is so off it's hard to counter. The best approach is probably to try and scare them to their senses.
Luckily the Trump campaign is provide lots of material for this. Right now at a rally for Trump in NY there are some blood and soil speeches bringing the house down.
You have to scroll halfway down the story before it is revealed that one of the main spreaders of misinformation is the Republican presidential candidate.