As opposed to something like Amazon which grew and grew for nearly 20 years, always burning more cash than it made to fuel growth, but they understood the business really well and when they decided to optimize for profitability rather than growth, never never gone back.
Companies that behave that way and have good returns on capital employed and have large growth in earnings, free cash flow, etc are good investments. Doesn't matter if they're not showing profits.