Comments on: truthiness in ruby /2015/12/truthiness-in-ruby/ Sarah Allen's reflections on internet software and other topics Fri, 06 Jul 2018 03:51:37 +0000 hourly 1 https://wordpress.org/?v=5.7.1 By: ultrasaurus /2015/12/truthiness-in-ruby/#comment-5314 Wed, 16 Dec 2015 10:03:22 +0000 /?p=5737#comment-5314 @MarmiteJunction @bgregmc nice clarification — I added to recent blog post on this topic: https://t.co/Mju8mKCEzC

]]>
By: Dan Wilk /2015/12/truthiness-in-ruby/#comment-5310 Mon, 14 Dec 2015 19:22:07 +0000 /?p=5737#comment-5310 Same behavior in Lua. Lua also likes to start numbering at 1, which is all I will say about that.

]]>
By: ultrasaurus /2015/12/truthiness-in-ruby/#comment-5308 Mon, 14 Dec 2015 13:13:05 +0000 /?p=5737#comment-5308 truthiness in ruby: https://t.co/oDZpTznFRI — an elaboration of why:
2.2.2 :001 > 1 and 0
=> 0
2.2.2 :002 > 0 and 1
=> 1

]]>
By: Dave Aronson /2015/12/truthiness-in-ruby/#comment-5304 Mon, 14 Dec 2015 11:53:39 +0000 /?p=5737#comment-5304 I usually just advise people to avoid and and or in the first place. Unless the reader comes from a strong Perl background, their usual usages (do_this and do_that where the latter depends on the former succeeding, and do_this or die(error_message)) just take Too Much Thinking to be maintainable. Their presence also tempts people to use them in calculating a boolean value. This is flat-out wrong if that value is then assigned into a variable. I cover this in slides 11 and 12 (currently) of http://bit.ly/RubyGotchas . Signed, The Codosaurus

]]>