Hi,
For-comprehensions could help you out:
for{
cookie - S.findCookie(cookieName)
value - cookie} doSomethingWithValue
Regards
On Mon, Nov 16, 2009 at 12:07 PM, DMB combust...@gmail.com wrote:
When I call findCookie it returns a Box. Then, the value on the cookie
itself is also a box.
I guess that could work, but why go to such lengths where there are
much more straightforward solutions available? What do for
comprehensions buy you in this case? I mean, 99% of the time, when I
want to check for a cookie, I don't need the cookie itself or any of
its properties. I need its
Whilst you may not see it as a big deal, proper use of the Box, Full,
Empty idioms really save LOC over time and you can start to write code
that is more functional in nature - for comprehensions are a neat
example.
I guess im saying try it, you might like it
Cheers, Tim
On Nov 16, 10:08 am,
Box ha a number of benefits over null -- type system enforced null
checks, stringing computations that can fail together in a safe
fashion, error handling, and so on.
Usually you only need to handle the case where there is a value and
map, foreach or for comprehensions are good for that.
On Mon, Nov 16, 2009 at 1:34 AM, DMB combust...@gmail.com wrote:
I guess that could work, but why go to such lengths where there are
much more straightforward solutions available? What do for
comprehensions buy you in this case? I mean, 99% of the time, when I
want to check for a cookie, I
As others may have said, the difference between a Box and a value that may be
null is that both may or may not contain what you want it to have; but in one
case the compiler lets you assume that it does--that it's not null--which is a
source of many bugs.
Programming presents a tension between
that it's not null--which is a source of many bugs
After a bold statement like this, one can't help but wonder how
programmers manage to ship software in all the other languages. :-)
Come to think of it, after working on a couple of pretty large ASP.NET
projects (~50 devs), I haven't once seen a
On Mon, Nov 16, 2009 at 9:01 PM, DMB combust...@gmail.com wrote:
that it's not null--which is a source of many bugs
After a bold statement like this, one can't help but wonder how
programmers manage to ship software in all the other languages. :-)
Come to think of it, after working on a
A refuting piece of evidence from the guy who created nulls. How cool is
that?! :)
On Tue, Nov 17, 2009 at 1:20 AM, David Pollak feeder.of.the.be...@gmail.com
wrote:
On Mon, Nov 16, 2009 at 9:01 PM, DMB combust...@gmail.com wrote:
that it's not null--which is a source of many bugs
Huh? I didn't say programs in other languages ship with bugs. But the bugs that
did have to be fixed include many that stem from NPEs.
Similarly, type safety in general helps keeps you safe from type mismatch bugs.
-
DMBcombust...@gmail.com wrote:
that it's
10 matches
Mail list logo