You are not logged in.

#1 2006-03-05 13:28:20

Oin
Member
Registered: 2005-09-02
Posts: 63

Django, RubyonRails or plain old ugly php?

I've been wanting to do some dinamic websites, and stumbled upon rubyonrails while looking for documentation on php. Then I searched for a lot of info about RoR, and found only a looot of propaganda and not enough documentation.
Then I found out about Django which is sort of like python on rails, and this one seems to have a lot of well-written documentation, if more obscure then RoR.
They both share a big problem though: lack of webhosters (especially free ones)

Now my questions come: would it be a good deal if i started learning one of these 2 frameworks? Is it all worth it ? bearing in mind that i can't find hosting, and not a lot of people have heard about them (e.g.potential employers)

Or should I just teach myself php, which everybody uses, hosts, has heard about, "loves" etc. etc. ?

also, does anybody have any experience with rubyonrails? (where can i find better documentation?) or django? ( i did a search on this forum, and it seems like nobody has ever mentioned django before)


In Linux there are no secrets!

Offline

#2 2006-03-05 16:37:53

Riklaunim
Member
Registered: 2005-04-09
Posts: 106
Website

Re: Django, RubyonRails or plain old ugly php?

If you don't have your own server then use PHP. Ruby/Python hostings are rather rare and often expensive smile But if you want nice dynamic site with lot of features - Python is nice and you can use simple and easy CherryPy or maybe Twisted. Zope/Plone - for advanced users.

Offline

#3 2006-03-05 16:53:27

elasticdog
Member
From: Washington, USA
Registered: 2005-05-02
Posts: 995
Website

Re: Django, RubyonRails or plain old ugly php?

I voted Ruby on Rails, but really think it depends on what type of application you're looking to build ("dynamic web app" is fairly vague).  Like they say, the right tool for the right job!  I agree that there is a lot of propaganda surrounding the RoR community, but I also think a lot of it is justified.  I don't approve of when they go and bash other languages/frameworks, but self-promotion is a key to getting wide-spread adoption, especially with an emerging technology.  Plus, it is true that many people from many other frameworks have "made the switch" and like the productivity that Rails provides.

I like Rails because of the simplicity and speed brought to it through Ruby.  I find it extremely elegant and intuitive for the stuff that I've been working on lately (although admittedly, I'm still somewhat of a Rails n00b).

As far as resources go, there is a lot of information that gets spread around out there, but it's not easy to find.  The author of the famous Pickaxe book on Ruby wrote a great tutorial earlier this week for Apple that touches on a lot of the newer functionality built into Rails: Using Ruby on Rails for Web Development on Mac OS X.  I also own a couple of books on the subject, but unfortunately, they weren't free:

* Programming Ruby (AKA "Pickaxe") - The first edition is freely available online, but the second edition has a lot more up to date info.  For just learning the basics, the first edition works just fine.

* Agile Web Development with Rails - Also by the Pragmatic Programmers, this is pretty much the definitive book on Rails and covers things in great detail.  It has a store-front application that you develop in the first part of the book, and then proceeds to give more details about the framework itself, and then has a large reference section.

* Rails Recipes - This is available as a Beta book only as of right now, and has a lot of practical examples for solutions to common problems.  It will be a great reference when it's done, but definitely not for someone who doesn't know at least a little Rails already.

* Ruby for Rails - This is also only available as a Beta book, but it has by far been the most beneficial to me.  It focuses on teaching how Ruby works in a way that ties into the functionality of Rails.  I had read both of the Pragmatic Programmer books to get the gist of both Ruby and Rails, but didn't really understand how it was all interconnected until I started reading this book.  Only the first 6 chapters are out as of now, but I highly recommend this one.
I agree...I'm not even sure if free hosting that supports Ruby is available.  You may have to host it yourself, or fork out the dough if that's the direction you want to go.  I don't think that you have to worry too much about the "name recognition" factor, as learning any framework will help you grow your skills and if you like one enough, you could always choose to become an evangelist yourself smile

Well...I just wrote a novel, but I hope that helps you out some.  Good luck!

Offline

#4 2006-03-05 18:58:24

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Django, RubyonRails or plain old ugly php?

Rails hosting:
dreamhost -- http://www.dreamhost.com/
planetargon -- http://www.planetargon.com/
textdrive -- http://textdrive.com/

I have no experience with django.
I must say though, that I have quite a bit of experience with php, having worked with it extensively both in a private capacity (my own projects) and for work (jobs and contract projects).

I have formed several opinions with regard to php: http://e.cactuswax.net/articles/2005/09 … y-on-rails

I would definately recommend rails over php. Like I said though, django is an unknown to me. I do like python quite a bit as well, and frankly.. just about anything is better than php in my mind.. well..except for maybe perl. wink


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#5 2006-03-05 20:16:29

Sander
Member
Registered: 2006-02-26
Posts: 138

Re: Django, RubyonRails or plain old ugly php?

I'm using www.asmallorange.com 's tiny plan for my Rails stuff... though I haven't actually set up an application on it yet, so I can't really say if it's good or not. Seems to be receiving good feedback from everyone, though. I'm a RoR fan, by the way smile


You like cheese? You like peas? You'll love cheezy peas!

Offline

#6 2006-03-05 20:18:05

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Offline

#7 2006-03-05 22:01:46

_Gandalf_
Member
Registered: 2006-01-12
Posts: 735

Re: Django, RubyonRails or plain old ugly php?

Is RoR faster than PHP, i mean moving to RoR means leaving all the PHP applications behind, so does it worth it?

Offline

#8 2006-03-05 23:23:58

elasticdog
Member
From: Washington, USA
Registered: 2005-05-02
Posts: 995
Website

Re: Django, RubyonRails or plain old ugly php?

_Gandalf_ wrote:

Is RoR faster than PHP, i mean moving to RoR means leaving all the PHP applications behind, so does it worth it?

There are too many factors to account for when answering that question...there's no clear-cut answer.  It depends on hardware, on the server you're running (apache/lighttpd/etc.), how you're going to measure speed for a fair comparison, and so on.  Do you want to know how it scales?  Do you want to know if it's responsive?  I think it can be just as fast or faster than PHP, but likewise I think PHP can be faster.  It can change drastically depending on who is doing the programming, and what kind of focus they have for the project...speed versus stability, etc.  It's not really a fair question.

Offline

#9 2006-03-05 23:34:58

_Gandalf_
Member
Registered: 2006-01-12
Posts: 735

Re: Django, RubyonRails or plain old ugly php?

Yea that's not actually a fair question, but as you said, for me PHP is better than cgi scripts, it's easier and consules much less ressurces, i will check out RoR and see how responsive it is, do a little project with it...

Offline

#10 2006-03-06 17:23:44

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: Django, RubyonRails or plain old ugly php?

I would say on average, that rails is a bit slower than php.

Rails does alot more for you though, and I would say that the speed of development of a rails app is faster than developing a similar php app. I also feel that the resultant rails code is cleaner, and more maintainable in the long run.

I say php is faster, because php can throw everything together, mixing display logic with backend storage logic. In rails, there is seperation of the logic, ala M.V.C style frameworks.

In the end, both languages/frameworks can be used to write good software (web apps). There are tradeoffs for anything.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#11 2006-03-06 19:33:51

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Django, RubyonRails or plain old ugly php?

Oi, time to rant rantity rant rant.

I'd vote "None of the above", but it's not an option.  So let me first rant about the epidemic that is "teh[sic] web 2.Oh"

Rails/Django/Turbogears/etc etc - Frameworks overly designed to "make it easy" while "hiding details" and "providing event based functionality".

I got news for you.... these "details" that are hidden, they're less complicated than these frameworks.

Event based?  What a load of crap.  The internet is inheirantly stateless, with no events beyond GET/POST/HEAD, etc (leaving javascript off of here - I have no problems with 'AJAX' no matter how much I dislike the acronym).

Let me put this to you, a developer, in a way that makes sense:

Any "web application" can be broken down into three very typical sections - the presentation, the logic, and the data.  In theory this works real well with the "Model-View-Controller" model present in these frameworks.  In practice however, I'd like to point out the critical flaw.

You know what HTML looks like, you know valid xhtml, you know what a 'strong' tag does.  It's not hard.  Oh, whoops, you can't use an 'a' tag, time to use ActionView::Helpers::UrlHelper.  You already know all the properties and css settings for an a tag - time to get rid of that knowledge and learn "The RoR Way" of doing it.  Try to transfer that knowledge to Django.

You (typically) know what SQL looks like, you know how to create a table, how to insert/update, and how to select from it.  It's not hard.  I just want to select a row count for my Turbogears app, should be simple, right? SELECT COUNT(*) FROM MyTable ? No no no! You need to create an 'Object', because 'Everything Is An Object'! It's totally OO!  So go through and create your SqlObject-derived class to wrap up your tables, then you can use that object to get the row count!

It's needless abstractions.  Abstractions which a) add too much complexity on top of an already verbose system (SQL and/or xhtml+css) and b) it's non-portable knowledge.

I'd like to illuminate (b) a bit more.  Many many many many 'developers' out there throw these stupid titles on themselves - "PHP Programmer" or "Ruby Developer" or "C++ Developer" - it's all nonsense.  A programming language is a tool.  Each one fits it's own problem-set.  Calling oneself a "C Programmer" is like saying you're a "Hammer Carpenter" who just uses a hammer.  We all know how dumb that sounds.

When you focus on one wrapper API like RoR or Django, you learn new syntax and paradigms for printing HTML and generating SQL queries - syntax you should already know.  Knowing all the properties of a given SqlObject class means crap when your next project is in C and has to select from the same DB - whoops, you just forgot how to 'INNER JOIN'.

That said, I highly recommend web-toolsets which do not wrap these things beyond where they need to go - python's web.py is very nice for this.  SQLAlchemy is far superior to SQLObject.  There are many other instances, but they are fairly hard to find.  In this regard, PHP got it right.

My recommendation: do it right, learn the correct, portable, and standard compliant way of making a web page.  I trust myself to make proper decisions on where a text entry box goes instead of letting some arbitrary class choose for me.

Offline

#12 2006-03-06 19:44:30

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Django, RubyonRails or plain old ugly php?

Nobody could have said it better!!!

Dusty

Offline

#13 2006-03-06 20:26:58

cmp
Member
Registered: 2005-01-03
Posts: 350

Re: Django, RubyonRails or plain old ugly php?

phrakture, just out of curiosity what do you think about cherrypy? I guess you can say, it's a simple url to object/method mapping.

Offline

#14 2006-03-06 20:38:49

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Django, RubyonRails or plain old ugly php?

cmp wrote:

phrakture, just out of curiosity what do you think about cherrypy? I guess you can say, it's a simple url to object/method mapping.

I don't dislike CherryPy - it's actually rather nice, and doesn't provide much beyond the "www.foo.bar/blah" calls this python function/class named "blah" - which would allow for some templating language for the output (Cheetah?) as well as SQLAlchemy integration.

However, I do feel that CherryPy is more restrictive than web.py - web.py uses the RoR Routes technique (I think Django does too), which allows for stuff like:

urls = ( "/.+bork.*$", "name_not_related" )

For some reason web.py seems to be the most 'pythonic' solution I've seen.  I do not like form.py but that does not have to be used when using web.py.

http://reddit.com uses web.py

Offline

#15 2006-03-06 21:02:15

shadowhand
Member
From: MN, USA
Registered: 2004-02-19
Posts: 1,142
Website

Re: Django, RubyonRails or plain old ugly php?

I voted for RoR, even though I only know PHP.


·¬»· i am shadowhand, powered by webfaction

Offline

#16 2006-03-07 16:46:31

cmp
Member
Registered: 2005-01-03
Posts: 350

Re: Django, RubyonRails or plain old ugly php?

well web.py does indeed look very nice. but what's bugging me with web.py and cherrypy is, that they don't feel very object-orientated to me. you always have to rely on some obscure global variables, like cherrypy.response or web.input.
I guess, I would expect some type of context argument, like GET(self, context), wheras context let's you access cookies and GET/POST vars.
I guess you could also directly inject the context object into the local scope, but that doesn't seem very pythonic to me.

Offline

#17 2006-03-07 17:23:46

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Django, RubyonRails or plain old ugly php?

cmp wrote:

well web.py does indeed look very nice. but what's bugging me with web.py and cherrypy is, that they don't feel very object-orientated to me. you always have to rely on some obscure global variables, like cherrypy.response or web.input.
I guess, I would expect some type of context argument, like GET(self, context), wheras context let's you access cookies and GET/POST vars.
I guess you could also directly inject the context object into the local scope, but that doesn't seem very pythonic to me.

Without ranting too much:
a) "Object Orientation" is not the end-all-be-all programming paradigm

b) global variables have nothing to do with OOP - there is nothing that says "OOP means no globals", I mean, comeon, look at any java app with a "singleton" - typical java apps don't even use singleton's right, they use it as a glorified global variable.

c) Your example, expecting a param to a function has 0 to do with OOP.  What you're describing is called procedural programming and has been around since 1970.

d) Maybe it doesn't work that way internally - maybe the class you design is not a top-level object.  Perhaps the tree works something like this:

ServerClass
   RequestClass
      YourCustomClass

in which case, using a "global" request object is not really global - in fact, it's probably actually a singleton.

Typically, paradigms mix - as of late it seems alot of people are realizing that OOP isn't all it's cracked up to be, and are modifying the paradigm a tad.

Offline

#18 2006-03-07 17:52:53

cmp
Member
Registered: 2005-01-03
Posts: 350

Re: Django, RubyonRails or plain old ugly php?

well I guess oop was the wrong buzz-word, then it simply doesn't seem right to me, as every little bit I read about programming told me global variables are bad - avoid them. and I guess they are really bad, if you got multithreading with these frameworks relying on global vars you have to pull up some tricks to avoid confusion (I can't remember the appropriate term right now).

Offline

#19 2006-03-07 18:01:18

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: Django, RubyonRails or plain old ugly php?

cmp wrote:

well I guess oop was the wrong buzz-word, then it simply doesn't seem right to me, as every little bit I read about programming told me global variables are bad - avoid them. and I guess they are really bad, if you got multithreading with these frameworks relying on global vars you have to pull up some tricks to avoid confusion (I can't remember the appropriate term right now).

As I said, it's probably not a global variable - it is probably an instance variable specific to that web request - typically, you would not thread within a given request, as there's no point, but each request may be threaded.  In this case there is no syncronization issues due to threading because each is an instance variable.

edit:
checked it out, each 'ctx' object is created by the main server, and added to a 'threadeddict' class object - a threaded dictionary, specific to each thread.

Offline

#20 2010-03-18 21:29:32

pradtf
Member
Registered: 2009-06-10
Posts: 39

Re: Django, RubyonRails or plain old ugly php?

phrakture wrote:

I'd vote "None of the above", but it's not an option. ...

this post has made more sense to me than any of the other 'advertisements' i've seen out there!
i'll stick to doing things the way they were intended to be done.


in friendship,
prad

Offline

#21 2010-03-18 23:01:04

xelados
Member
Registered: 2007-06-02
Posts: 314
Website

Re: Django, RubyonRails or plain old ugly php?

That's an incredibly well-thought out post, phrak. No wonder you're our overlord! I agree wholeheartedly.

Re: form.py: I've been thinking about improving that module since I noticed it in my webpy adventure. It's horrid and needs a rewrite.

Offline

#22 2010-03-19 00:13:24

orschiro
Member
Registered: 2009-06-04
Posts: 2,136
Website

Re: Django, RubyonRails or plain old ugly php?

You might take a look at bottle, a small web-framwork written in Python. I love it. smile

Last edited by orschiro (2010-03-19 00:13:34)

Offline

#23 2010-03-19 00:29:40

sveri80
Member
Registered: 2008-11-12
Posts: 38

Re: Django, RubyonRails or plain old ugly php?

Hm, so many voting for RoR, a pity big_smile

Well, some time ago i looked at some frameworks (ror, django, turbogears, pylons), i created webpages with php and even plain old pages with html and css. I made a prototype of a larger multiuserwebshop with plone/zope, what i want to say is, i have some experience with the frameworks.

One thing of course is right, choose the right tool for the right job. When a customer comes and wants a simple site where he can edit content i go out and choose a nice CMS. Done. When a customer wants a geeky, nice site without any functions but a lot of stupid ajax eyecandy, i go out and choose a nice ajax library for him.

When i create sites i want to have least amount of time invested, pared with most available functionality. And this is there django comes in play for me.

1. Its set up very very fast (python setup.py install - django-admin startproject project and i can go and script my site).
2. I want to say its got the best documentation compared to RoR, Pylons, Turbogears and Plone (Dont know about php, i have not used it for a while). IRC and ML support are great!
3. It's automatical setup admin interface. Honestly, this saved already so much time for me that i really do love it.
4. It's small and simple addons, found everywhere on the web. Need a captcha at your form? No problem, go out and install django-simple-captcha, it takes at all like 5 minutes to use it. Need comments on your site? No problem, take django-comments. Need a webshop? No problem, setup satchmo (ok, for that it took me like 30 minutes, but it was usable after that time).
5. Phrak said that its useless to learn another database abstraction layer, but, uhm, i love it (I turned sql in university up and down, its not like that i dont know how to make sql statements, but Entries.objects.all()[0:5] is so nice, beautiful and easy, uhm, i dont know, i think it stands for itself big_smile)
6. The templating system, ok, some say its not that good, but i have not found out yet why. The big plus about it is the top-down approach. So you define a base.html with your layout (navigation, top, header, footer, ...) and then take another site foo.html which extends base.html. Oh god, i love it, really. Some days ago i tried out werkzeug and with it some templating engines, and uhm, as soon as i saw "include ...html" i felt like something is really wrong there. Yea, no more includes, never again!
7. Django is very flexible, dont like the templating engine? Choose another one. Dont like the orm? Choose another one. Dont like the admin interface? Go ahead and spend some weeks writing your own big_smile
8. Last but not least, python. All the programming logic is done in python. And with it you got all the power of python. Ok, i have to admit, i never dived deep into ruby, maybe it's great too. But for me, python is the scripting language number one.

I am sure i'd find some more advantages, but these are the biggest ones i think.

Last edited by sveri80 (2010-03-19 00:32:27)

Offline

#24 2010-03-19 00:32:03

Vamp898
Member
From: ドイツではまだ住んでいる
Registered: 2009-01-03
Posts: 866
Website

Re: Django, RubyonRails or plain old ugly php?

Offline

#25 2010-03-19 00:43:37

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 6,419
Website

Re: Django, RubyonRails or plain old ugly php?


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

Board footer

Powered by FluxBB