Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
htns
on March 12, 2020
|
parent
|
context
|
favorite
| on:
I Don't Use Classes
That's equivalent to wrapping an enum in a class. Emulations of type hierarchies without OO often fail like this, having a A-or-B be literally the same type so losing out on type safety/forcing constant rechecking of the discriminant.
afiori
on March 13, 2020
[–]
That can be done in Rust by having two different types implement the same interface
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: