by Roboprog · 12y ago · 0 comments
With no variable declaration keyword (a la var, my, local, private), adding a variable assignment anywhere could radically change the variable scoping.
I'm done, this isn't suitable for prime-time, time to go somewhere else.
I spent too many years in the 80s working with xBase. I've been shafted too many times by calling a (coworker's) routine that forgot to declare its variables "private", which stomped over one of my variables. (private in xBase is similar to local in Perl 4) To have a language which doesn't let you declare the intended scope of a variable - ugh.
More generally I've found that coffeescript mixes much better with a functional style than with an imperitive one.
Generally the same kinds of problems I find with bad ruby/java.
changeValue = do ->
value = 42
lastValue = null
(newValue) ->
lastValue = value
value = newValue
That hides the new variables in a closure and they no longer leak to the the enclosing scope. This is cleaner code overall since you no longer have some variables at the top level where you can't be sure of how many functions are using them without searching.So does that mean Python and Ruby are out the window too? It's really never been an issue in either of the three languages.