News for hackers. Stuff that matters.
Re:Kidsruby - Learn Ruby for kids by jablan on Monday December 26, 2011 @03:11PM (#3393809)
Not trying to argue, just curious: what about Ruby you find surprising?
Re:Kidsruby - Learn Ruby for kids by nyellin on Monday December 26, 2011 @03:30PM (#3393862)
Off the top of my head (there is more):

* Floats are printed without rounding

* You can write x = foo unless foo but not x = foo if ! foo

Re:Kidsruby - Learn Ruby for kids by ddagradi on Monday December 26, 2011 @03:59PM (#3393922)
Floats are printed without rounding

Isn't that a good thing? I like knowing the real value I'm passing around. It does round...eventually (at 14 decimal places or so).

You can write x = foo unless foo but not x = foo if ! foo

This is incorrect.

Re:Kidsruby - Learn Ruby for kids by nyellin on Monday December 26, 2011 @05:38PM (#3394118)
I could have sworn I tried that a week ago and it didn't work. Thanks for the correction.
Re:Kidsruby - Learn Ruby for kids by getsat on Monday December 26, 2011 @04:54PM (#3394037)

  bash-3.2$ python
  Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) 
  >>> 1.2 - 1.1
  0.09999999999999987
Re:Kidsruby - Learn Ruby for kids by _genova on Tuesday December 27, 2011 @05:31AM (#3395377)

    >>> print(1.2 - 1.1)
    0.1