From: Marc Heiler Date: 2008-03-15T08:54:43+09:00 Subject: Re: What is Ruby's biggest strength ? > What helps Ruby stronger than other programming languages I cant answer the question in regards to rails, but I can give my point of view about Ruby. When I started with ruby, I needed something better than PHP, and less ugly than perl (actually, I was more productive with PHP than perl bacak then... I think perl is a "write once, dont maintain afterwards" language, and I cant stand this specific attitude. I think it is wrong. Code should evolve too, and for this to happen, people need to understand the complexity, and ugly syntax does not help to maintain it. And PHP's biggest problem is that outside of the www world, it just falls flat on its nose ... It is also ugly, though not as much as perl.) The question was - pick ruby, or pick python? Two factors made me choose ruby back then. - a) An interview with Matz. I normally do not understand people from the distant east, they seem to think differently :-) but the interview was one of the best interview as far as thinking "strategy" was concerned. I loved the concept of elegance, beauty etc... which I lateron found. It all seemed very natural. I also saw ruby being mentioned where a few people wrote a quick webserver in few lines of code, and I am naturally lazy so I like to write only few lines of code and achieve much, so back then I was very impressed with that ;-) - b) Ruby felt much more OOP back then, compared to python. I dont like a len(foo) approach, i think it does not fit into object concentrated thinking. I think objects should be in: foo.bar or foo bar I saw this first in LPC language where it was like so: sword->move(find_player("aramil")); to move a sword to the player object aramil (i.e. in a MUD) That was it back then for me. These days, I would give the following reasons for ruby: - Extremely clean code compared to the other languages I know/look at. It can become very terse at times, but this is not so bad as long as you know what is happening. And at least my code is beautiful! :D - Yaml (seriously, I think using Yaml was one of the best decisions every taken. I have moved all my system config stuff to yaml, and ruby generates all config files I ever need, no matter if xml or whatever is the end result. I no longer have to care if Linus thinks he needs to use udev rules, introduce UUID or HAL or SeLINUX or something - yes,yes, its not him doing so, but lets ignore that for now, its just that the Linux world adds complexity ... - I simply denote how my system should behave via the yaml files, and let a few ruby scripts generate the glue things. I have since then changed my approach to think about code AND data - i think the underlying data should be decoupled from programs completely. I use yaml config files for all my bigger ruby projects, hopefully every language out there will include yaml in their default library sooner or later, it is so amazingly useful IMHO, and it is a joy to modify a simply yaml file to have effect the ruby code base, without ever touching that code base) :-) Seems like a nice way to present a GUI solution to a user too, this way he can change the system using a few buttons and stuff, and doesnt even really need to open up an editor anymore - Its fast to write ruby code! - There is more than one way to do it. People might prefer python's approach to have only one way, and in theory this is good - i personally try to pick always the first way to solve something (or the best way, if i know about it) - but the problem is that, IF this way sucks, then you have no real choice to avoid it. The best example is case menu, which in python does not exist. But in ruby, I think a case menu is really really useful and beautiful. (Also i dont like the implicit self and __foo__ methods all over the place coupled with the : at the end of the line but ask guido why he thinks this is needed ...) And lets face it, in Ruby one has to make choices what to use, and what not to use. I was very appealed at the objects, but I didnt really need a lot of metamagic or proc/lambda magic. I still dont really feel the need to use it, others feel differently, but this is fine since I dont have to use it anyway :-) -- Posted via http://www.ruby-forum.com/.