What would have been better, though perhaps not technically possible, was to try WiFi while keeping the mobile data active, only switching if the WiFi worked well. Not sure it's possible to run both at the same time, though.
This behavior was introduced to my Nexus 5 beginning with Android 5.0. It's actually a bit annoying—it broke an app I had purchased that could record and replay scripts to automatically log me in to access points, and the app maker can't (last I checked) find an API that will allow them to re-create the functionality.