Skip to content

Instantly share code, notes, and snippets.

View fredlee's full-sized avatar

Fred Lee fredlee

  • @amountdotcom
  • Chicago, IL
View GitHub Profile
### Keybase proof
I hereby claim:
* I am fredlee on github.
* I am fl (https://keybase.io/fl) on keybase.
* I have a public key whose fingerprint is 89DC 17FA C291 FD91 302A 410B B4B4 E3DF 9235 7BC2
To claim this, I am signing this object:
@fredlee
fredlee / gist:714442
Created November 24, 2010 21:21
'and' vs. '&&'
# This is a contrived example.
# But, this simple example demonstrates some code I have seen where not understanding the difference
# between 'and' and '&&' has caused unexpected behavior.
# The intent is to evaluate the 3rd clause if the 1st and 2nd clause is true.
# Again, this is a contrived example.
# But, imagine that the 1st and 2nd clause is a method invocation or something like that.
# This is a classic example where the goal of terseness really caused problems.
>> x = 10 && y = 5 && x - y
require 'minitest/unit'
MiniTest::Unit.autorun
require './data_processor'
require 'yaml'
require './employee_data'
class TestDataProcessor < MiniTest::Unit::TestCase
def test_reading_first_employee