8 points · by jknupp · 17y ago · 20 comments
I've started to implement my site using Django as I'm a moderately proficient Python programmer but would be open to switching to another framework for a compelling reason. Also, where can I find resources to learn the more client facing stuff (AJAX, CSS, basic layout and design, etc)?
As an aside, has anyone else been through this before (i.e. much more comfortable with back end work but want to implement an idea you've had)? What did you do in that situation?
- You'll be doing a lot of JS. Just use jQuery. It's the most popular of the JS / AJAX frameworks, so even if you decide not to use it later on, it's a good starting point.
- I dig Ruby / Sinatra. Never really got into Rails or Django. You can learn how to use Sinatra + Haml + Sass in a few minutes. I've also learned that, somewhat to my surprise given my previous perception of their fan-bases that I don't really like Python and much prefer Ruby.
- For novelty there's Wt (http://www.webtoolkit.eu/wt), haven't brought myself to actually use it for anything though.
- CSS grid layout "frameworks" make things easier. I used (http://code.google.com/p/blueprintcss/) for our new site, but can't say that I had much love for it -- though still much better than doing all of the layout by hand.
Also, was there a specific reason you chose Sinatra over Rails? I'm not familiar enough with either to make an informed decision so it would be interesting to hear others opinions.
Coming from C++, Rails might drive you nuts. I like to be certain of what my code is doing. To achieve this with Rails, you either have to: 1 - write _loads_ of tests or 2 - dig through Rails source to ensure the DSL does precisely what you think it does. You don't want option 2 as Rails source is a nightmare. Option 1 may not fit your sensibilities if you're used to writing defensive code and writing too many tests seems a waste of time.
I can't speak for digging through Django source nor can I speak for how clearly documented the DSL-like things are.
If you want more control over your app behavior or simply see what's going on easier, the python world has webpy and cherrypy. The Ruby world has sinatra. Something in between Rails and sinatra is merb.
My understanding is that Rails has trended that way lately, but since I don't use it day-to-day I can't say whether that's the case.
I can't compare the Django source to Rails, having never really read the latter, but on its own it's pretty good. Like any large-enough pile of code, there are ups and downs, but whenever I've had to dig in and understand what's going on, it's been fairly straightforward to follow.
I like Sinatra partly since we were building apps on our own (non-SQL) database and partly because there just wasn't much to learn. I like things that I can work with progressively rather than having to invest a bit of time in up front to get started.
(My opinions on PHP, Python and Ruby were all formed relatively recently as I learned each of them to write the language bindings for our webservices API.)
Perl is horrible. It basically showed us that python/ruby languages were possible, but is horrible, and lots of legacy code it in is often horrible.
Rails is the bomb, except when you need to scale, or something is wrong.
Python by far has more modules, and ties into C easiler (and C++ via weave).
...when you need to dig into the Rails source to figure out what's going on. You really need to fully master Ruby to be able to grok Rails source well.
I think both languages have easy enough C binding.
You will cringe at the web stuff then. Lots and lots of CPU cycles are wasted to shorten the development cycle and simplify (dumb down) the life of the developers. Layers upon layers of abstraction. Using PHP to generate a static HTML page is not a big deal. This sort of thing.
It certainly makes a lot of business sense as the hardware is cheap, and the labor is not. But if you are used to squeezing every last drop of performance from you code, it will be painful to look at some of the web stuff.
I'm a big Perl fan and am comfortable with its object-oriented model so I've chosen to use it. Here's the environment/tools I've settled on so far: Apache on Linux (primary platform, might try to make sure works on Windows too); mod_perl 2 in Apache pre-fork; PostgreSQL 8.x for back-end; Rose::DB for DB persistence layer (apparently easy-to-use ORM, allows many-to-many relations unlike various other Perl-based DB layers); Template-Toolkit 2 for web template environment; going to layer on JavaScript later ... not sure which library to use yet.
To some this may not be the ideal environment or the most current or most up-to-date set of tools. For me though it seems the quickest way to seriously explore and understand web issues.
I have a big hole in my software experience where several web apps should be, and I need to fill it with something. Might try Django or some other Python tool later. I'd actually like to try Twisted some time (asynch Python network engine, not web-specific).
A nice inference typed language which can be compiled down to neko bytecode (much like java bytecode), JavaScript (for the client side), Flash movies (idem), and even C++
Plus, haxe has a mod_neko for apache and lot of libraries to manipulate databases and templates.