r/programmingcirclejerk • Software Craftsman • Dec 30 '17

Retiring Python as a Teaching Language because Javascript

http://prog21.dadgum.com/203.html
39 Upvotes

46 comments sorted by

View all comments

Show parent comments

24

u/Earhacker Code Artisan Dec 30 '17
const unjerk = require("unjerk");

That makes sense in JavaScript, though. I don't want my users to have to download the entire Lodash library just so I can shuffle an array painlessly. I should only have to require the minimum code necessary for that functionality.

In Python, who cares how big a library is? My users are probably only going to download and install my app once, and not every time they open it. I can import basically whatever I like.

11

u/[deleted] Dec 31 '17

JS needs a significantly more fleshed-out standard lib.

3

u/Earhacker Code Artisan Dec 31 '17

Most devs who use Lodash would describe it as JavaScript's missing standard library.

Python doesn't have a list.shuffle method right out of the box either, btw. You'd have to:

from random import shuffle

Neither does Java:

import static java.util.Collections.shuffle;

Only language I personally know of with a built-in, always available method for this is Ruby's Array#shuffle. And thank fuck not every language has a stdlib like Ruby.

17

u/Scriptorius lisp does it better Dec 31 '17

You're confusing standard libs with builtin/core functions. A standard library includes any functions/classes/libraries that comes bundled with the language. Just because you have to explicitly import it into the current namespace doesn't mean it's not part of the standard lib.

Python's random and Java's Collections aren't random 3rd party modules, they're worked on by the language's own maintainers. Lodash, on the other hand, is maintained by completely different people from the ones who work on the various Javascript runtimes. That's why you have to download it as a separate dependency (using npm or webpack or whatever) before you can require it in.