3 ms·
JavaScript code is or can be extremely DRY. I have noticed this especially on a redux (inspired by Elm's architecture) codebase. The pitfall is that JavaScript
by the_gipsy 10y ago
JavaScript code is or can be extremely DRY. I have noticed this especially on a redux (inspired by Elm's architecture) codebase. The pitfall is that JavaScript is very unsafe and hard to read.
I've worked with TypeScript too, and there I started to notice more repitition and boilerplate, although IMO It is very well worth the safety.
- the_duke 10y agoJavascript is dynamically typed though. And Typescript has generics or circumventing the type system with :any to enable reusability.
- the_gipsy 10y agoExactly my point, dynamically typed means writing less boilerplate. At the cost of safeness and mantainability. TypeScript's any is more for compatibility with js libs though.
- boubiyeah 10y agoYes, in a sane codebase, you (almost) never use <any>. 98% of the time, if you type <any>, you're being lazy.