Hacker News new | ask | show | jobs
by falcor84 2586 days ago
{{citation needed}}

Your assertion reminded me of this funny dialog about JS: https://hackernoon.com/how-it-feels-to-learn-javascript-in-2...

2 comments

"pip install pendulum" is not complex.

Using pendulum is not complicated.

You can skim the doc in 5 minutes, your intern can do it too.

This is one of those tools that removes complexity when you use them.

Also, pendulum and the stdlib datetime module are compatible, making migration painless:

    >>> pendulum.now() - datetime.now(pendulum.now().tz)
    <Period [2019-05-26T16:57:35.872732+02:00 -> 2019-05-26T16:57:35.872141+02:00]>
In the end, pendulum doesn't requires you to install a transpiler, 100 plugins and create a configuration file like the post you link to. But it does save you from bugs, and you don't need to be an expert in time to use it.

I see only wins.

Just to be clear, I was not meaning to imply that pendulum isn't better, but rather that not everyone uses it. Nor does everyone use requests, although it's very clearly better than what's on the standard library.

Discoverability is a very big issue in general, and with these libraries in particular. I for example have been working with Python for almost a decade and follow the community quite closely, but can't recall hearing of pendulum before. Last time I investigated this, the cool libraries to use were arrow and delorean. How are people expected to keep up to date with every cool new thing?

> "pip install pendulum" is not complex.

For much of the work I do, there's a _big_ jump in complexity from using python (2 or 3) and its stdlib vs. requiring a library. A script using only the stdlib is easy to distribute and get working on developer, ci, and production machines. Once an external library is required, I need machinery or scripts to manage or ensure presence of those dependencies.

It's probably no good to you, but one of the reasons I like NixOS is the simplicity of creating single file scripts including dependencies. For example, something using Pendulum and ffmpeg together would start like this:

    #!/usr/bin/env nix-shell
    #!nix-shell -i python -p python pythonPackages.pendulum ffmpeg
Then you just put the code after that.
I love Nix and NixOS personally... but it's been a tough sell at work, unfortunately.

Even with simple shell scripts... it's so easy to invoke programs with GNU extensions and later find they fail on a co-workers macos machine. And I often have a shell.nix sitting right there that defines the complete dependency closure; very frustrating to not be able to use it.

OK that's pretty cool
It was compared to the linked article.

Besides, for time zones, you can't do otherwise: it's not in the stdlib. So compared to pytz, it's easy.

Unrelated, but I highly recommand pex for script with dependancies. It will turn it to a one file bunddle of all required modules, and all you need on the server is the same oython version.

It should be in the stdlib really.

Sure, IF you know that you should be using datetime ^D^D^D pytz ^D^D^D dateutils ^D^D^D pendulum.
That's true for absolutely everything in programming.
In other situations, flaws and enhancements to a library would be handled with new API/versions on that library itself. Not (an|a series of) entirely separate librar(y|ies). Big difference in discoverability.
And to solve hunger the best solution is to be able to eat. Yes.
I now have a deeper appreciation for front-end (front-line?) developers.