Ian Bicking: the old part of his blog

Re: Why Web Programming Matters Most

Ruby on Rails has made such a stir in the Python community because of the hype and popularity of it. Those of us who feel that Python is a superior language are kind of jealous of the hype. Why not Python? Why not a Python based web framework? Waaaaaa!

I've never used RoR, so I don't know whether I would like doing web development in it. I suspect I would like some aspects of it and not others (based on seeing Dave Thomas's presentation in it at a conference I went to). I suspect after the hype starts dying down, we'll get to hear about RoR's drawbacks.

I agree that a really good Pythonic web framework would be neat. However different people have different ideas about what makes up a good web framework. And I'm not sure what a truly Pythonic framework would be like.

Personally I can't stand having code embedded with HTML. Yuck-o! Usually when I work on a project the HTML is done and redone by a graphic artisty person and I don't want code in there for them to muck up. I don't want to have to re-integrate code every time I get the HTML back. I want as little code as possible in my HTML please. That is a huge deal to me.

So things like Spyce and <insert your templating language of choice> are not very appealing to me. Heck, why not pure HTML with unique IDs on everything, and a parser that compiles the HTML into Python with a way to access all the ID'd HTML elements?

I am a fan of ASP.NET actually. Yeah, boo hiss I know. Evil Microsoft, etc. I'm surprised someone hasn't developed something similar to ASP.NET in Python (look at Tapestry for Java and Prado for PHP). I don't think ASP.NET is perfect, but I think it has some really kick butt ideas that take the drudgery out of coding web forms and forms processing.

Server Controls are a great way to componentize HTML + logic. User Controls are a great way to re-use forms and all the form processing code. They aren't perfect, but they are pretty darned good.

I have used PHP off and on over the years. Its kind of the lowest common denominator web development language. I'm not a big fan. It is popular because it is really freaking simple. You don't have to do any OO programming. You can just start spewing out code. And much of what people write in PHP is ugly spaghetti code. Forms processing is painful and can quickly get out of hand. There is not a good way to componentize form+logic.

If there were a Python framework that were as popular as PHP, it would probably have similar limitations as PHP. It would be too simple.

People are so weird about the whitespace issue in Python. It is a huge turnoff to people. I know it discouraged me from learning Python. Eventually I broke down and learned it anyway.

The funny thing is - we all use whitespace to show program structure in any programming language we use. Why do having those curly braces make us feel so safe? Why does it feel so dangerous to not use the curly braces? It is some bizarre psychological issue that annoys programmers way more than it should. Giving up the curly braces is scary.

Yet when you give them up, and get used to it, it seems so silly that you so staunchly defended them in the first place.

Dammit, we all use whitespace to denote structure anyway. Give up the curly braces. They don't matter. Really. Trust me. Seriously.

So where does that leave us? Python has what..200 different web frameworks? And there are probably 20 more in development at any one time? Well, maybe not, but it seems like it.

What puzzles me is that many of these frameworks seem to be solving pretty much the same problems. So they seem fairly interchangeable to me. The truly innovatives ones are few and far between.

People have different ideas of what they want a web framework to be. People have different requirements.

I don't care about whether my Python framework is supported by an ISP. I am never using a hosting account. So that is never a big deal to me. I've got root on whatever box is going to be my server. So I can install whatever I need to.

I've not seen a Python web framework that feels good to me. Maybe I just haven't looked hard enough at the ones out there now. It takes time to sit down and start playing with a new framework and seeing what it is really like to develop with. You pretty much have to commit to doing some kind of project in the framework to really get a feel for what it is like.

Are there people out there working on an innovative Pythonic (whatever that means) framework that isn't just a reaction to RoR or PHP? Is there a component and event based Python web framework out there?

Comment on Why Web Programming Matters Most
by Dennis

Comments:

The number one thing that makes PHP easy to use is it's documentation. The thing with good examples and user comments together with the actual api makes PHP great for productivity. I found it hard to use Python because the documentation wasn't organized as nicely as the PHP docs was.

# aticle