in reply to Many prints of small string or one print of huge string?

The best way to find out is to profile the code to see which satisfy your optimality criteria. Which you haven't specified BTW. The first may be slightly slower but may also use less memory. What are you trying to optimize?

However, the first question that comes to my mind is "Why do you care?" Premature optimization is the root of all evil. The best thing to do is separate your program logic from your presentation logic, so you should really be using some sort of templating system. Most templating systems take care of handling the output for you so you don't have to worry about doing it piecemeal. :-)

  • Comment on Re: Many prints of small string or one print of huge string?