News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Lars Tesmer's Blog:
Learning Ruby Gotchas and Pitfalls for PHP Programmers
September 14, 2011 @ 09:48:42

Lars Tesmer is currently in the process of learning Ruby. He' been working through the tutorials and some sample scripts and has come across some pitfalls along the way. In his latest post he shares four of them that've stood out in his development so far.

I'm currently learning Ruby. In this post I'll list some pitfalls for programmers coming from PHP that would probably cause some confusion if you aren't aware of them. This list is by no means complete, while I learn Ruby I'll very probably encounter more gotchas, which I will blog about, too.

For each of his four examples, he gives the code PHP developers are used to seeing and the Ruby code that may or may not do what you'd expect:

  • Arrays are continuous
  • Zero is not falsy
  • The keywords private and protected
  • There's no static keyword
0 comments voice your opinion now!
learn ruby pitfall gotcha programming language common


blog comments powered by Disqus

Similar Posts

Dagfinn Reiersol's Blog: Real programming with PHP 5.3 (part 3): Links

PHP.net: PHP 5.4.19 and PHP 5.5.3 Released!

PHP.net: PHP 5.4.34 & 5.6.2 Released

SitePoint PHP Blog: Can Great Apps Be Written in PHP - An Interview Series

RefreshinglyBlue Blog: PHP vs Ruby - Practical Language Differences


Community Events





Don't see your event here?
Let us know!


language composer interview voicesoftheelephpant security symfony community conference series version opinion library list introduction release tool framework podcast artisanfiles laravel

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework