Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Another dynamic language that's fairly similar to Ruby is Python. However, in the <a href="http://www.python.org/dev/peps/pep-0020/" rel="nofollow noreferrer">Zen of Python</a>, one of the rules dictates that "there should be one, and only one, way of doing something". This is a polar opposite to Ruby which allows so much meta-programming that there are essentially an infinite number of ways to do the same thing.</p> <p>That said, its somewhat ironic that up until Python 3.0 (aka: 3000) string and unicode values were different types. While it makes sense, people sometimes get into issues where they're converting between the two a lot to perform text operations.</p> <p>If you have a choice, I'd almost recommend using Python as your introduction to dynamic languages. There's nothing wrong with Ruby, but you may find you'll run into fewer situations where the "right" way to do something isn't totally obvious.</p> <p><strong>In response to PHP being dynamically typed:</strong></p> <p>PHP's type system is flexible, allowing types to be automatically converted based on what context they're used in. This doesn't actually make then real dynamic types, however. The language itself is mostly static and won't allow you to add attributes to objects at runtime, for example (at least, the last time I checked).</p> <p>Python, and quite possibly Ruby, are actually strongly typed, meaning you can confidently do type comparisons, and can't do PHP tricks like adding numeric strings to get a number. True dynamic languages also often allow for meta-classing where you can adjust the type of an instance or class, or add attributes to either, all at runtime.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload