I don't know if all the people who wrote that legacy code can be assumed to have had a clue what they were doing. I became a professional web developer by saying to my boss (I worked in the mail room at the time) "Hey, look what I can do." The only learning materials were O'Reilly books and "View source", and my last coding experience was in high school writing games in BASIC on toy computers that plugged into TV sets.