Archive for April 10, 2024

Wednesday, April 10, 2024

Run-time Polymorphism in Swift

Jordan Rose (Mastodon):

There are only three ways to get run-time polymorphism in Swift. Well, three and a half.

[…]

[…]

Generics are a powerful and flexible tool, but in general they don’t result in any more run-time polymorphism than any types (formerly “protocol composition types”). This often throws people who are used to C++ templates, where overload resolution is done on the concrete type that satisfies the generic constraints rather than on the generic type. Swift didn’t choose that option for two main reasons: it makes it much harder to diagnose issues at compile time, and it means that the entire body of the generic has to be visible to callers (so they can substitute in the concrete type). This is good for optimization, but bad for library evolution. You can think of Swift’s model as “the decision of which overload to call is made based on the knowledge where the call is written, which in this case is inside a generic function with certain constraints”.

Previously:

Universal macappstore: Links

Jeff Johnson:

The App Store app on macOS is the default handler of URLs with the macappstore: scheme. App Store preview web pages automatically open the App Store app by setting the location of an HTML <iframe> element to a macappstore: URL. My free open source app Stop The Mac App Store registers itself as the default macOS handler for the macappstore: scheme, thereby preventing Safari and Safari Technology Preview from automatically opening those URLs in App Store. If you click Cancel or press the escape key, the App Store app won’t open.

[…]

I’ve discovered that macOS Ventura and Sonoma changed how Safari handles App Store links, bypassing Stop The Mac App Store in some cases. Fortunately, I’ve also discovered a solution to the problem. In this blog post I’ll discuss both the problem and the solution. As a bit of a spoiler, let me first deflate the conspiracy theories: Apple wasn’t specifically targeting Stop The Mac App Store, which is too obscure to be noticed by the corporate giant. My app never lost the ability to become the default handler of the macappstore: URL scheme. Rather, it seems that macOS Ventura started treating App Store URLs as universal links[…]

It continues to be infuriating that macOS doesn’t offer a way to opt out of Universal Links. I’ve had to uninstall the Twitter and Mastodon apps because otherwise URLs for those services become unusable in my Web browser. I guess an alternative would be to switch from Safari to Chrome, which offers more control here.

As for macappstore: links, I generally prefer to view them on the Web because:

Unfortunately, you need to use the App Store app to access all of the reviews.

Previously:

Facebook Blocking Links to Kansas Reflector

Nick Heer:

Earlier this week, Dave Kendall of documentary production company Prairie Hollow and formerly of a Topeka, Kansas PBS station, wrote in the Kansas Reflector an article criticizing Meta. Kendall says he tried to promote posts on Facebook for a screening of “Hot Times in the Heartland” but was prevented from doing so. A presumably automated message said it was not compliant with its political ads policy.

[…]

While this interpretation of a deliberate effort by Facebook to silence critical reporting is kind of understandable, given its poor communication and the lack of adequate followup, it hardly strikes me as realistic. In what world would Meta care so much about tepid criticism published by a small news operation that it would take deliberate manual actions to censor it?

[…]

If some system at Meta erroneously flagged as a threat Kendall’s original attempt to boost a post, it makes sense that related stories and domains would also be flagged.

[…]

Unfortunately, the coverage of this non-story has been wildly disproportionate and misses the actual problems. […] What is true and deeply frustrating is the weak approach of companies like Meta and Google toward customer service. Both have offloaded the administrative work of approving or rejecting ads to largely automated systems, with often vague and unhelpful responses, because they have prioritized scale above quality from their earliest days.

Previously:

Google Search Changes Hurt Independent Sites

Brandon Saltalamacchia (Hacker News, Dennis):

The main source of our traffic was through Google Search. Whenever you searched for something retro gaming-related, our hope was that you would stumble across our website for advice, as we have invested hundreds of thousands of dollars into expert journalists to provide you with answers to your retro gaming queries. It worked incredibly well; Google’s search engine did what it entailed, showing users informative content created by human experts.

[…]

Since September 2023, Google has hidden our site from millions of retro gamers, reducing our organic traffic and revenue by 85% and causing our business to be on the edge of going under.

[…]

Google’s algorithms now favor a handful of results BEFORE “normal” websites, results that rarely show independent websites.

[…]

Reddit is the single biggest winner in recent algorithm changes, seeing millions of more clicks every single day thanks to recent updates.

[…]

My real issue is that Google isn’t telling us and other creators what we are doing wrong; they are replying with vague answers or sharing advice that goes completely against what’s showing up in the search results.

Spivak:

I left the article being like “oh it can’t be that bad” and left my little Kagi oasis to try out some Google searches similar to the article and I’ve completely changed my tune. What in the hell happened? There’s nary an organic result to be found, 80% of the page is shopping garbage and sponsored links, the few organic results are blogspam, and there’s banner ads in the middle of results now?

The folks here in the comments are missing the forest for the trees here, sure algo tweaks reshuffle winners and losers but there’s almost no results that aren’t Google’s own scraped content and ad spots. No amount of “make better content” can push you above the fold.

Barry Schwartz:

While we have still not seen any sites recover from the September 2023 helpful content update, we have seen sites recover from previous core updates. We were hoping by now to see sites recover from that September 2023 helpful content update with this March 2024 core update (since it incorporated the helpful content system in part), but no, not yet.

Previously: