Beautiful mini language for outputing HTML in Python
21–30 of 74 posts
Re: Beautiful mini language for outputing HTML in Python
#22Is HTML that hard to write?
Re: Beautiful mini language for outputing HTML in Python
#23Re: Beautiful mini language for outputing HTML in Python
#24I like HTML. I like the way it looks. I like writing it. On the other hand, I don't like new DSLs for writing what is already a simple markup language.
Re: Beautiful mini language for outputing HTML in Python
#25Earlier quoted context omitted.
What is the problem with using one language to produce another? How do you think your primary programmin language gets converted to assembly and then to machine code? As far as I am concerned this is a useful abstraction on a trivial problem.
The problem is that this is a trivial problem. Why add an abstraction on top of something that is already so simple?
Re: Beautiful mini language for outputing HTML in Python
#26This probably appeals more to people who have made the Python jump and like that whitespace means something, as that's what really makes it terse.
Re: Beautiful mini language for outputing HTML in Python
#27I'm not a big proponent of all of these new HTML replacers. They don't really buy you anything--this one just gets rid of angle brackets as far as I can see, and adds CSS style #id and .classname. Now, instead of angle brackets, we have to use tabs, or spaces, or some other delimiter (I saw | in there for continuing a line). The best way I've found of representing XML/XHTML or even HTML for that matter, is with X-Exp…
Yes, I think that for HTML, "better tools" is the right answer. HTML is something that can be shared between people with various backgrounds, skills, and toolsets. I can write it in Emacs on Ubuntu, and send it to some guy who will work on it in Windows with Notepad, who can send it to someone else who will open it with Chrome on a Mac. These things might be ok for small, tight teams, but I don't see them as buying t…
But the verbosity is also one of its weaknesses for large projects; it adds a great deal of overhead in terms of keeping track of the tags, especially if the HTML needs to be re-arranged. And with no language-supplied rules for how much whitespace to use or where (beyond "all adjacent whitespace is compressed"), there is too much flexibility for a large team to work smoothly. My usage case doesn't mesh with your example, because I'm working in an environment with version control and multiple developers. The guy using Notepad will be told to get a tab-aware text editor, because his changes will mangle the whitespace in the file and lead to unnecessary noise when he commits.
When structure in your whitespace is already desired (to avoid making your version control noisy), you can leverage the fact that you are structuring the whitespace to make it a semantic element. This greatly decreases typing, makes the code easier to eye-scan, and allows details such as proper closing bracing to be left to the compilation tool and not to the developer. I agree with commenters who have noted that HAML has been proven useful for some developers.
I would categorize both SHPAML and HAML as tools that let you be more productive with HTML.
Re: Beautiful mini language for outputing HTML in Python
#28I no longer fall for languages that only change the syntax for something the author thinks it's cuter...