What about the lack of block-level scopes? Or the fact that constructors still "work" if you forget the new keyword, but they end up attaching functions/properties to the global object instead (which is pretty much never what you want to do)?
Dart is said to be dynamic because it has Optional Types when types don't even apply during runtime. I've said before that Dart errs on the side of static code declaration, because everything seems to be set in stone as declared and the Dart developers themselves have been striving to kill string as JavaScript knows it with events that are method calls instead like "el.on.click.add((ev) {});"
I just did a ton of renaming of private variables using the Dart Editor refactoring tool and I can't remember ever using refactoring like that. Despite some Editor glitches (it still is under develoment and is relatively slow as it's based on Java/Eclipse), I'm 95% done with the last class to go. My code barely used any type declarations, but as Dart is static like I said, the Editor could infer a lot and even warned me when some variable was a little outside of the scope of the change. I recently learned that renaming things is the #1 refactoring need of some folks, maybe of most folks? And it can be done very well in Dart despite the "unsound" types based just on static code declaration.
People say that the Closure tools are under-advertised. I recall about one year ago taking a look at their mailing list and it was a little too quiet there. Then again, the Dart mailing list seems to be very quiet this December. Maybe it's a coincidence, or maybe Microsoft's TypeScript announcement deflated the hype of Dart.
What I think is an important difference between Dart and Closure toolkit is that in Dart we don't have to code defensively for performance as much as can get used to in JavaScript. I'm still recovering from trying to be the optimizer for the JavaScript code rather than letting the tools deal with it for me.
Not sure the Closure tools can fix the code for you the way the bigger translation can from Dart. Then again, if you're coding to extract the max performance possible out of your JavaScript, then maybe you can take your luck in your own hands too.
I was getting addicted to running the JavaScript profilers. I was wondering how to run the profiler for Dart code still. Once the Dart code hits JavaScript, we have to trust that the code will do a good job on its own as it's then too late to change it much.
Maybe the Closure tools also try to optimize your code for you so you don't need to pull your hair out for every line of code? I think most JavaScript programmers get too used to writing optimum code. It's good to forget to do that when coding in Dart.
0
u/[deleted] Dec 15 '12
[deleted]