Need a compelling argument to use Django instead of Rails

D

Damjan

A few months ago I had to choose between RoR and a Python framework
(TurboGears in that case). I picked TurboGears because of the language
maturity and all the third party libs. i.e. I can do PDF reporting with
reportLab, control OpenOffice with Python..

This is a good argument, you should make a list of all the greatest python
libraries that you could use for your projects, for ex. reportlab, PIL,
doctools, elementtree, sqlalchemy etc etc and try to "sell" that.

BTW I'd choose TurboGears for it's flexibility, but I guess Django could be
nice when more rapid results are needed (and the problem doesn't fall too
far from the Django sweet spot).

This is a hard attitude, but I have the same feeling about Ruby, I like
Python and just don't see a reason to invest any time in Ruby (Rails or
not).. and from that little I've seen from it.. I didn't like it.
OTOH Ruby surelly is not that bad either.
 
M

Michele Simionato

Joe Knapka ha scritto:
Classes are effectively open in Python, too, at least
where methods are concerned, since one can do
klass.__dict__["myMethod"]=myMethod.

Yes, but builtin classes in Python are closed and this is the relevant
point.


Michele Simionato
 
K

Kay Schluehr

Ray said:
You mean the alpha? They're rushing for a beta now that'll bring Jython
to 2.2, I hope it'll come out soon.

Aren't they "rushing" for years? The last update of the Jython news
page is from march 2005. This is not very encouraging even if there is
a secret life of Jython. But maybe we shouldn't worry because we can
still read:

"Jython, lest you do not know of it, is the most compelling weapon the
Java platform has for its survival into the 21st century:)"

I would eventually forget Jython completely and select a bridge like
JPype and ask for use cases and expected interaction between both
languages.
But yeah, compared to IronPython
(2.4 compliant, halfway to 2.5 even), it's pretty behind. But things
are changing the development seems to be picking up speed again!

But you can't compile a Python module into a dotNet library that is
used from C# which is the very essence of the CLR. IronPython is not
more usefull than PythonNet.
 
B

Bruno Desthuilliers

Joe Knapka wrote:
(snip)
Classes are effectively open in Python, too, at least
where methods are concerned, since one can do
klass.__dict__["myMethod"]=myMethod.

actually, klass.myMethod = myMethod is enough...
 
P

Paul Boddie

Joe said:
Steve Yegge's "Opinionated Elf" is an example of a problem
that is very easy and elegant to solve with open classes,
and painful to solve when classes are closed:
http://www.cabochon.com/~stevey/blog-rants/polymorphism-fails.html

For some value of "elegant", I suppose:

"But the real problem, the one that really gets me, is that your code
is going in and distributing itself across all the classes in the
system. It feels like a violation of encapsulation."

Paul
 
R

Ray

Kay said:
Aren't they "rushing" for years? The last update of the Jython news
page is from march 2005. This is not very encouraging even if there is
a secret life of Jython.

Yeah I know... but I've been subscribing to jython-dev for quite
sometime, and the activity there is surely picking up compared to, say,
early 2006. Jython has new committers on board as well so that's
encouraging.
But maybe we shouldn't worry because we can
still read:

"Jython, lest you do not know of it, is the most compelling weapon the
Java platform has for its survival into the 21st century:)"
:(


But you can't compile a Python module into a dotNet library that is
used from C# which is the very essence of the CLR. IronPython is not
more usefull than PythonNet.

At least for my case I will use IronPython for higher level task, and
perhaps calls libraries written in C# instead of the other way around,
plus you can leave your module as scripts anyway. If what you want from
C# is accessing Python's power then you can always host the IronPython
engine can't you?
 
R

Ray

Damjan said:
BTW I'd choose TurboGears for it's flexibility, but I guess Django could be
nice when more rapid results are needed (and the problem doesn't fall too
far from the Django sweet spot).

Well actually I was thinking of exaclty the same thing, because our
apps are mostly CRUD apps anyway. However I just learned of one very
big killer--lack of support for Oracle and MS SQL Server. That pretty
much shoots Django down from the list, and with it Python.
This is a hard attitude, but I have the same feeling about Ruby, I like
Python and just don't see a reason to invest any time in Ruby (Rails or
not).. and from that little I've seen from it.. I didn't like it.
OTOH Ruby surelly is not that bad either.

Yeah, I know... in fact I have the same attitude towards Ruby too.
People have been telling me it's cool left and right and I go to see
some Ruby code, I go "UGH!", and refuse to continue. Maybe because Perl
is #1 on my Most Hated Language list. *shrugs*

Just that it's a big, huge, humongous pity to see Python keeps missing
the big thing over and over again. Last time when biotechnology was
hot, which language became The Language? Perl. Now simple web app is
hot? It's Ruby. Of course Python is used by Google and it's something,
but I guess a lot of people do not know that, even those making a
living in the IT industry. OTOH everybody knows about Rails and and
everybody raves about it, even those who haven't touched it!
 
R

Ray

John said:
I get that overall impression of Django too (as being more tightly
coupled to itself, hence less flexible, when compared with TurboGears
in particular). I haven't done much with it yet, though (and
presumably the 'magic-removal' branch landing did some good).

What do you make of the rest of Django (aside from the DB stuff)?

It's a shame TurboGears doesn't yet have a solid "out of the box" CRUD
admin interface as Django.

And it's a shame that: Python doesn't have The Anointed Web Framework.
Things may have been different if there can be only one, who knows.

The lack of support for Oracle and SQL Server by Django is also a
killer that'll prevent Django from being picked up by a LOT of
companies (sadly, including mine :( ).
 
G

gregarican

I would suggest trying to pick up Ruby. Knowing both Python and Ruby
has helped me in that I can choose whichever tool is the best fit.
There are certain cases where I have to abandon Ruby for a certain
project because the library isn't mature enough or cross platform
enough for my requirements. So coding in Python is my option. Then
again there are other things where I am able to choose Ruby as the best
fit because of other concerns. The languages are different, but not
_that_ different. If you can get past the initial Perlishness (is that
a word?) of Ruby you will find that going from one language to the
other isn't that huge of a jump.
 
J

Jaroslaw Zabiello

Ask them why.

I know why. In general Java guys can recognize Ruby as more friendly
language than Python, more secured (there is almost no security in Python).
There is also much more hype about Ruby on java blogs.
The behaviour of Ruby hasn't even properly been defined.

No. Ruby uses different paradigm. The language can be extended with its
open classes. There is many similarity between Ruby and Smalltak. No Perl
or Java, but Smalltalk. Philosophy and object model is very similiar. Ruby
is more dynamic than Python exactly like Smalltak is.

The main reason for using Rails is: Rails is complete framework, much
easier to learn and use than Django.

The main reason for using Python: Python is more productive. It is easier
to learn Python than Ruby. Python uses minimalistic approach. It contains
less methods, structures than Ruby. It is easier to memorize. Ruby has
messed namespace with many aliases to methods. And it has much more methods
to every object. It is difficult to remember them. There is no Ruby
docstrings as well. You have to read manual, book much more than in Python.

Also modules are easier to use in Python. When I am doing import blah i
know what was downloaded and I can see it by simply typing dir(blah).
But when you do "require blah" in Ruby you know *nothing*. You have to
look inside blah.rb file to see what was happened. "require" command can
execute code, add many namespaces etc. etc.
 
J

Jaroslaw Zabiello

Another reason for me not to use Ruby, is that there is no distinction
between those two lines of code:

x = somefunc
x = somefunc()

It has no meaning. Just use always () if you like. But sometimes it is
better to avoid them to have more beautifull code. E.g.

class Article < Activerecord::Base
belongs_to: author
has_many: comments
end
 
B

Bruno Desthuilliers

Jaroslaw Zabiello wrote:
(snip)
Ruby is more dynamic than Python

Care to elaborate ? I played a bit with Ruby and failed to come to the
same conclusion... (the two main differences I noticed are 1/ Ruby is
expression-based and 2/ it has a more canonical object model - IOW, it
mostly cloned Smalltalk's one)

FWIW, Lisp-like macro-system apart, I have difficulty imagining how a
language could be more dynamic than Python...
 
S

Sybren Stuvel

Jaroslaw Zabiello enlightened us with:
I know why. In general Java guys can recognize Ruby as more friendly
language than Python, more secured (there is almost no security in
Python).

Funny how Java people think that's so important, while in general Java
programs are no more stable and error-free than other software.
There is also much more hype about Ruby on java blogs.

I think that's the major factor ;-)

No. Ruby uses different paradigm. The language can be extended with its
open classes. There is many similarity between Ruby and Smalltak. No Perl
or Java, but Smalltalk. Philosophy and object model is very similiar. Ruby
is more dynamic than Python exactly like Smalltak is.

The main reason for using Rails is: Rails is complete framework, much
easier to learn and use than Django.

The main reason for using Python: Python is more productive. It is easier
to learn Python than Ruby. Python uses minimalistic approach. It contains
less methods, structures than Ruby. It is easier to memorize. Ruby has
messed namespace with many aliases to methods. And it has much more methods
to every object. It is difficult to remember them. There is no Ruby
docstrings as well. You have to read manual, book much more than in Python.

Also modules are easier to use in Python. When I am doing import blah i
know what was downloaded and I can see it by simply typing dir(blah).
But when you do "require blah" in Ruby you know *nothing*. You have to
look inside blah.rb file to see what was happened. "require" command can
execute code, add many namespaces etc. etc.

Thanks for the explanation! It looks like Python is indeed the way to
go for me. I get the feeling that, even though Rails is apparently
easier to learn and use than Django, writing larger websites that
require a substantial amount of business logic is actually easier in
Django/Python.

Sybren
 
G

gregarican

Ray said:
The lack of support for Oracle and SQL Server by Django is also a
killer that'll prevent Django from being picked up by a LOT of
companies (sadly, including mine :( ).

Uh, yeah. I was aware of Django but haven't had the time to delve into
it. If it doesn't support these larger scale database server types that
would indeed throw a red flag up in certain environments. What all
types doesn't it support? MySQL, PgSQL, SQL Lite, Pervasive SQL? I
know. I haven't made Google my friend and haven't STFW :-/
 
J

Jaroslaw Zabiello

I have difficulty imagining how a language could be more dynamic than
Python...

E.g. try to extends or redefine builtin Python classes on fly. Ruby is so
flexible that it can be used to create Domain-specific Programming
Languages.
 
A

aaronwmail-usenet

Jaroslaw said:
E.g. try to extends or redefine builtin Python classes on fly. Ruby is so
flexible that it can be used to create Domain-specific Programming
Languages.

This, of course, is really cool if you are working
all by yourself on a dissertation or something,
but can be completely disasterous if you are
actually working with other people who need to
know what the expressions of the programming
language mean and do. Back in the day every
good Common Lisp programmer wrote in a
dialect completely incomprehensible to any other
Common Lisp programmer. Kinda fun, but not
"best practice."
-- Aaron Watters

===

Writing about music is like
dancing about architecture.
-- Elvis Costello
 
J

Jaroslaw Zabiello

This, of course, is really cool if you are working
all by yourself on a dissertation or something,
but can be completely disasterous if you are
actually working with other people who need to
know what the expressions of the programming
language mean and do.

This should not be problem in real life. Look at Ruby on Rails. This is
excellent example of DSL in action. Rails uses customized Ruby to create
very friendly web framework. So there is no possible to create such simple
and friendly framework in other language than Ruby (and Smalltalk which has
the same feature)

Of course, I you like, you can freeze every object you want and nobody can
be able to open and change it. You can also trace all activity for changing
something to objects because Ruby has nice system hooks implemented. Ruby
has nice security system (private, protected, public scopes for methods and
attributes, objects freezing, system hooks). In past Python had Bastion
module (http://www.python.org/doc/lib/module-Bastion.html) but it was
rejected and now Python has nothing. Java guys can favor Ruby also because
of its security.
 
B

Ben Sizer

Ray said:
Just that it's a big, huge, humongous pity to see Python keeps missing
the big thing over and over again. Last time when biotechnology was
hot, which language became The Language? Perl. Now simple web app is
hot? It's Ruby.

The problem is that Python is the 2nd best language for everything. ;)
As a general purpose language I don't think it can be beaten, but for
almost any given project of non-trivial size, there seems to always be
one language that has better support for the subject. I frequently find
myself wanting to use Python but being unable to, often due to some
library being unavailable, as in your case.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top