News for hackers. Stuff that matters.
Re:Announcing TypeScript 2.0 by FrancoDiaz on Thursday September 22, 2016 @05:15PM (#12560428)
If the code is well written...

In a good environment like you have in many Smalltalks...

No one who really knows how to write in a dynamic language puts stuff like that in typical code

That's the problem. You're talking about some hypothetical, Smalltalk environment, where some expert dynamic language programmers always do "the right thing".

Re:Announcing TypeScript 2.0 by qwertyuiop924 on Thursday September 22, 2016 @05:21PM (#12560470)
Okay then, but if you're not documenting your functions, which is the most important thing, you shouldn't be working on a large project with other people in any case.
Re:Announcing TypeScript 2.0 by mercurial on Friday September 23, 2016 @12:16AM (#12562265)
Documentation will not save you the day you decide to rename a function or change its signature. Static typing will.
Re:Announcing TypeScript 2.0 by Roboprog on Sunday September 25, 2016 @12:49PM (#12576084)
It depends on your tools. I refactor JS stuff in intelliJ from time to time, no big deal, at least for rename. (1)

OTOH, if you don't have plugins for things like Struts or Spring (faking the desperately needed dynamicism in config files), good luck safely refactoring your "static" typed Java (2). But once have "trained" your IDE where to look, you are back in business again.

1: it's easier to refactor JS if you restrict the scope of identifiers, of course. For starters, this means NOT naively making every function and variable in the global namespace and/or scattered in inline <script> fragments.

2: many other languages dragged into these discussions since there is some general philosophy of compile time vs runtime types discussed on this page.

Re:Announcing TypeScript 2.0 by qwertyuiop924 on Friday September 23, 2016 @05:36AM (#12563367)
...No, it won't. It might make the refactoring a little easier, but with various tools, you can check all the call sites and see if you fixed it. Sure, your compiler won't tell you what's wrong, but your REPL and your tests will.
Re:Announcing TypeScript 2.0 by FrancoDiaz on Friday September 23, 2016 @08:43AM (#12564106)
Yes, given enough time for enough manual work, and enough tests, and enough code review....

The whole point is not to have to do this stuff manually, which is very error prone. Ad-hoc REPL work, and tests are very likely to have missed something.

Re:Announcing TypeScript 2.0 by mercurial on Friday September 23, 2016 @11:14AM (#12565203)
Precisely.
Re:Announcing TypeScript 2.0 by mercurial on Friday September 23, 2016 @11:19AM (#12565241)
It will absolutely save you, because it will complain loudly about every broken call site and prevent the broken code from making it to production (assuming you didn't use any tricks with any). Tests may or may not help (I have yet to see a codebase with perfect test coverage).
Re:Announcing TypeScript 2.0 by stcredzero on Friday September 23, 2016 @04:44PM (#12567810)
Sure, your compiler won't tell you what's wrong, but your REPL and your tests will.

If a REPL and tests make you powerful, then a type system that doesn't drag you down and good tooling around that will only make you more powerful.

Re:Announcing TypeScript 2.0 by stcredzero on Thursday September 22, 2016 @05:32PM (#12560536)
That's the problem. You're talking about some hypothetical, Smalltalk environment, where some expert dynamic language programmers always do "the right thing".

No, I'm talking about a place I've worked, certain subsets of code in other places I've worked, code at customer's shops, and most of the standard library of Smalltalk.

True, I've also seen what can go wrong in Smalltalk. But in my experience, this isn't worse than what can go wrong in other languages, dynamic and static.

Re:Announcing TypeScript 2.0 by anko on Thursday September 22, 2016 @05:54PM (#12560664)
I think the argument is not "You can't write something maintainable in a dynamic language" - it's more like "Given the majority of projects, static typing would have helped readability".

Since in SDLC maintenance is like 80%, and most of the time code isn't written amazingly, it seems pragmatic to have static typing.

I love Dynamic languages as much as the next guy (Ruby and clojure are pretty great in my book) but in my career, I get my guys to write in statically typed languages.

Re:Announcing TypeScript 2.0 by stcredzero on Thursday September 22, 2016 @06:06PM (#12560727)
it's more like "Given the majority of projects, static typing would have helped readability".

Not so much readability. That comes mostly from good naming in Smalltalk, and thinking about, "What if I had to understand this through senders/implementors searches?" However, in my experience, it helps maintainability. In general, I didn't need type annotations to help me understand the system. Good Smalltalk is about message passing, so you understood the system through who sends what to whom. What I did experience a lack of, were 100% ironclad guarantees in a couple of instances where we needed to be 100% sure about something.

And yes, it is pragmatic to have static typing for the long term!