| ▲ | kccqzy 10 hours ago |
| https://github.com/electron/electron/issues/48311#issuecomme... If this comment is to be believed, it's not Apple's fault. It's the apps mucking around with the internals of AppKit. This example just happens to illustrate two of my least favorite software engineering practices: (1) despite one piece of code making a method private, another piece of code still overrides it/modifies it/calls it, an affront to the idea of encapsulation; (2) a piece of code has different behavior depending on the identity of a function, contrary to the principle of extensionality. |
|
| ▲ | marcosdumay 10 hours ago | parent | next [-] |
| > despite one piece of code making a method private, another piece of code still overrides it/modifies it/calls it, an affront to the idea of encapsulation That's inherent on the way current computers manage the memory. And I don't know if the gains are enough to pay for the loses of guaranteeing encapsulation. One could reach for static analysis, but that would imply some restrictions on the machine's assembly. Those are probably worth it. > a piece of code has different behavior depending on the identity of a function I have written my quota of "find the latest caller on the stack with property X, verify if it has access", on different languages. Some times a function can't in any way be just a function. |
| |
| ▲ | ryandrake 10 hours ago | parent | next [-] | | I don’t understand what goes through the developer’s mind. A method is marked as private. It’s documented as not to be used by developers. Further documentation says that using it may break your application in strange ways now or in the future. Despite all this, the developer concludes: “yea, I think it’s a good idea to use this API!” Then, later when something breaks, it’s Shocked Pikachu all around. | | |
| ▲ | runjake 9 hours ago | parent | next [-] | | > I don’t understand what goes through the developer’s mind. I'm not defending anyone here, but sometimes it's to work around bugs in public APIs that never get fixed. And sometimes it's because some perceived needed functionality isn't exposed in public APIs. They figure "It'd be a lot easier to use this private API. We can just fix it if it breaks.", not really realizing the ramifications, for example a lot of apps use older versions of Electron -- some even EOL. Is the Electron team now going to backport this fix to several versions back? Sounds... involved. | |
| ▲ | thfuran 9 hours ago | parent | prev | next [-] | | The alternative to using private methods or reflectively mucking about with library/platform internals isn't always "do the same thing but with only public API"; it's sometimes "you can't possibly fix the bug or implement the feature that you want to". It sure does increase maintenance burden though. | | |
| ▲ | bigstrat2003 9 hours ago | parent [-] | | > it's sometimes "you can't possibly fix the bug or implement the feature that you want to" Yes. It is, and that is what any responsible person should choose. | | |
| ▲ | thfuran 8 hours ago | parent [-] | | So you'd tell customers "No, I'm not fixing that bug because doing so would offend my aesthetic sensibilities. Yes, I know you have a support contract, but I simply refuse to address your problem even though I could"? Or maybe you'd phrase it a little differently in public. | | |
|
| |
| ▲ | tclancy 9 hours ago | parent | prev | next [-] | | I get it but a lot of the war stories from Raymond Chen's blog https://devblogs.microsoft.com/oldnewthing/ were about helping major corporations unscrew something that had relied on a private Windows API because there hadn't been a good way to do it. I would guess most cases of people choosing to rely on a private method are laziness or lack of knowledge about "the right way" (or call it bad documentation), but not 100%. | | |
| ▲ | igregoryca 5 hours ago | parent [-] | | Discovering and using private APIs is not a walk in the park. I doubt "laziness" is a common motivation for doing so. Lack of knowledge or bad docs, perhaps. But there's often no officially sanctioned way to do something that people want (and perhaps will pay for) - most private API usage I've seen falls into this third bucket. | | |
| ▲ | pdpi 30 minutes ago | parent [-] | | Laziness comes in many forms. Arguably, discovering and using private APIs is a form of intellectual laziness — it requires you to refuse acknowledging that the whole system is telling not to do things that way. |
|
| |
| ▲ | toast0 9 hours ago | parent | prev | next [-] | | Ok, but > // By overriding this built-in method the corners of the vibrant view (if set) will be smooth. If you don't override the built-in method, the corners won't be smooth. Jagged corners cause thousands of eye injuries every day. Using (or overriding) private APIs comes with risks, but sometimes it's the only way to get things done. Of course, it comes with consequences too. Sometimes vendors test their new releases with commonly use applications and reach out when they've changed things and breakage results, but testing releases isn't webscale. | |
| ▲ | grishka 6 hours ago | parent | prev | next [-] | | Sometimes you just can't achieve something with public APIs. Especially on Apple OSes, they love making genuinely useful APIs private for no good reason while heavily using them in their own apps. Of course, if you use a private API, you're on your own if your app breaks because of it. I myself have done my fair share of using private APIs on Android. Ideally, you should test your app on beta versions of every upcoming major OS release to make sure it doesn't break. Even more ideally, there's a public equivalent starting with some OS version and you only use the private one until that version, then nothing will ever break. | |
| ▲ | jcelerier 3 hours ago | parent | prev | next [-] | | If breaking encapsulation delivers value under the form of features-making-users-happy for a couple years and the fix when it breaks is a matter of a couple weeks (and, like here, a line of code) then it's definitely the right tradeoff | |
| ▲ | porridgeraisin 9 hours ago | parent | prev | next [-] | | > I don't understand Well. This is hardly the funniest example then. Check this one out: https://github.com/reactjs/react.dev/issues/3896 | | | |
| ▲ | stalfosknight 10 hours ago | parent | prev | next [-] | | And there are people who's default setting is to hate/blame Apple because it's fashionable to do so and they are defending not just the use of but also overriding an API explicitly marked as private. I don't get it. | | |
| ▲ | Wowfunhappy 9 hours ago | parent [-] | | Apple does also break public APIs, so it goes both ways. I will blame Apple when they are blameworthy and not when they are not. |
| |
| ▲ | whywhywhywhy 8 hours ago | parent | prev | next [-] | | Apple has to take some of the blame from this, MacOS without Electron apps is a much less useful proposition. If they knew they were going to change this API in this release it would have made sense to reach out and offer a public way to Electron. End of the day the needs of users running Electron apps outweighs whatever opinions the internal Apple team has about their APIs | | |
| ▲ | urbandw311er 7 hours ago | parent [-] | | Absolutely not. Apple has zero responsibility to anybody for changing a private API. That’s the whole point of it being marked private. |
| |
| ▲ | mvdtnz 6 hours ago | parent | prev | next [-] | | > Then, later when something breaks, it’s Shocked Pikachu all around This isn't really true. When something breaks it's generally "darn, we knew it would happen eventually". | |
| ▲ | cyberax 10 hours ago | parent | prev [-] | | Yeah, but you HATE how the system behaves because some great spark at Apple thought that corners must always be _this_ rounded. |
| |
| ▲ | btown 10 hours ago | parent | prev | next [-] | | There's also the good old use case of "am I dealing with a subclass that overrode the superclass's implementation of the method." How do you distinguish between a superclass that always returns null/noop, vs. a subclass that happened to return null in this specific case? Sometimes this is useful/vital for setting expectations to the user what functionality the instance is likely to have. Now, you could refactor everything to have the superclass's implementation either throw a NotImplementedError, or return a sentinel value... but changing every call site might be a gargantuan task. Similarly, adding static metadata to every subclass might not be feasible. But checking whether the function's (pre-bound) identity is different is a very easy hack! Ironically, this might indeed be exactly what Apple is doing here, and they're doing it in a tight loop. | | | |
| ▲ | kccqzy 9 hours ago | parent | prev | next [-] | | I have written my share of "inspect caller and do things" too. I still don't like that. | | |
| ▲ | marcosdumay 8 hours ago | parent [-] | | Personally, at this point I blame that universal assumption that every piece of code inside a program has the same reliability, trustworthiness and disclosure properties. At some point we'll have to burn down every bit of software infrastructure and build it new with some care about security. |
| |
| ▲ | 1718627440 7 hours ago | parent | prev [-] | | > That's inherent on the way current computers manage the memory. You can trivially do that today by telling the linker to discard this symbol. Sure it's still not hardware isolation, but now the caller needs to disassemble the binary and hardcode locations. When its inlined before, then you aren't even able to do this. |
|
|
| ▲ | cosmic_cheese 10 hours ago | parent | prev | next [-] |
| A good argument for allowing and working with minor platform differences instead of trying to micromanage every little aspect to force inter-platform consistency and/or perfect compliance with the mockup. |
|
| ▲ | SkiFire13 10 hours ago | parent | prev | next [-] |
| > (2) a piece of code has different behavior depending on the identity of a function, contrary to the principle of extensionality. Note that most definitions of extensionality don't consider the number of steps to achieve the result as an observable property, although in practice it is. |
|
| ▲ | 1718627440 7 hours ago | parent | prev | next [-] |
| > (1) despite one piece of code making a method private, another piece of code still overrides it/modifies it/calls it, an affront to the idea of encapsulation; That's why its a good idea to strip a symbol or provide a linker script. This way you can also properly version the code. |
|
| ▲ | snarfy 10 hours ago | parent | prev | next [-] |
| It's all pretty terrible. For problem (1) why does the language allow it? And why are they doing it this way? Did Apple not provide an official way? |
| |
| ▲ | cosmic_cheese 10 hours ago | parent [-] | | With Objective-C's nature as a dynamic language, there's no way to make APIs fully private and unusable to third parties. Despite heavily embracing Swift in recent years, much of AppKit and UIKit are still written in Objective-C. |
|
|
| ▲ | x0x0 10 hours ago | parent | prev | next [-] |
| Nah, it's Apple's fault. Not regression testing against major apps is pure incompetence. Also, this in the comment: > [a user] Please try any way of getting in touch with Apple engineers you can. As a project, we don't have a better connection to Apple than you do. > > One approach might be the engineer who replied to the Bluesky post that someone linked to above about the input issue. Pure incompetence. Major projects have no way to do anything but ping randoms on socials. |
| |
| ▲ | bombcar 8 hours ago | parent [-] | | This is downvoted, but it's true. It doesn't matter who's fault it is in some Aristotelean sense, what matters is the user upgraded to YOUR new OS, and now shit don't work. Raymond Chen and Microsoft got this, years ago. Joel talked about it. You make shit work, even if it's the software being a fuck. | | |
| ▲ | sgerenser 4 hours ago | parent | next [-] | | Or, as some OS maintainer once said:
WE DO NOT BREAK USERSPACE! Seriously. How hard is this rule to understand? We particularly don't break user space with TOTAL CRAP. | | |
| ▲ | aw1621107 an hour ago | parent [-] | | This situation seems to be more analogous to an out-of-tree driver which reaches into kernel internals, which Linux does break all the time. |
| |
| ▲ | kridsdale3 7 hours ago | parent | prev [-] | | No time to do that when you need to re-do the entire UI of 100 apps for no good reason other than to make an iMac indistinguishable from an iPad. |
|
|
|
| ▲ | cyberax 10 hours ago | parent | prev | next [-] |
| Abuse of private APIs means that your public API is incomplete. And that people dislike how your system behaves so much, that they're willing to muck with its internals. |
| |
| ▲ | bigstrat2003 9 hours ago | parent | next [-] | | No, it means that people think they know better than to listen to the warning. | |
| ▲ | stalfosknight 10 hours ago | parent | prev [-] | | No, it means some people are doing it wrong either because: 1. They don't know how to do it the right way or 2. They can't be bothered to do it the right way #1 I can understand. We all make mistakes as we learn and grow as developers. #2 is just arrogance / laziness on the part of the developer. Compounding it by blaming the platform owner that clearly and explicitly told you not to go that route is gross. | | |
| ▲ | cyberax 10 hours ago | parent [-] | | [flagged] | | |
| ▲ | epistasis 9 hours ago | parent | next [-] | | From the bug report: > It turns out Electron was overriding a private AppKit API (_cornerMask) to apply custom corner masks to vibrant views. > ... > By removing the custom _cornerMask override and associated logic, we allow AppKit to handle shadows with its default pipeline. This resolves the GPU spike while retaining shadows as expected. I'd say that most often usage of private APIs is because: 4. it probably shouldn't be done at all | |
| ▲ | stalfosknight 9 hours ago | parent | prev [-] | | I'll grant that their documentation isn't the best I've ever seen, but it is still on you if you reach for private APIs. Again, that is consciously choosing a shortcut you've been explicitly told not to use. |
|
|
|
|
| ▲ | wk_end 10 hours ago | parent | prev [-] |
| "Not Apple's fault" is up for debate; even if Electron shouldn't be doing this, Apple arguably shouldn't be pushing out updates that cause issues with wide-swaths of software that users use regardless. |
| |
| ▲ | Aurornis 10 hours ago | parent | next [-] | | We've had developer betas of macOS Tahoe since June. Standard practice for any mobile or desktop software is to start testing on the betas as soon as they're available. Unless this was a last-minute change before the final release, it's on the software developers to use the betas to prepare their software for upcoming releases. | | |
| ▲ | Tteriffic 8 hours ago | parent [-] | | Exactly. Who you blame depends on if it was introduced in beta 1 or RC. |
| |
| ▲ | cosmic_cheese 10 hours ago | parent | prev | next [-] | | Apple’s attitude here is that it’s an inherent risk of using private APIs, because it’s not something they want devs doing. They don’t facilitate it like MS tends to. Don’t touch the stove if you don’t want to get burnt. | | |
| ▲ | wk_end 10 hours ago | parent [-] | | The person who's getting burnt is Random Officer Worker Joe, who just wants to run Slack and Spotify and who doesn't know a thing about Electron or private APIs, but knows that ever since upgrading their version of macOS things are running terribly. Apple's position is technically noble, but that doesn't help their users. | | |
| ▲ | cosmic_cheese 10 hours ago | parent | next [-] | | The Electron maintainers should've considered that possibility before reaching for a private API. It's on the Electron's team's shoulders and nobody else's. If I were building a FOSS platform, I wouldn't give a second thought to third parties making use of my platform's private APIs. They're private for a reason, whether that be because they're not yet fully baked or because using them can have unintended consequences, they're not intended for public consumption. I especially wouldn't want somebody else's platform to depend on my private APIs, because I am then effectively locked into keeping that API frozen in time by the numerous others building on this other person's platform. It's generally poor practice to build upon such brittle things as under-the-hood tinkering anyway. | |
| ▲ | Aaargh20318 9 hours ago | parent | prev | next [-] | | > Apple's position is technically noble, but that doesn't help their users. The alternative doesn’t help either. That’s the approach Microsoft has taken and look what a mess Windows is because of it. | | |
| ▲ | viraptor 9 hours ago | parent [-] | | > what a mess Windows is because of it. Can you point at any part of windows being a mess specifically because of backwards compatibility? | | |
| ▲ | jitl 4 hours ago | parent [-] | | Control panel / settings | | |
| ▲ | viraptor 18 minutes ago | parent [-] | | That one's incomplete migration rather than backwards compatibility. As in, they failed to move everything rather than moving everything but preserving the old way for compatibility with something. |
|
|
| |
| ▲ | dpoloncsak 9 hours ago | parent | prev | next [-] | | Sounds like Joe will direct his anger towards Slack and Spotify, and as a paying customer he has every right to be upset when his software doesn't work. | | |
| ▲ | wk_end 9 hours ago | parent [-] | | I doubt he will - they didn’t change, his OS did, they worked before, post hoc ergo propter hoc. Anyway, they’re from different companies, how could they both be at fault? If he even identifies them as related - he probably had them both running at startup and never quits them. | | |
| ▲ | nozzlegear 3 hours ago | parent [-] | | How much cognition are we assigning to Joe in this hypothetical scenario? You make him out to be barely more capable than a lab chimpanzee dully poking at a screen to get some fruit. Give Joe a little credit, people aren't as dumb as you think. |
|
| |
| ▲ | 9 hours ago | parent | prev [-] | | [deleted] |
|
| |
| ▲ | pavlov 10 hours ago | parent | prev | next [-] | | That’s the principle that prevented Windows from making any meaningful progress for the past three decades. | | |
| ▲ | wk_end 10 hours ago | parent [-] | | What? Windows made tons of progress while maintaining this principle and became the most popular operating system in the world. Are you trying to tell me that you believe the evolution of Windows from 1.0 all the way to 7 - the entire time trying to operate according to this principle - doesn't constitute meaningful progress? The recent stagnation of the OS has nothing to do with attempting to maintain backwards compatibility. | | |
| ▲ | acdha 10 hours ago | parent | next [-] | | It’s true that they’ve made some progress but my work laptop running Windows 11 still has UI elements from Windows 95/NT 4. The file system hasn’t improved since then and the keyboard responsiveness is actually worse. BeOS on 90s hardware absolutely torches Windows 11 on things like UI responsiveness, ability to multitask without degrading UI performance, and the file system (not networking, of course, it wasn’t perfect). I think it’s fair to question whether the decisions around backwards compatibility have been worth the cost but I’d imagine they’re already doing that. Enterprise IT departments love Windows but nobody else does, and the generation of people who grew up using iOS/Android and macOS/ChromeOS for school aren’t going to jump at the chance to bring that enterprise IT experience into their personal lives. | | |
| ▲ | wk_end 10 hours ago | parent | next [-] | | > The file system hasn’t improved since then The file system is a great example of how Windows has evolved, actually. Windows 95 was (initially) still using FAT16! NT4 was using NTFS 1.2, we're now on NTFS 3.1. To the file system itself MS added (per Wikipedia): disk quotas, file-level encryption, sparse files, "reparse points" (dunno), journaling, "distributed link tracking" (also dunno), "the $Extend folder and its files" (ditto), and better MFT recovery. Also, apparently not part of the file system itself: symbolic links, transactions, partition shrinking, and self-healing. And that's just what I gleaned from the History section on Wikipedia's NTFS article; I'm sure there's more. Apple specifically was much slower catching its file system up with Microsoft, despite their disinterest in backwards compatibility. And if Apple jumped ahead a little with APFS, well, NTFS holds its own just fine against APFS for 99% of users. And for when it doesn't, there's also ReFS, an entirely new next gen file system used on Windows Server, and is now slowly making its way onto the desktop. | | |
| ▲ | acdha 9 hours ago | parent [-] | | Okay, I’ll grant that links and mountpoints were good but NTFS is still missing integrity checks, fast queries, etc. For most users nothing had changed since the Clinton administration. |
| |
| ▲ | cyberax 10 hours ago | parent | prev [-] | | You can actually tell the old controls from the Win NT by how fast and responsive they are. They also properly follow the best practices by showing keyboard accelerators when you press "alt". It's the new stuff that is slow and unusable. | | |
| ▲ | 1718627440 7 hours ago | parent [-] | | And they also explain themself to the user. The new UI often doesn't tell you at all, what exactly you are modifying here, while the old often has paragraphs of explanation. |
|
| |
| ▲ | sgjohnson 10 hours ago | parent | prev [-] | | You can still find applications written for Windows 3.1 in the latest builds of Windows 11. Something regarding database drivers if I recall correctly. Now imagine if you could get rid of all that legacy crap to make it work in the first place. Microsoft CAN’T do that, because the entire premise of Windows is backwards compatability. Apple? They don’t care. Killing 32bit apps? Just make an announcement saying that in 2 major macOS releases, macOS won’t be able to run 32 bit apps. It cuts down bloat, and it cuts down on the potential attack surfaces for malicious actors. Obviously just about everyone would agree that Windows 1 -> 7 was progress. I don’t think you’ll find too many people who’ll say the same about Windows 7 -> 11. | | |
| ▲ | wk_end 10 hours ago | parent | next [-] | | > Now imagine if you could get rid of all that legacy crap to make it work in the first place. What would be the consequence of this? What harm does this do? Would it be worth Spotify and Slack breaking when I upgrade my OS? | | |
| ▲ | jojobas 9 hours ago | parent [-] | | > Now imagine if you could get rid of all that legacy crap to make it work in the first place. Yeah, and someone will wake from the dead and rewrite all the programs that run the world, written 20-40 years ago, that are to a large degree perfectly working under these compatibility layers. You should be eternally grateful to MS for dedicating tons of money and some of its best people to maintaining backwards compatibility. Apple can only afford it because pretty much nothing critical ever ran on macos. |
| |
| ▲ | badsectoracula 9 hours ago | parent | prev | next [-] | | > Now imagine if you could get rid of all that legacy crap to make it work in the first place. That's easy to imagine: people would have zero reason to use Windows. | |
| ▲ | FireBeyond 2 hours ago | parent | prev [-] | | I mean macOS Settings were decidedly schizophrenic until quite recently. Audio MIDI Setup last got a version update in 2017. AirPort Utility? Apple disbanded that team in 2016. There hadn't been a new AirPort since 2013. |
|
|
| |
| ▲ | tom1337 10 hours ago | parent | prev [-] | | So you're blaming because they've changed a private API which electron not only used, but also seemed to have patched? | | |
| ▲ | asqueella 10 hours ago | parent [-] | | No, for "pushing out updates that cause issues [with very common software]". | | |
| ▲ | smashedtoatoms 7 hours ago | parent [-] | | As a dev, if you use a private method, you've just taken ownership of the problem. I suggested to you in our contract not to do it, and that it would likely not be supported, and you did it anyway. Fix your shit, common software or not. |
|
|
|