Forum Moderators: coopster
It will depend on the number of templates/layouts needed for the site in question.
It depends on the number of times each piece of code will be used. Use it once it goes in the page, use it twice it goes in a common lib as a function.
I personally prefer to have a template that is fed the content for the given containers.