On 2013-10-16 17:37, Sean Kelly wrote:

I'm reasonably okay with dynamic languages so long as you can require a 
variable to be declared before it's used.  Those that implicitly declare on 
first assignment are a nightmare however. I once spent an entire day debugging 
a Lua app that turned out to be broken because of a typo in an assignment. 
Never again.

That can be quite annoying in Ruby sometimes:

class Bar
  attr_accessor :foo

  def bar
    puts foo # calls the getter
    foo = "asd" # declares a local variable
    self.foo = "foobar" # calls the setter
@foo = "barfoo" # bypasses the setter and set the instance variable directory
    puts foo # prints the local variable
  end
end

Bar.new.bar

Although I like that instance variables are not required to be declared.

--
/Jacob Carlborg

Reply via email to