Comment

Comment by mhartl

Python was the first language I ever loved. And I've defended it, and especially its whitespace for block structure, more times than I can count. (One Perl programmer I know can't mention Python without describing it as "that whitespace language", and I couldn't understand why until I saw some of his, ahem, "creatively indented" Perl code. I'm so anal about indentation that I really never noticed.)

But eventually I realized that whitespace is an Achilles heel in one context: using Python as an HTML-embedded template language---unfortunately, a very important case. Seeing this Django book, and finally understanding how they solved the template-language problem with Python, appears to confirm this intuition. They solve it the same way all Python frameworks solve it: they introduce a separate, template-specific language.

This is one big reason why I love Ruby, and Rails. Because Ruby uses an "end" keyword, it works great as an HTML-embedded language. This means that, in Rails, you always have a full-strength language at your disposal, and never have to use a watered-down template language.

It's possible that Django is awesome nonetheless---it does seem to be attracting some first-rate hackers---and I could certainly be convinced to switch, but being able to use embedded Ruby will keep me firmly in the Rails camp for the time being.

parent mhartl 19 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton