Re:Google SoundScript: faster OOP for JavaScript
by greggman on Wednesday February 04, 2015 @04:27PM
(#8999966)
You can write bad spaghetti code in any language. You avoid that with style guides, linters, and code review.
Re:Google SoundScript: faster OOP for JavaScript
by wvenable on Wednesday February 04, 2015 @04:32PM
(#9000011)
I don't see how strict typing couldn't fit at the end of your list as well.
Re:Google SoundScript: faster OOP for JavaScript
by greggman on Thursday February 05, 2015 @04:18AM
(#9002349)
It could but some of us have had the experience of massive productive increases in JavaScript over our decades of experience in statically typed languages.
And note I'm specifically calling out JavaScript. Other dynamic languages IMO haven't provided the same benefits because they're still following old models.
When you truly grok JavaScript and stop trying to use it like your other languages it really starts to shine. It's not perfect but it is different.
I've gone back and forth between dynamic and static and strict and loose in every combination and I don't find the dynamic/loose to be particularly freeing anymore. The problem is you can't really rely on anything. It doesn't so much as solve the problem that Crockford is talking about, it just moves it somewhere else. You don't have to refactor but you're going to end up with two (or more) different things that exist at the same time instead of one.
> Look at the mocking libraries for JavaScript. They're sooooooooo much easier to write than anything for classical languages because it's so easy to do in JavaScript.
This is a great point and it's a perfect example of the advantages and the horrors of the JavaScript model. A mock is supposed to be an object that does something completely different (typically nothing) but otherwise looks and functions like the real thing. Maybe just in one slight exceptional way. JavaScript makes this easy. But it also makes it easy to make those same changes outside of mocking and tests and that is just debugging hell waiting to happen.