Is there a better way to programmatically insert content into a page?

Is there a better way to programmatically insert content into a page?