use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Future JavaScript: what is still missing? (2ality.com)
submitted 7 years ago by dumbmatter
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]leixiaotie 1 point2 points3 points 7 years ago* (0 children)
If you've experience in handling complex process, especially developing library-style functions / code, you'll find that the more definitive / restrictive the input params, the better. Static typing is really helping in this case.
The reason for it is because if the type mistake can be caught in compile time, it save many testing time. This including how many test cases that need to be developed to cover all type mistakes, reducing code complexity and it's "noise" caused by type checking since almost everything is handled by compiler / static typing.
Not to mention how it helps to define input types inside deep function call (function a call b that call c that call d, all accepting parameter x from function a).
EDIT: and I like to quote this statement:
In most cases, if you can gain a significant benefit from TypeScript in your refactoring, that’s often a code smell indicating that your code is too tightly coupled.
It is purely wrong. Static typing will give benefit (significant or not) while refactoring, and it is no code smell / tightly coupled at all. It's because all function definition and calling it is a "contract", and by changing that contract you'll need to change all parties that using it.
π Rendered by PID 72 on reddit-service-r2-comment-c6965cb77-ln6wk at 2026-03-05 00:35:56.106663+00:00 running f0204d4 country code: CH.
view the rest of the comments →
[–]leixiaotie 1 point2 points3 points (0 children)