I don't believe either of those two companies have ever been profitable. (I'm sure Musk has some accounting tricks to make it look that way, though.)
OP argued that investment is lead by short term thinking, yet i point out example of long term thinking and risk taking by investors.