G
G
Grag2014-03-10 21:24:45
Ruby on Rails
Grag, 2014-03-10 21:24:45

Why is RoR better than PHP?

Tell us how Rubby differs from PHP and what are the advantages of each?

Answer the question

In order to leave comments, you need to log in

12 answer(s)
Y
Yuri Morozov, 2014-03-10
@metamorph

RoR = Ruby on Rails is a framework.
PHP is a programming language.
That's all the difference.

R
rumkin, 2014-03-11
@rumkin

Most importantly, do not listen to this nonsense about the fact that everything is the same. Nothing like this! Ruby has a coherent philosophy, php does not. This is the only and main difference, which, for some reason, is considered uncritical (whereas ruby ​​became so popular). PHP began to develop actively, only after it felt the competition. And the main reason for this is that the proportion of amateurs in the php community is too high, and Ruby sets the bar high from the very beginning. I developed in both languages, I know what I'm talking about.
RoR is a web framework, so you can't compare it to a whole language.
But he is not alone in ruby, many applications are written for comfortable development, which are truly convenient to work with: Vagrant for managing VMs, Rake for executing tasks, Capistrano for deploying, Chef for managing configurations. You can read about the main features of the language in the wiki.
And so yes, and then, and then the programming language, you can continue to chew gum.

_
_ _, 2014-03-10
@AMar4enko

Wake up, there are so many copies of this broken on the Internet!
Look for any holivar to your taste and read.

A
Anton Kuzmichev, 2014-03-11
@Assargin

Wondering what to write on?
And apparently, you are not really in the subject yet, since you are confusing a framework with a language.
So, it's time not to sit in a puddle!
PHP has the only advantage in that, indeed, the market is full of vacancies and specialists (and "specialists").
But from personal experience - do not learn PHP, take better and really Ruby, or get out of Python - well, of course, if you choose ceteris paribus. There will always be a place for a cool specialist on the market, even though you write on Scheme.
Personal experience, by the way, is a terrible breakdown after switching from php to python (after 5+ years of coding). Maybe it's not normal, but it breaks from resentment for almost aimlessly lived years.

I
Ivan Starkov, 2014-03-11
@icelaba

For example, be guided by this
https://www.udemy.com/blog/modern-language-wars/
21% of employers are looking for a job as a php programmer
and 3% Ruby.
And be skeptical of @rumkin's ANYTHING unsubstantiated statements like this: "The biggest disadvantage of him is that the proportion of amateurs in the php community is too high, and Ruby initially sets the bar high"
Is there at least one study that proves that the average level of ruby ​​is higher intermediate level programmer of any of the languages? Believe me, there are no such studies. In my memory, this is the first language and framework whose programmers for some reason firmly believe that they are superior to others :-)

S
Sanes, 2014-03-10
@Sanes

Ruby == programming language
PHP == programming language
RoR == framework in Ruby
There are also plenty of frameworks in any other language. A framework is just a set of components, a semi-finished product.
You are comparing the framework and the PL, which is not correct.

S
Space, 2014-03-11
@ruslite

I think learn php. Understand how it works. And then judging from the topic, you do not distinguish two different things. @Assargin correctly said "There will always be a place for a cool specialist in the market, even if you write in Scheme." All languages ​​are good, depending on where the hands are from. Php just does not suit me in synchronous work. Therefore, I began to study nodeJs, but I also use PHP. PHP is shitting here, and the same node is around the corner, and something else is behind the next one. There are always those who are dissatisfied. But, to be honest, php is on a long journey. But again, it depends on your goals. And if you have not worked with any language yet, then start with JS, then pull php. As you understand more or less what's what, start learning the same ruby, Python. And if you master js well, you will also quickly master nodejs. Read more about this language.

D
Deerenaros, 2014-03-11
@Deerenaros

As already written hundreds of times, it is a bit incorrect to compare RoR and PHP. Another thing is Ruby and PHP, but even then with a stretch.
Ruby is a multi-paradigm language, that is, a language that supports many different (sometimes conflicting) programming paradigms (styles). The author may not have intended to make a cool language for web development. Accordingly, the built-in library is a little more extensive, but there are some things out of the box. However, ruby ​​is a whole ecosystem for developing and supporting projects, so this "stuffing" is very stretched - a couple of commands and the problem is gone.
PHP is a former templater for displaying dynamic web pages. Accordingly, its specification is much closer to web development. And despite PHP-Qt or phalanger,
It is noteworthy that both have a common origin - Perl. Although the first one was developed from scratch, many things were inspired by Perl. And you can feel it - that's why it suits web development so well. The second one grew out of a set of Perl scripts for displaying dynamic content.
Pros and cons... I'm not a professional in any of the ecosystems. However, here are my personal observations:
+ huge community from young to old, from amateurs to specialists; from here and a minus: according to the rule of 95% - 95% are amateurs, hence the very strange reputation of the Ilita.
+ excellent performance, of course, it cannot be compared with C ++ or Java, and it is also unlikely to be compared with .NET, especially with C #, but still the performance is at the level with the same Ruby or Python, besides there are a lot of tools to speed up code in just two gestures: kPHP (although a peculiar programming style is required), phalanger (the simplest integration with the .NET infrastructure and / or ecosystem will be a bonus) and others.
+ incredible popularity with employers - PHP programmers are probably the most in demand in the IT industry, partly because they have to weed out a lot due to severe incompetence, partly because it is very easy to start and viral marketing works for everything; funny, but this is the first EP that I heard about.
+ an html-template built into the PHP syntax, although, it seems, it's bad manners to use it =/ well, or there is a whole rite of its use, honestly - I still don't understand.
- there is no single design or guidelines, so development is akin to free flight - while you are flying, everything is fine, but if there is no parachute, falling is painful, if not fatal.
- it did not immediately become a programming language, so there are certain rudiments that are not very pleasant.
- far from the most concise notation, still use C-style, so gracefully mutilated by an incredibly large number of dollar signs that it is sometimes very difficult to read PHP code, especially for a person who rarely sits down at it (at the same time, python code can be read even by a person who rarely programs at all, with only minimal comments on particularly sugary places).
- personal hostility, it is not clear what is connected with.
+ incredible and very strong community: I personally have always been helped and guided to zen.
+ chic magic, inaccessible to mere mortals (the language is incredibly sugary, and at the same time everything is very concise, it’s quite difficult to write shit code in it, while the language provides plenty of opportunities)
+ a very strong built-in library, probably having the ability to almost all occasions.
+ very, very laconic notation, all the best from C, Pascal, Python, Perl and Smalltalk.
+ the same about other aspects of the language: performance (in 1.9 it was very much raised), power, conciseness, OOP.
+ finally, a chic ecosystem: these are rake, capistrano, gems and others, development is very simple with them, and they come in many linux distros in one package, and similarly for Windows with macos: you can assume that out of the box.
- ​​a huge amount of magic: without a [stroked]crab[/stroked] magic wand
and one hundred grams of [stroked]vodka[/stroked] mana elixir you can't make out.
- idiosyncratic style of the code: although it is concise, some things are not obvious from a swoop.
- up to 1.9, it lost to everyone in performance, even to turtles ala 1C-bitrix, although it worked more stable than many.
- to some extent an imposed ecosystem - if you are used to sawing your bikes for every sneeze, at first there will be a strange mixed feeling of comfort and discomfort.
A few words about Ruby on Rails. This is the wildest framework. The largest framework for ruby. Perhaps it was with him that ruby ​​gained incredible popularity.
+ uses all the strengths of ruby ​​and tries (tried) to disguise the shortcomings.
+ At first, there was the widest freedom of action, comparable only to PHP, which is actually bad, but gives a certain feeling of flight.
+ in a place with freedom, there was still discipline, now it has come out on top.
+ if you follow all the rules and best/good practice, you can achieve incredible results both in labor productivity and in the quality of work (read product).
Cons... I don't know. I didn't look for cons.
This answer is far from complete because I don't know of any similar PHP Framework. I heard that they exist, but I did not have a chance to work with them.

K
Konstantin Kozhin, 2014-03-10
@kkzhn

In the context of the question, the answer may be this... Compare:
PHP - parts for assembling a car from scratch
RoR - a car assembled according to a specific drawing that can already drive, but it does not yet have various convenient and necessary options.

D
dexdev, 2014-03-24
@AdilA

In vain you raised this issue, this is a very painful topic, ruby ​​vs php, try to pee on that and on this, and choose what you like best, ruby ​​is more difficult but there is less code to write and it is truly beautiful, ruby ​​code is easier to read if you wrote it not you, and if you understand what’s what in the language, and it’s faster to write in it, if everything is BDD TDD DRY, php is a little easier due to the fact that there is a lot of information on it, a lot, and it’s more flexible, it’s easier to shit code on it. but it is very difficult to understand someone else's code, sometimes it is not even possible. Both are very good two languages! But if you need speed, then choose ruby, though you will pay with slowness of the site)

I
iammultic, 2016-03-09
@iammultic

Why are you confusing a person with abstract comparisons ??? I wrote on all three and even more. And I can tell you exactly what the difference is. There are really no strict stylistics and rules in PHP. I have been fighting with one employee for several years so that he writes according to the rules. Because not only is his code an unreadable G, it's also full of holes. Ruby and python won't let you write like that. For example: in python, the style is embedded in the interpreter itself, I didn't indent it - like, the code doesn't work :-).... for comparison. Ruby has a strict OOP structure. Ruby is a true OOP, not like Python, or even more so PHP - add-ons that simulate objectivity. BUT... If we compare exactly web applications... then PHP still works faster. This is if it is correctly written in all three languages. It doesn't matter how much I haven't considered fashionable different OOPs... including C#, J2EE... php turned out to be the fastest and easiest for websites. And don't argue losers, try it first. But, under heavy loads, PCP is losing ground. Though here still much depends on pieces of iron and a DB. PHP is not suitable for console applications. Although nowadays it is not really necessary. Because in large corporations, as it happened historically, many applications are written in different languages, and already existing cross-platform tools help here. There is a sea of ​​them on the market. Migration, replication of data from different sources, APIs ... and then a simple display of data in the desired format on the site ;-). in large corporations, as it happened historically, many applications are written in different languages, and already existing cross-platform tools help here. There is a sea of ​​them on the market. Migration, replication of data from different sources, APIs ... and then a simple display of data in the desired format on the site ;-). in large corporations, as it happened historically, many applications are written in different languages, and already existing cross-platform tools help here. There is a sea of ​​them on the market. Migration, replication of data from different sources, APIs ... and then a simple display of data in the desired format on the site ;-).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question