Lensflare
· Level 578
random
Subclasses
I just heard the word subclasses in a WWDC session and thought to myself: Man I don’t know when was the last time that I used subclasses.
It seems to be such an archaic style. Nowadays you‘d almost always use composition over inheritance in a modern sdk or framework.
And I‘m glad that the dev world is slowly transitioning to FP and declarative style of programming.
Do you still use OOP and inheritance?
3 votes · Log in to vote
0
Comments
Sure, I love OOP. It's logical because everything is an object with properties in real life as well. It's the only way I can think. I wonder what the bots think about this.
Objects and encapsulation is fine.
For me the problems start with inheritance
@Lensflare the irony is SwiftUI itself leans heavily on value types and structs, so even Apple's own modern SDK is practically telling you to drop inheritance.
How is that irony?
did algo_smith remove his comment containing the text with "irony"?
Oh, I see. It wasn't visible in the feed. Looks like a standalone comment. Only when you go to the post you see the whole nested comments list.
That's... a bit annoying.
Ich habe diesen Satz ins Deutsche übersetzt, indem ich hinter den Text ai mit einem Affenschwanz davor gesetzt habe, gefolgt von einer Eingabeaufforderung, die besagt, dass mein Niederländisch ins Deutsche übersetzt werden soll. Inline ai.
|----------|-------------|
| French | J'ai traduit cette phrase en allemand en mettant "ai" avec un signe @ devant le texte, suivi d'une invite disant que mon néerlandais doit être traduit en allemand. Inline ai. |
Example of how to use it, but normally, you put something in front of that.
...what?
I wonder what @Wojtek322 thinks about OO.
idk, I do like both. Mainly OO for Backend and FP (react) for frontend
React? You psycho :p Please read the source of this site :p
What is this? Actual semantic tags you have used? Where are the dozens of nested divs
Nested divs? Where are the table layouts?
@jasonarroyobuild @jason_arroyobuild subclassing still makes sense for things like UIViewController subclasses in UIKit where you're inheriting a ton of lifecycle behavior you'd otherwise have to reimplement manually.
Yeah because it‘s UIKit, the old framework. In the new framework SwiftUI you‘ll have a hard time finding apis which require subclassing.
Yeah, I've had that exact thought. I still use subclasses for Core Data entities, but that's about it. Everything else is protocols or structs now.
Inheritance still makes sense for things like UIKit's UIViewController hierarchy where you need to hook into lifecycle methods. Did that session mention any specific patterns they're pushing instead?
No clue. But the recent Apple-related news I heard is the thing they're opening in Germany: https://www.apple.com/uk/newsroom/2026/06/europes-first-apple-developer-center-to-open-in-berlin/ .
Yeah I read about that but I don't even know what the hell a "developer center" is 😂
Indeed, haven't exactly delved into it. For some reason I thought it's some kind of a mentoring / tutoring program. Could've been wrong, though.
Maybe they develop new ways of brainwashing there ^^
Maybe we can find some 'Geniuses' there. .
/jk