Many people, particularly groups of people traditionally excluded from professional life, really have no idea about the reality. The information is out there, but if you've always been told that law is the safe, smart thing to do, you might not even know to look. Known unknowns versus unknown unknowns, and all that.
Most people fall into their work not out of a rational economic analysis (which is pretty damn hard, even for people who do it for a living) but out of impressions born of the zeitgeist. When someone chose to study CS or become a programmer (or whatever it is that you did), he or she probably didn't go through heaps of research about its prospects and then read a couple of books about whether or not those would continue in the future. Most likely, he chose to do it because he enjoyed computers, had friends with big salaries out of school, and knew there was a bunch of money flowing into companies like Google. Through luck of the draw, that decision worked out.