At its core, WordPress is designed for blog content, thus displaying actual code on the front end, is not a core focus of the platform. That's why plugins are the best option because they add formatting possibilities.