Re: nil != []
- From: Clint Checketts <checketts@xxxxxxxxx>
- Date: Mon, 30 Jan 2006 03:51:58 +0900
On 1/29/06, Alex Polite <notmyprivateemail@xxxxxxxxx> wrote:
>
> On 1/28/06, Stefan Walk <stefan.walk@xxxxxxxxx> wrote:
> > When you get used to it, it's quite handy. Some methods return integers,
> > and false values on failures. If 0 was false, you'd have to distinguish
> > between 0 and false/nil when checking for success.
>
Dynamic typing in Ruby also aids the use of false = false and 0 = 0.
In Java I can't suddenly say that my variable contains a 'False' value. I
would have to make my int = 0 and detect the rationale behind that specific
integer. Dynamic typing solves this because myVariable = 5 and later it can
equal 'false' when it really is false (rather than a
number that represents false)
-Clint
- References:
- nil != []
- From: Alex Polite
- Re: nil != []
- From: Matthew Smillie
- Re: nil != []
- From: Alex Polite
- Re: nil != []
- From: Stefan Walk
- Re: nil != []
- From: Alex Polite
- nil != []
- Prev by Date: my coding style
- Next by Date: Re: my coding style
- Previous by thread: Re: nil != []
- Next by thread: Re: nil != []
- Index(es):
Relevant Pages
|