News for hackers. Stuff that matters.
Re:Python programming is drowning in red tape by koonsolo on Wednesday April 15, 2020 @09:55AM (#22877714)
I care about writing clean and simple code in an easy way. I found that the node ecosystem with npm packages allows me to do this very well.

I had that same feeling in the 2.4-2.5 days of Python. But now it was really hard to find simple API's.

Let me give you an example about parsing JSON. This is the Python way:

json.load(fp, , cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, kw)

Seriously, how F(&#$%@ING complex can you make the thing?

This is Javascript:

JSON.parse(text[, reviver])

Ah, that's the way I like it :)

But hey, if you want all that argument power, no problem for me. I'm a simple programmer, liking simple things. And that was my point, Python has lost its simple ways. The JavaScript language might have some weird shit, but I don't care about that because I can stay far away from it. I care about simple programming.

Re:Python programming is drowning in red tape by Cpoll on Wednesday April 15, 2020 @10:27AM (#22878092)
> json.load(fp, , cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, kw)

It looks like you copied that from https://docs.python.org/3/library/json.html

Those are all optional parameters, if you don't need them it's just:

json.load(fp)

Which, to the best of my knowledge will behave just like the JS version.