
Just over a month ago, I moved from PHP to Ruby. Now I want to somehow summarize this little experience and try to formulate the pros and cons.
It all starts with dating
The first thing I had to read was Agile Web Development with Rails. The book is revered for the Bible, but for my taste it seemed not the most successful. Although, perhaps, its main problem is obsolete. The main educational task of the book is to create a store. It is based on some rails from the 1.XX series (I do not remember exactly), which is quite irrelevant at the time of 2.XX. And the point is not that it is difficult for me to roll back to the old version, but rather that I absolutely did not want to understand the outdated approach.
Fortunately, everyone can see the
Bala Paranj screencasts on the topic of creating a Depot training store on rails 2.1.1. In addition, he has good screencasts and many other relevant rail topics.
Actually I got acquainted with Ruby on two things:
- a great thing
TryRuby , about which here already wrote
- fascinating comics
Why's - a book ambiguously accepted by the community, which I really liked.
Well, for dessert - the most important benefit (for me) on ruby and rails is
screencasts of Ryan Bates . Perhaps some of these screencasts (for a start, enough for 20) will be enough to evaluate and understand the rails.
')
Unfortunately, all of the above (except for the AWDR, which exists in translation) in English. But I think this is only for the better - an excellent daily practice will not hurt anyone.
Community
It turned out all very well.
Google group RubyOnRails to russian is a great place to solve any question [there they gave me answers to even the most Nubian questions without raising the tone, thanks to Max Lapshin;)]. In general, it is pleasant to read it - you learn a lot of useful things by reading the neighboring topics. Monday morning starts with a new screencast of Ryan Bates; on other days, I’ll read Google’s group). In general, Google groups have more than 1000 participants. In this case, the most venerable gurus there are not kichatsa to answer almost all the questions.
Ruby language
The language itself made an impression on me, as if I had moved from something like a Zhiguli to something with an automatic box, a comfortable lounge and stuff like that. Ruby was incredibly erotic;) language. In parallel, I had to wrap up with one PCP project and every day I felt more and more sensitive the failure between PCP and Ruby. Julik has been writing for a long time:
PHP code will never be so elegant (just because there is no design) .
You can always write in PHP the same as in Ruby - maybe even for the same number of lines :), but this is unlikely to be as elegant.
Rails
I have never worked with frameworks in PCPs - that's why I have nothing to compare with. In any case, it’s very pleasant to work with rails. Especially I write with boiling water from the organization of relations like has_many and others. Well, work with the database also causes a storm of emotions at first.
What is troubling:
- the same pile of files that is already in the project (and this is just the beginning).
- I want to somehow somehow navigate through the structure of the application. This is, of course, an IDE problem, but I would like to press a pair of keys to find myself in the corresponding controller from the model, or from the controller method to its presentation. In TextMate and E it is not = (
- everyone is talking about the brakes of the rails - I have not yet been able to evaluate, but subconsciously expect.
But in general, the MVC template itself organizes the work very well and corresponds very clearly to the stated design flexibility. How much I did not try to design applications like MVC (both on actionscript and PCP), then as a result, due to laziness and some errors, it turned out to be quite a porridge, remotely resembling the above-mentioned template. He is certainly not a panacea - but definitely better than a chaotic approach.
In addition, the rails have a large set of plug-ins (well, the ability to wrap your own) - this approach inspires me a lot more than the standard library of PCPs, which I wrote all the time, added and included =). In addition, a set of ready-made plug-ins is quite extensive and saves a lot of time.
Holivar
Git is better than subversion *)
Finally
Not that Ruby is better than everyone else - it's just more pleasant to talk