5 ms·
Actually the ruby would just be "if myvariable" - I think it's more readable simply because it expresses the minimalist core of what that line of code is doing.
by crayz 16y ago
Actually the ruby would just be "if myvariable" - I think it's more readable simply because it expresses the minimalist core of what that line of code is doing. I could also use Blub and say "IfConditionIsTrue(myVariable.booleanValueOfNullStatus())"
Yes, you're right that my mental model of the 'if' construct will be basically the same in any language, but it's fundamentally less work and less error prone for me to translate ruby than some other language into that model, and the same is true going the other direction
- erikpukinskis 16y agoLet me just translate that post: include 'rspec' your_point.disagree do the_example.in_ruby = "if myvariable" me.think do this_thing(the_example.in_ruby).is(:more_readable) end.because do that_thing.expresses(the_example.in_ruby.what_its_doing.minimalist_core) end me.could do using "blub" do self.say "IfConditionIsTrue(myVariable.booleanValueOfNullStatus())" end end.implying do self.last_statement.is(:crazy_talk) end end your_point.agree do constructs = languages.map do |language| in language do me.mental_models.find_by_name("The If Construct") end end constructs.should be_identical end.with_caveat do languages.min do |language| in language do me.mental_models.find_all return me.mental_strain end end.should == "Ruby" end
- robconery 16y agoBrilliant! Except at the end... end.should be "Ruby"