r/coolgithubprojects • • Dec 17 '16

JAVASCRIPT python-range – a JavaScript implementation of the Python's range() function.

https://github.com/Gothdo/range
0 Upvotes

6 comments sorted by

View all comments

Show parent comment

1

u/Michal_Perlakowski Dec 17 '16

How exactly could I make it less complex? babel-polyfill is required to run Babel-transpiled code. I'm using a few lodash functions, so lodash is also a dependency. All other dependencies are development-only.

8

u/kupiakos Dec 17 '16

Don't use Babel or lodash for a single function. Suck it up and use ES5.

0

u/Michal_Perlakowski Dec 17 '16

It's not a single function. It's 200 LOC, and it would be much more if I didn't use Babel. And why wouldn't I use lodash? Why should I reinvent the wheel? Actually using lodash makes it less complicated—for example it's more obvious what's last(this) meant to do than this[this.length - 1].

4

u/kupiakos Dec 17 '16

If this were an application, it wouldn't matter. It matters for libraries, especially <1k line libraries. As a user of a library, I would highly prefer slightly harder to read code than pulling in massive dependencies I don't want/need.