Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am looking for a language that I can separate the HTML and the code in it easily. I mean somethimes it is difficult to separate HTML but I am sure there is a language or Framework which can easily help in making very clean code. Which language is best known for this issue?

share|improve this question
3  
The one I use! ;) – Tony Mar 25 '11 at 12:07
Frameworks mostly include facilities to template HTML code and where it can't be templated (Ie, dynamic code) it's generated by the framework. There's little/no mixing involved. – Evan Plaice Mar 25 '11 at 13:47

closed as off topic by Walter, Yannis Rizos Apr 17 '12 at 13:47

Questions on Programmers Stack Exchange are expected to relate to software development within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

10 Answers

Wicket does a nice job of this. HTML and formating code is stored in .html files while the logic and data comes form Wicket page classes. It is a little strange at first, but does provide a nice separation.

share|improve this answer

Microsoft ASP.NET, C# MVC combination (There are other languages available, but this is becoming the most prefered.) can do this pretty easily.

share|improve this answer
2  
Razor is a good template engine as well. – BlackICE Mar 25 '11 at 12:51

I haven't used it but I have heard good things about Python in combination with Django.

share|improve this answer

I guess mostly all the programming languages have some or the other framework for this.

Java - Wicket PHP - CodeIgniter Python - Django

share|improve this answer

The language that I know to have some template framework that helps with the HTML/server code separation are Java, Perl and Python. Java has the biggest collection of frameworks to choose, from very good to awfully bad, Perl and Python has a smaller amount of stable frameworks but they work like a charm.

share|improve this answer

Pretty much any modern webby language can make cleanly separated code. Or a big ball of mud. It is as much on the developer to maintain the separation as it is on the framework to provide guidance.

share|improve this answer

For the most part, you shouldn't be concerned with language so much as framework, particularly an MVC web framework. There's such a framework for just about any language you can think of, and certainly nearly all of the popular languages. Ones I've worked with are Ruby on Rails (probably the canonical web MVC framework) and Django, which both do the job of separating logic from presentation equally well.

share|improve this answer
Yeah, Ruby on Rails has a lot of greatness in it, but identifying MVC as a powerful pattern for web applications might be it greatest contribution. – Adam Crossland Mar 25 '11 at 13:49

PHP with a decent MVC Framework (like Symfony) are great for keeping your code in a clean MVC pattern.

share|improve this answer

Google web Toolkit (GWT) has very good MVC framework and many other features to help you achieve what you want.

share|improve this answer

For things that I want to get online quickly and not futz around with a big framework, my automatic go-to is Python + the Cheetah template engine. Very simple - do all your logic in Python, write your html template, the Python script sends variables etc to the template, Cheetah makes shiny html files.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.