Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lodash, Ramda, TypeScript…? #8

Open
tripu opened this issue Sep 26, 2018 · 2 comments
Open

Lodash, Ramda, TypeScript…? #8

tripu opened this issue Sep 26, 2018 · 2 comments
Labels
documentation About best practices and recommended tools question Further information is requested

Comments

@tripu
Copy link
Member

tripu commented Sep 26, 2018

TypeErrors of all kinds are by far the most common RTEs in JS.

Using utility packages, or transpiling from a strongly-typed superset of JS, helps prevent them.

What are your thoughts on, and experience with, Lodash (classic), Ramda (cooler), TypeScript (heavier), etc?

@tripu tripu added question Further information is requested documentation About best practices and recommended tools labels Sep 26, 2018
@xfq
Copy link
Member

xfq commented Jul 17, 2022

The problems Lodash and Ramda solve are not the same as TypeScript/Flow.

TypeScript mainly solves the dynamic type-changing issues with JavaScript. Although Lodash/Ramda can solve this kind of issue to a certain extent, TypeScript can solve this problem better (but we should restrict the use of any).

TypeScript is also supported by many libraries and frameworks, like:

@ericprud
Copy link
Member

I don't have much experience with Lodash (mostly removing dependencies on it for functions like flatmap that js now offers) and none at all with Ramda (though I like the architecture). Given my limited experience, I'm not sure how they help you with TypeErrors (maybe their ubiquitous isX functions?).

IMO, TypeScript is a mild pain to set up, another mild pain to return to after you've swapped out, limits your potential contributors, but indispensable for large or complex projects. I tend to do either very small things (couple files in one directory) or very big things with it. On the small end, if you're trying to work through some algorithm , type-checking is a godsend. On the large side, I programatically ported a large-sh Java library to typescript, spent a couple weeks on the converter, XMass and New Years cleaning up the translated code, and a couple days tracking down the one bug that type-safety didn't catch for me (promise execution order, naturally).

For mid-sized projects, I find the overhead of futzing around with search paths and sprinkling tsconfig.json's everywhere too daunting and typically don't bother, even if I might have saved time by shifting effort from debugging to baby-sitting compile-time type errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation About best practices and recommended tools question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants