logoalt Hacker News

greenbittoday at 4:35 PM2 repliesview on HN

Sometimes I actually want objects that are transparent, fully public, and 'struct' is perfect for that. But if I then go and put methods into those structs, does that make me unorthodox?


Replies

blashyrktoday at 4:54 PM

That's simply because we live in a world where UFCS is restricted to niche languages and we're stuck with "methods" instead. At least Rust/Kotlin/Swift support type extensions (with a thousand papercuts, i. e orphan rules)

badlibrariantoday at 4:39 PM

[flagged]