News for hackers. Stuff that matters.
Re:JavaScript is not suitable for large web apps by mistercow on Thursday June 14, 2012 @06:52PM (#4113963)
>Great, so now the documentation for the function will promise to return a motorcycle, but instead return either a bunny or a toaster.

Not if you follow the second part of my above advice.

>There are lies, damn lies, and boilerplate code comments.

Since when is a comment that explains what a function does "boilerplate"? I think you are confused.

Re:JavaScript is not suitable for large web apps by MartinCron on Thursday June 14, 2012 @07:42PM (#4114166)
I've often had to work with code where the comments indicated an entirely different intention than the implementation. As a result, I'm a little paranoid and skeptical, that's all.

I also don't like the idea of having to comment each and every single function. If you have to write a comment to explain what it does, maybe you haven't named it properly?

Re:JavaScript is not suitable for large web apps by prodigal_erik on Friday June 15, 2012 @01:50AM (#4115243)
There are a few people who are cautious and methodical enough to specify all types in comments and keep them correct. But you need an entire team of them, because type comments which are only mostly correct would be worse than useless. And an entire team wouldn't choose a dynamically-typed language that makes those showstopper bugs more likely.
Re:JavaScript is not suitable for large web apps by mistercow on Friday June 15, 2012 @10:17AM (#4116592)
Well, if you're having major problems keeping the project's code and comments in sync, no compiler will save you.
Re:JavaScript is not suitable for large web apps by MartinCron on Friday June 15, 2012 @01:53PM (#4117746)
That's exactly how the compiler saves you. A strongly typed routine signature contract is a like comment that cannot get out of sync.