Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Re: ruby gotchas
Gavin Kistner
12/19/2006 10:58:00 PM
From: Mark Guzman [mailto:segfault@hasno.info]
> I've written up some ruby gotchas that have come up while using ruby.
> I'm wondering if there are any other gotchas that I should be
> aware of.
> The list is available at:
>
http://hasno.info/2006/12/14/ruby-gotchas-a...
A nice list. I don't think I can add any to that, because your list
largely seems to stem from what violated your personal expectations. For
example, I'm used to JavaScript and Lua where the logical AND and OR
operators (by their various names) do act as guards that return the
first value that answers the question, never 'producing' a boolean
value. Additionally, nil and false are the only non-truth values in Lua,
too.
One comment about your item #8 - you might want to mention that 1.0/2 or
1/2.0 *is* 0.5. Your wording implies (to the novice reader) that you
need to include 'mathn' for math to work properly.
1 Answer
Mark Guzman
12/19/2006 11:06:00 PM
0
Gavin Kistner wrote:
> From: Mark Guzman [mailto:segfault@hasno.info]
>
>> I've written up some ruby gotchas that have come up while using ruby.
>> I'm wondering if there are any other gotchas that I should be
>> aware of.
>> The list is available at:
>>
http://...
/2006/12/14/ruby-gotchas-a...
>>
>
> A nice list. I don't think I can add any to that, because your list
> largely seems to stem from what violated your personal expectations. For
> example, I'm used to JavaScript and Lua where the logical AND and OR
> operators (by their various names) do act as guards that return the
> first value that answers the question, never 'producing' a boolean
> value. Additionally, nil and false are the only non-truth values in Lua,
> too.
>
Yes, I should probably qualify it at the start. I'm coming from a
java/c#/c background and a lot of things stem from that.
> One comment about your item #8 - you might want to mention that 1.0/2 or
> 1/2.0 *is* 0.5. Your wording implies (to the novice reader) that you
> need to include 'mathn' for math to work properly.
>
Good point, I'll update it.
--mark
--
sic transit gloria et adulescentia
blog |
http://...
wiki |
http://wiki....
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: ruby gotchas
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password