Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You don't need to do that. You just use a library.

  import { isArrayLike, values } from 'ramda';
  
  const a = [];
  const aIsArray = isArrayLike(a);
  
  const d = {
    a: [1,2,3,],
    b:[4,5]
  };
  const dValues = values(d);
Not to mention that a lot of the problems you mention have native solutions in ES6.

JavaScript is a very different language than the one people used to use 5 years back.



Which library? From where? Never heard of ramda, but I can tell you it's not standard.

Why should people use JS with a non-standard library when dictionaries come built into better languages?


The library is ramdajs.com and it can be grabbed from npm.

I do not agree that everything should be handled with standard libraries. It's better for these things to be modular and versioned, instead of them being pulled from a big bloated standard library.

The code clearly does what was being asked in a very simple and non-broken way.

Perhaps the issue here is that non-JavaScript engineers are used to kitchensink standard libraries and avoid mixing and matching to get the best experience the ecosystem offers.


You're building a straw-man there. A standard library can certainly be made to be modular and versioned. It doesn't have to be bloated for any reason whatsoever. This is Javascript - you can chop up your scripts however you want.

The problem with mixing and matching libs is that no two JS devs do it the same. Some will even re-build the same lib that has already been built by hundreds of JS devs because NIH.


You are the one that has built a strawman.

In your universe, engineers do not talk and accidentally decide to use two libraries that do the same thing within a project.

I work with JavaScript and I rarely see this happening.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: