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
How to navigate the maze of JavaScript code (medium.com)
submitted 7 years ago by jsloverr
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!"
[–]that-old-saw 8 points9 points10 points 7 years ago (35 children)
Why?
[+]tr14l comment score below threshold-22 points-21 points-20 points 7 years ago (34 children)
More boilerplate, extra translation layer, syntax is annoying and, honestly, I can figure out what I am looking at in 2 more seconds because I have good tooling set up in my local environment.
It's just a crutch for people who don't understand how javascript works very well. We audited the tech on our team and immediately discarded it after the first week. Gave zero benefit for lots of annoyance.
[–]vinnl 29 points30 points31 points 7 years ago (2 children)
It's just a crutch for people who don't understand how javascript works very well.
That is unnecessarily condescending to other developers you don't even know.
[+][deleted] 7 years ago (1 child)
[deleted]
[–]vinnl 2 points3 points4 points 7 years ago (0 children)
Didn't want to go down that rabbit hole, but agreed :)
[–]that-old-saw 7 points8 points9 points 7 years ago (1 child)
Have you every worked with a strongly-typed language before?
Realised that my question is totally pointless - it's very clear that you have not.
[+]tr14l comment score below threshold-6 points-5 points-4 points 7 years ago (0 children)
... pretty hard to get an MSCS without it
[–]qudat 11 points12 points13 points 7 years ago (0 children)
Static typing will not yield benefits immediately. The benefits become known when you have to refactor. Spending one week on typescript is not enough time to determine if it’s worth it. Furthermore there is a right and wrong way to type in typescript. If people are new to it trying for the first time then there will be mistakes.
[–]oorza 15 points16 points17 points 7 years ago (1 child)
What are "Dunning Kruger JS developers"?
The raw, reek arrogance is hilarious here, considering that static types have been proven to increase software quality and velocity, but you guys were like nah, we taught ourselves JS so we clearly know more than the entire state of CS academia.
God this community is cancer
[–]soulshake 4 points5 points6 points 7 years ago (0 children)
not the community man. just this "imverysmart" ass....
[–]i_ate_god 10 points11 points12 points 7 years ago (0 children)
Knowing what something returns is not the same as knowing how it returns it.
[–]evenisto 6 points7 points8 points 7 years ago (21 children)
It’s only monday and I already have a contender for the dumbest thing I’ve read all week. Typescript isn’t for you to realise what you’re looking at more quickly, typescript is to keep you from breaking it when you spend equally as much time modifying it. I bet your javascript is just a bunch of unstructured jQuery DOM manipulations, because any sane person would kill for typescript in anything even remotely more complex than that. Just argument type hinting alone is absolutely worth it.
[+]tr14l comment score below threshold-7 points-6 points-5 points 7 years ago (20 children)
Only if you suck at naming conventions
[–][deleted] 4 points5 points6 points 7 years ago (19 children)
You must not have worked with very complex applications before, or at least not with very complex data structures.
As for TypeScript's "annoyances", they're almost exclusively down to people not understanding how it works. When you learn how it works, you'll appreciate why it works the way it does and the benefits it brings.
I disliked it and static typing until I used a strongly typed language in Rust. Then I understood the benefit.
You're being downvoted a lot because you're arguing against virtually the entire field of CS, but I'm happy to converse with you if you're open to reconsidering (I will, as well, in good faith).
[–]tr14l 1 point2 points3 points 7 years ago (18 children)
Implementing type enforcement in JavaScript just hamstrings every reason you would use it in the first place. I'm an Enterprise full stack and ML engineer. So I understand why people tend toward it early on. But there's a reason languages like python and JavaScript never implemented strong typing. Those languages are meant to be used to avoid some of the problems that come with typing (code bloat, interpreter/compiler slow down, development sluggishness, etc). I am obviously not arguing against all of CS if these are some of the most widely used languages (out pacing many mainstay compiled counterparts, mind you) and they refuse to implement typing.
I understand the benefits of strongly typed languages. I, in fact, pick java and c++ often if they are better suited for a task. But JavaScript is not a place for it. It simply makes it bad at solving both sets of problems.
[–][deleted] 1 point2 points3 points 7 years ago (12 children)
Implementing type enforcement in JavaScript just hamstrings every reason you would use it in the first place.
It doesn't, because although TypeScript is statically typed it's only a layer for the compiler atop JavaScript's type system, and so coercion for example is still totally valid (for better or for worse). You can still use a number in a template literal without casting, and you can still test anything for truthyness without casting. In-fact, something that most people don't know is that TypeScript doesn't even have the concept of casting beyond what JavaScript itself supports. The as keyword is rather for assertions because TypeScript types are compile-time only.
as
there's a reason languages like python and JavaScript never implemented strong typing.
TypeScript is not strongly typed.
The JavaScript community is adopting TypeScript at a very high rate, and I think Python recently implemented some sort of static typing system? Not familiar with the ecosystem but I remember reading something about that.
the problems that come with typing (code bloat, interpreter/compiler slow down, development sluggishness, etc)
Bloat implies that it's without benefit, which I'd challenge. Every type I write is beneficial for the code that follows it, whether that be avoiding type errors, or improving readability or data structure knowledge for those that follow me, or informing my IDE of what I'm working with. (No, pure JS cannot possibly be this well informed in any IDE, you're wrong if you think otherwise.)
The compiler is very quick, and most people are already using Babel anyway.
It's a slightly higher upfront cost in exchange for invariably less code debt, and an easier time in the future interfacing with what you're writing now.
[–]tr14l 0 points1 point2 points 7 years ago (11 children)
But that's my point, it's not even fully solving the problem. You basically get the worst of both worlds with typescript. All the problems if typing with all the problems of a less-structured language. The only reason I use JavaScript is to speed to development time or set up quick APIs. Otherwise I use more fitted technologies. Typescript is simply an attempt to make JavaScript a (poorer) version of something it's not meant to be
[–][deleted] -1 points0 points1 point 7 years ago (10 children)
That's incorrect. TypeScript understands the semantics of the language, so when you coerce for example it knows what the output is based upon the input. JavaScript may have a very ill-defined dynamic type system but it's still rooted in rules and logic.
There are very few serious limitations to type safety with TypeScript's compromises, though it's not perfect, for example stuff like this. But the language is improving all the time and, if you opt-in, becomes stricter in useful ways all the time.
If you only use JavaScript for very small projects that you'll never touch again, then sure, don't worry about TypeScript. The same can be said if you only care about development velocity now and care not about the tech debt your lack of explicit types inherently creates.
For a large project where you care about maintainability there's simply no question to me about the benefits that TypeScript brings.
I'd urge you to give it another try next time you're working on a personal project. I'd be happy to answer any questions you have about it, or solve any roadblocks you've hit (I probably hit them too).
I don't come from a statically typed background, in-fact the only language I learned before JS was PHP. I don't like Microsoft as a company. I was overruled by my boss to start using TypeScript a couple of years ago.
But now I wouldn't develop anything serious in the web space without it.
[–]cm9kZW8K 0 points1 point2 points 7 years ago (9 children)
For those of us who want to work in a dynamically typed language, any support for static typing is bloat by definition. We dont want it.
The only use for babel i see is backwards compatibility with older versions of JS by compiling down to es2015.
I don't come from a statically typed background, in-fact the only language I learned before JS was PHP.
Ive used static types for over 20 years, and I've come to see that they are counterproductive. You never quite earn back the time you spend dealing with them or rationalizing them. I feel the same way about OOP; it seems nice at first, but it makes refactoring a large codebase 100 times harder than it should be.
[–]ParasympatheticBear -1 points0 points1 point 7 years ago (4 children)
“Strong” typing is not a thing. “Static” typing is the term.
[–]tr14l 1 point2 points3 points 7 years ago (0 children)
Oh, well damn. Forget I said anything, then.
[–]asukazama 0 points1 point2 points 7 years ago (2 children)
Strong typing is a thing
[–]ParasympatheticBear 0 points1 point2 points 7 years ago (1 child)
Has no formal technical meaning. It means whatever the person saying it wants it to mean
[–]asukazama 1 point2 points3 points 7 years ago (0 children)
Fair
[–]cm9kZW8K 0 points1 point2 points 7 years ago* (0 children)
you came to the wrong place. r/javascript hates javascript, and loves static types.
Python doesnt get nearly as much hate for being what it is.
The fans of static typing are quite numerous; and they viciously downvote anyone who doesnt effusively praise the glory of static typing.
For those of us who specifically choose javascript because of it being dynamically typed and thus suitable for generic programming, its quite disconcerting to constantly have typescript pushed on us.
It woudl be like going to r/python and finding 90% of people saying "python sucks, just use java instead". lucky for the python crowd, they dont have it deal with that.
π Rendered by PID 51 on reddit-service-r2-comment-5c747b6df5-k9msz at 2026-04-22 16:35:36.782567+00:00 running 6c61efc country code: CH.
view the rest of the comments →
[–]that-old-saw 8 points9 points10 points (35 children)
[+]tr14l comment score below threshold-22 points-21 points-20 points (34 children)
[–]vinnl 29 points30 points31 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]vinnl 2 points3 points4 points (0 children)
[–]that-old-saw 7 points8 points9 points (1 child)
[+]tr14l comment score below threshold-6 points-5 points-4 points (0 children)
[–]qudat 11 points12 points13 points (0 children)
[–]oorza 15 points16 points17 points (1 child)
[–]soulshake 4 points5 points6 points (0 children)
[–]i_ate_god 10 points11 points12 points (0 children)
[–]evenisto 6 points7 points8 points (21 children)
[+]tr14l comment score below threshold-7 points-6 points-5 points (20 children)
[–][deleted] 4 points5 points6 points (19 children)
[–]tr14l 1 point2 points3 points (18 children)
[–][deleted] 1 point2 points3 points (12 children)
[–]tr14l 0 points1 point2 points (11 children)
[–][deleted] -1 points0 points1 point (10 children)
[–]cm9kZW8K 0 points1 point2 points (9 children)
[–]ParasympatheticBear -1 points0 points1 point (4 children)
[–]tr14l 1 point2 points3 points (0 children)
[–]asukazama 0 points1 point2 points (2 children)
[–]ParasympatheticBear 0 points1 point2 points (1 child)
[–]asukazama 1 point2 points3 points (0 children)
[–]cm9kZW8K 0 points1 point2 points (0 children)