I think that PHP is a lot harder than Ruby. Everything follows a general pattern in Ruby, but PHP is created by a group of people.
Example: PHP has something called "strlen". You use it to determine the length of a piece of text. There is also "str_repeat", which is used to repeat text. In str_repeat, there is a _ after "str", but there is no _ in "strlen". This makes it very hard to learn PHP, you have to remember every detail.
Please read this PHP code:
Code:
for($i = 0; $i < 10; $i++)
{
echo "hi";
}
This shows "hi" ten times on your screen (so you'll see "hihihihihihihihihihi"). The same in Ruby:
Code:
10.times{ print "hi" }
This code is (a) closer to normal english, and (b), shorter.
It's easier to learn because of (a), and easier to use because of (b).
If you want to use Ruby for web development, check out Rails. (watch the videos if you want some motivation)
Bookmarks