in reply to Re: Code and html separation - always or mostly doable?
in thread Code and html separation - always or mostly doable?

I can see $bgcolor and know exactly what it means. Same with any other well-named variable. That aside there are tons of problems with your approach

  1. What happens when you need to make a really large page? You can't see $bgcolor if its buried under 1000 lines of lines of HTML. You also will find it much harder to see anything else in your program.
  2. Designers don't know and don't want to learn Perl. They want to make HTML in Dreamweaver and then have you make it work. Templating makes this much easier and I can write the program while they're making pretty pictures.
  3. Much less typing! No need for the extra print statements! Design with an HTML editor if you want to. Or as I stated above another designer can work on it.
  4. This code isn't modular, you can't reuse the HTML design easily without copying it to another script. Templates make reuse simple

No offense intended and I understand its your opinion, however your suggestion is the exact opposite of what the parent poster is trying to accomplish. So its not exactly helpful. Also try some templating, trust me, its not hard (I personally like H::T!) and once you get it you'll never ever go back!

Update: Fixed some typos and my terrible spelling :)