This is fine advice as long as you're under 35 or so, after that you become completely unhireable in many tech companies so you better hang on somewhere.
I don't doubt that age discrimination in tech is real, but I'm pretty sure comments like this are way overstating it.