Why my brain cannot work cope with rspec.
Dave Thomas wrote a blog post on the problem with english-like programming languages to which I totally agree.
At some point, I was writing things with HyperCard and I hated it. Ok, it was working, I could create stacks and I forever missed the background feature in FileMaker.
The problem was just the scripting language: it used too much of my small brain.
Say you need to compute
. This is how you do it with hypercard:
put the exp of x into c
And this is the ruby way:
c = Math::exp(x)
I really don’t like the part of my brain related to speech to interfere when I read code. Real phrases are full of emotions, stories, dreams, misunderstandings, pretty words, bad style. I don’t want this to mess up with code. I want to keep it for real life.
RSpec breaks my brain:
describe "(empty)" do it { @stack.should be_empty } it_should_behave_like "non-full Stack" it "should complain when sent #peek" do lambda { @stack.peek }.should raise_error(StackUnderflowError) end it "should complain when sent #pop" do lambda { @stack.pop }.should raise_error(StackUnderflowError) end end
Gaspard Bucher
comments