Why doesn't the Android framework use enums instea...
# language-proposals
p
Why doesn't the Android framework use enums instead? Those could be checked exhaustively.. Or wrapped in sealed classes or....
☝️ 1
d
Using ints over enums is an optimization.
p
I see. Makes sense.
p
I'm still not sure of
Im constantly wrapping that stuff in enums myself ^^
d
I think it was a decision that made sense in 2006 (or whatever it was made). It is not a decision I would make in 2017, especially with a Kotlin project.
p
Not really
Take a look at the support library, they still use ints for everything
p
and my $800 phone still lags
my $50 Windows Phone was smoother than flagship android phones.. makes me so mad
d
Why would they change such a significant system? Imagine how much code you would worry about breaking or having two systems in place at the same time as you wait multiple years for people to migrate between OSes. It’s different to make a decision without a pre-existing system.
r
Remember Android started on devices with 90 MHz CPUs, 64 MiB of storage and 64 MiB of RAM :)
There are enums in the Android APIs btw. Nowadays we go for consistency (and we try to be mindful about memory, startup time, etc. so in some cases ints are a better fit)
👍 2