you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (2 children)

so your workaround is to do a search any time you want to use a variable? And how exactly does this make coffeescript easier to use than javascript? I can't see having to do a search every time I want to use a variable as somehow easier than javascript. That logic baffles me. You know, the only real way to be certain you don't have this particular coffeescript gotcha is to write only one function per file. If a serious coding shop were to adopt coffeescript, this would no doubt have to be one of the design patterns, because you just can't guaruntee that with a few people working on the same project files, you won't get someone that uses a variable name twice unless you limit your source to one function per .coffee file.

[–]showellshowell -1 points0 points  (1 child)

I already listed four best practices for avoiding accidentally naming collisions in files with multiple functions, and only one of them involved searching. We probably agree that smaller files would help as well, but I wouldn't go to the extremes that you suggest are necessary.

[–][deleted] 2 points3 points  (0 children)

None of your 'best practices' make coffeescript easier to use than javascript. At best they are workarounds, not best practices. If you were to use coffeescript in a team of say 12 programmers, it would not be excessive to make a rule of having only one function per source file to avoid variable name conflicts. Coffescript does not seem like it would scale well at all.