mercredi 8 avril 2015

please prefix variable

def gdflib_stinsta(param,action)
  execute "actioninstanceparamappli" do
  action :run
  command "ls"
Function was a bit longer. here the bug if the use of the word "action" as a parameter for the function. It confuses with the langage (it is a 'chef' keyword
The problem I dislike in Ruby, as in python C Java and others, haskell, caml, is that the langage didn't require any prefix to variables. Perl and PHP require a $ (or @ or %). Ruby a bit too but not enough.
I says it's Bad.I don't understand how in a new langage you remixed variables (data) and langage (program). At a time where view, model, controller, data, events are distinct things. Even if data and functions are as variables in FP. 
Ok, this case it is a mix in scopes of local and (bah_ )"global" variables from chef, that should have generated a warning.

Aucun commentaire: