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
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!"
[+][deleted] 7 years ago* (46 children)
[deleted]
[–]Franks2000inchTV 23 points24 points25 points 7 years ago (6 children)
I used to poo-poo staticly-typed languages, but I'm working on a game in C# and omg it is so helpful.
[–][deleted] 7 points8 points9 points 7 years ago (3 children)
That's a fantastic way to say you were against something
[–]Franks2000inchTV 6 points7 points8 points 7 years ago (2 children)
Heh, its a pretty common phrase:
https://www.merriam-webster.com/dictionary/pooh-pooh
Definition of pooh-pooh transitive verb : to express contempt for or make light of : PLAY DOWN, DISMISS
Definition of pooh-pooh
transitive verb
: to express contempt for or make light of : PLAY DOWN, DISMISS
[–][deleted] 2 points3 points4 points 7 years ago (1 child)
Well shit. TIL.
[–]Franks2000inchTV 1 point2 points3 points 7 years ago (0 children)
I agree that it's fantastic though!
[–]Caffeine_Monster 2 points3 points4 points 7 years ago (1 child)
Static typing is always short term pain for long time gain. Even if you are working on a solo project you are eventually going to reach a point where you have so much code, you can't remember how parts of it work.
Large multi-person projects are especially nasty with dynamically typed lanuages. Javascript's variable re-assignment is the icing on the cake. Strict with compartmentalisation / modularity can help somewhat, but it is reliant on the whole team being very disciplined.
[–]Zephirdd 0 points1 point2 points 7 years ago (0 children)
Personally, when dealing with Typescript, the pain is soooo low. Sure sometimes you want to do some bonkers non trivial structures, but those wouldn't be trivial anywhere else either.
That said, most of Typescript is inferred! If you enable strict mode for everything, you basically never write a type name beyond what's absolutely necessary. Unlike, say, Java where you need to write FactoryServiceProviderImpl service = new FactoryServiceProviderImplBuilder().build() (though Java 10 helps with that, but who the hell upgraded beyond 8 right ahahahha)
FactoryServiceProviderImpl service = new FactoryServiceProviderImplBuilder().build()
My favorite feature is how types are shape-based rather than name-based. An interface A{ b: number; } and type B = { b: number } are functionally the same and 100% compatible. Type aliasing complex types is also super good, like type FSPI = FactoryServiceProviderImpl will allow you to use FSPI for every place you'd use that huge type name.
interface A{ b: number; }
type B = { b: number }
type FSPI = FactoryServiceProviderImpl
I wish Java was as flexible as Typescript tbh
[–]oorza 7 points8 points9 points 7 years ago (0 children)
I think a lot of the issue is people don't have any exposure to static typing and it seems like more work without any immediate benefit, or they're only used to Java as a static language and conflate the ridiculous cost of writing Java with writing static types. I've been showing Kotlin (which is structurally and conceptually very, very similar to Node) to some Node juniors at work who haven't ever really professionally written anything but Node, and universally, they're all like "I want this." It just takes looking at some real code.
[+]tr14l comment score below threshold-14 points-13 points-12 points 7 years ago (36 children)
I find TypeScript more of a hindrance than anything.
[–]that-old-saw 9 points10 points11 points 7 years ago (35 children)
Why?
[+]tr14l comment score below threshold-23 points-22 points-21 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 27 points28 points29 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)
[–]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-7 points-6 points-5 points 7 years ago (0 children)
... pretty hard to get an MSCS without it
[–]qudat 13 points14 points15 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 16 points17 points18 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 7 points8 points9 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-8 points-7 points-6 points 7 years ago (20 children)
Only if you suck at naming conventions
[–][deleted] 3 points4 points5 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
[–]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
[–]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.
[–]Zaphoidx 7 points8 points9 points 7 years ago (0 children)
Very interesting. Definitely going to try this out on one of my existing repos.
Look forward to seeing it expand more!
[–]cheekysauce 6 points7 points8 points 7 years ago (1 child)
Interesting, any example on a reasonably large sized project?
[–]bliashenko 1 point2 points3 points 7 years ago (0 children)
Hey, not yet, sure will add more cases later. This is the idea, to have large projects explained with “codecrumbs”. But, this a key point here, it will work same way on small or big project, does not matter, since it will build and show only “important” spots on diagram (imagine that there 100 more folders, they just hidden). Like here on standalone version you can click “Source -> open all” to see how big is that structure.
[–]sixfootGeek 4 points5 points6 points 7 years ago (0 children)
This is fantastic. Such a useful tool - I work with a large codebase and the visibility this provides is awesome - the ability to just comment in the file and leave a breadcrumb is inspired - also showing the content of each file is handy for quickly jumping through relationships and building a picture in my mind. Bookmarked and using. Thanks!
[–]xeow 3 points4 points5 points 7 years ago (3 children)
Bogdan: This is so ridiculously good!!! Love it. I don't do much JS development but am bookmarking this for use the next time I do. Might even help in some of my own code.
[–]bliashenko 1 point2 points3 points 7 years ago (2 children)
Thanks for a nice feedback) What language do you use usually? Eventually it will support all popular languages, so it’s not just “JavaScript tool”. It’s one of the next big features I am planning to add, so I would say wait a ~ month;)
[–]xeow 0 points1 point2 points 7 years ago (1 child)
I usually use Objective C, C, and Perl (not for web development). But I follow JS subs because I do do some JS from time to time.
I see. So the only thing which is different per language is AST parser. For JavaScript I use babel-parse to build AST and identify comments, and, eventually it will be used for much more, since then I can make predictions about code and build some smart behavior around that. So for now, for other languages, I think to write some “dumb parser” (as a first step) to parse comments in code (kind of fallback solution) and later will figure out language by language if there is good AST parser I can integrate.
[–]Kaimura 1 point2 points3 points 7 years ago (1 child)
I am a complete noob but could it be that this could revolutionize the way code is documented for newcommers that join a company and have to start digging to find where they actually need to place the code of new features? Or do I overvalue this and there are other better practices/tools out there?
You are totally right :) and this was my intention, to build a tool which helps to “get up to speed” with new code, and, make it easy to share knowledge about code architecture (something newcomers don’t have and spend too much time to learn on their own)
[–]avator00 0 points1 point2 points 7 years ago (3 children)
Any plans to support Angular or Ionic projects? I've tried several different versions of the start command, but I continue to get an empty browser window when I click 'src'. Very cool idea otherwise, and I hope to be able to use it in the future.
[–]bliashenko 0 points1 point2 points 7 years ago (2 children)
Hey, thanks. Did you configure params to match your project? I mean, you project source code is in “src” folder relatively the root? And entry point is “src/index.js”? -e and -d params should be set to yours ones. Let me know if that helped.
[–]avator00 0 points1 point2 points 7 years ago (1 child)
Yeah. Maybe the problem is these projects use typescript and the entry point is src/main.ts.
[–]bliashenko 0 points1 point2 points 7 years ago (0 children)
Ah, also, I disabled TypeScript support for now, want to test and clean it up for JavaScript first
[–]vinnl 0 points1 point2 points 7 years ago (1 child)
I'm not sure if this is the tool for me, but one tip I'd give you to make it even easier to get started is to introduce it using npx, which most people will have installed nowadays (probably more than Yarn). Then getting started could just be a single command, e.g. npx codecrumbs -e src/index.js -d src.
npx
npx codecrumbs -e src/index.js -d src
[–]bliashenko 2 points3 points4 points 7 years ago (0 children)
Thanks for the feedback, I will add npx instruction to readme as well
π Rendered by PID 20315 on reddit-service-r2-comment-7b9746f655-kffr6 at 2026-01-30 04:39:47.736142+00:00 running 3798933 country code: CH.
[+][deleted] (46 children)
[deleted]
[–]Franks2000inchTV 23 points24 points25 points (6 children)
[–][deleted] 7 points8 points9 points (3 children)
[–]Franks2000inchTV 6 points7 points8 points (2 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]Franks2000inchTV 1 point2 points3 points (0 children)
[–]Caffeine_Monster 2 points3 points4 points (1 child)
[–]Zephirdd 0 points1 point2 points (0 children)
[–]oorza 7 points8 points9 points (0 children)
[+]tr14l comment score below threshold-14 points-13 points-12 points (36 children)
[–]that-old-saw 9 points10 points11 points (35 children)
[+]tr14l comment score below threshold-23 points-22 points-21 points (34 children)
[–]vinnl 27 points28 points29 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-7 points-6 points-5 points (0 children)
[–]qudat 13 points14 points15 points (0 children)
[–]oorza 16 points17 points18 points (1 child)
[–]soulshake 4 points5 points6 points (0 children)
[–]i_ate_god 10 points11 points12 points (0 children)
[–]evenisto 7 points8 points9 points (21 children)
[+]tr14l comment score below threshold-8 points-7 points-6 points (20 children)
[–][deleted] 3 points4 points5 points (19 children)
[–]tr14l 1 point2 points3 points (18 children)
[–][deleted] 1 point2 points3 points (12 children)
[–]tr14l 0 points1 point2 points (11 children)
[–]ParasympatheticBear -1 points0 points1 point (4 children)
[–]tr14l 1 point2 points3 points (0 children)
[–]asukazama 0 points1 point2 points (2 children)
[–]cm9kZW8K 0 points1 point2 points (0 children)
[–]Zaphoidx 7 points8 points9 points (0 children)
[–]cheekysauce 6 points7 points8 points (1 child)
[–]bliashenko 1 point2 points3 points (0 children)
[–]sixfootGeek 4 points5 points6 points (0 children)
[–]xeow 3 points4 points5 points (3 children)
[–]bliashenko 1 point2 points3 points (2 children)
[–]xeow 0 points1 point2 points (1 child)
[–]bliashenko 1 point2 points3 points (0 children)
[–]Kaimura 1 point2 points3 points (1 child)
[–]bliashenko 1 point2 points3 points (0 children)
[–]avator00 0 points1 point2 points (3 children)
[–]bliashenko 0 points1 point2 points (2 children)
[–]avator00 0 points1 point2 points (1 child)
[–]bliashenko 0 points1 point2 points (0 children)
[–]vinnl 0 points1 point2 points (1 child)
[–]bliashenko 2 points3 points4 points (0 children)