Web Application Frameworks: C++ vs Python

void.pointer picture void.pointer · Aug 17, 2009 · Viewed 10k times · Source

I am familiar with both Python and C++ as a programmer. I was thinking of writing my own simple web application and I wanted to know which language would be more appropriate for server-side web development.

Some things I'm looking for:

  • It has to be intuitive. I recognize that Wt exists and it follows the model of Qt. The one thing I hate about Qt is that they encourage strange syntax through obfuscated means (e.g. the "public slots:" idiom). If I'm going to write C++, I need it to be standard, recognizable, clean code. No fancy shmancy silliness that Qt provides.
  • The less non-C++ or Python code I have to write, the better. The thing about Django (Python web framework) is that it requires you pretty much write the HTML by hand. I think it would be great if HTML forms took more of a wxWidgets approach. Wt is close to this but follows the Qt model instead of wxWidgets.

I'm typically writing video games with C++ and I have no experience in web development. I want to write a nice web site for many reasons. I want it to be a learning experience, I want it to be fun, and I want to easily be able to concentrate on "fun stuff" (e.g. less boilerplate, more meat of the app).

Any tips for a newbie web developer? I'm guessing web app frameworks are the way to go, but it's just a matter of picking one.

Answer

matiu picture matiu · Jul 2, 2012

I would go with Wt because:

  • You already know C++
  • It has a nice layout system, so you don't need to know lots of HTML
  • It is very well written and a pleasure to code in
  • Your deployed apps will handle 50 times the load of the python app on less hardware (from experience with pylons apps, 10,000 times the load of a plone app :P)
  • It has all the libraries that the guy in the first question says it doesn't and more
  • Web 2.0 isn't an after thought; it wasn't designed on a Request+Response model like all the python frameworks (as far as I know), but on an event driven interactive model.
    • It uses WebSockets if available
    • Falls back to normal ajax gracefully if not
    • Falls back to http for browsers like linx
  • It is more like coding a gui app than a web app, which is probably what you're used to
  • It is statically typed and therefore less error prone. Does def delete(id): take an int or a string ?
  • The unit tests (on my apps at least) take 10-100 times less time than my python app unit tests to run (including the compile time)
  • It has a strong and friendly community. All my email list posts are answered in 0-3 days.