6 ms·
What specifically about Ruby leads you to prefer it over Python? Are there better/more modules or is the language itself more expressive or powerful in some way
by jknupp 17y ago
What specifically about Ruby leads you to prefer it over Python? Are there better/more modules or is the language itself more expressive or powerful in some way?
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.
- jrockway 17y agoI think you will basically have the same programming experience with any one of Perl, Python, or Ruby. It is a matter of personal taste, really.
- gte910h 17y agoUh no. 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.
- jrockway 17y agoHorrible code is horrible. That has nothing to do with Perl. There is indeed a lot of terrible Perl in existence. But new Perl code is quite nice I can use two modules and reasonably assume that they don't both make conflicting changes to the global class hierarchy. In Ruby... not so much, at least if you are using Rails. Did you know that Perl 5 looks like this now? http://blog.jrock.us/articles/Multimethods.pod http://blog.jrock.us/articles/Multimethods.pod
- jrockway 17y agoBlah, bad editing. Insert a period between "quite nice" and "I can".
- gte910h 17y agoVisual basic CAN look nice. Its just the vast quantity of it doesn't. You are picking the people you're programming with when you pick a language. Lots of people do very dirty dirty things in perl, and while those exist in Ruby and Python as well, proportionately they are much fewer in number there.
- gte910h 17y agoRuby is cooler, python is cleaner. 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).
- EvilTrout 17y agoI've had few problems scaling my Rails site up to over 2M requests per day. The "Rails can't scale" stuff is a myth. Good code, with proper techniques goes a long way.
- jhancock 17y ago"Rails is the bomb, except"... ...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.
- wheels 17y agoPython's object system really feels like it was an afterthought and its standard libraries are comparatively messy. The object systems feels a lot like using opaque types in C -- the notion of objects is a relatively thin, rather than deep abstractive mechanism. It also feels to me like it's overly explicit in the wrong places and lacking syntactic sugar in obvious places. 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.)
- jhancock 17y agoAs to ruby or python, I think its a matter of taste. Both are powerful enough. 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.
- deleted 17y ago[deleted]
- kgrin 17y agoIn general, Django is considerably more explicit about what it's doing (particularly after the "magic-removal" branch two years ago). The implicit trade-off is that some things that Rails does automatically you have to declare explicitly in Django, but it hits the sweet spot for me. 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.
- jhancock 17y agoRails has certainly become loads better. But the source is still cryptic to anyone but a ruby master. Rails 3 is in the works which is turning into mostly a full rewrite as near as I can tell. I expect Rails 3 code base to be much easier to understand. But that's not out yet and when it is, I expect you'll need to wait a year before enough of the libs and plugins are running smoothly. It sounds like you have enough python under your belt and like django well enough. I'd recommend going with that. Your not missing out on some other framework/language pair that is more powerful. I use ruby/merb. I occasionally look around for something I like better but nothing is worth the switching costs at this point.