But on my Galaxy S4 and my current Galaxy S5 (which is updated to 6.0.1 I think), things work quite well.
It's not perfect of course: I'm using the regular Samsung/Sprint ROM which is absolutely loaded with crapware. I disabled all the crapware, but it's still there wasting a lot of valuable space out of my 16GB. It could be a little faster at times, like with the camera. But freezing and reboots just aren't a problem the way there were on old Android versions that I've used.
I do plan on trying out CyanogenMod sometime when I have some free time. But for now, the carrier-pushed version seems to work decently well. I don't have any giant complaints.
I have seen pretty sluggish, full of memory leaks and dangling pointers, C code written at enterprise level, by developers that couldn't care 1s about code quality.
Just about every Android device I've used has been painful in some way or other and invariably I've ended up rooting it and installing a custom firmware, generally the most light-weight one I can find.
Unfortunately, despite these antics Android remains annoyingly prone to sluggishness, freezing, reboots and various other random problems.
Ultimately it seems that with Android you're either forced to use a stock ROM which imposes a heavy memory footprint due to all the "wonderful" tweaks Samsung/Sony/HTC/Xiaomi have made or drop down to a user-built AOSP-based variant that is inevitably plague by its own issues.
I'm horrified to think this kind of thing is the height of the mobile user experience.