[-] Spott@lemmy.world 6 points 1 year ago

This isn’t an argument against the standard way of doing things, it is an argument to follow the xdg standard, and use xdg environment variables, rather than creating a new unconfigurable directory in $HOME.

[-] Spott@lemmy.world 1 points 1 year ago

Yea, it is losing the forest for the trees. Next should be taught as part of iterators and for loops. It makes sense there. It doesn’t really stand on its own much.

To be honest, I’m not sure why it is a built in function… I feel like saying that python calls the ‘next’ function of your class when iterating is enough. But maybe I’m missing something.

[-] Spott@lemmy.world 4 points 1 year ago

All ‘next’ does is call ‘next’, which is part of the spec for ‘iterator’s.

Iterables return iterators when ‘iter’ is called on them. So they don’t need to support ‘next’ natively, their corresponding iterator does that.

[-] Spott@lemmy.world 9 points 1 year ago

The value of cargo and go tools doesn’t come from the all-in-one nature of them, it comes from the official nature of them.

If something doesn’t work with cargo, it is a bug. Period. There isn’t any “it works with pip” back and forth arguing over whose fault it actually is (package? Or poetry/pipenv/pip-tools/conda/etc? This happened with pytorch a while ago, and I’m not sure if poetry and pytorch get along even now)

There also isn’t any debate over project files or configuration stuff — Pyproject.toml vs setup.cfg vs random dot files in the project directory — if you are a currently developed project you support whatever cargo supports and you move to support the latest format rather than dragging your feet for years (pyproject.toml has been the “next thing” for python since 2016! And is only finally getting widespread support now… 7 years later).

[-] Spott@lemmy.world 3 points 1 year ago

They are different though, and the article doesn’t go into why they are different, which I think is a major omission (though a common one in articles about this subject).

The difference is that lambda functions are late binding, while partial functions are bound when they are created. This can lead to all sorts of hard to find bugs when using lambdas that are avoided by using partials.

[-] Spott@lemmy.world 10 points 1 year ago

I think part of the problem isn’t just bad hierarchies, it is that they are so hard to fix.

Bad OOP code gets its fingers everywhere, and tearing out a bad hierarchy can be downright impossible.

Spott

joined 1 year ago