4 ms·
> Having a standard is more important... Let me take a shot at why it's important. We spend years peering at code hunting for tiny, miniscule mistakes. Thus w
by ben509 7y ago
> Having a standard is more important...
Let me take a shot at why it's important.
We spend years peering at code hunting for tiny, miniscule mistakes. Thus we're training ourselves, quite rigorously, to spot minor deviations.
We're also irrational in the moment: our aesthetic sense is bothered by certain patterns, and our social sense wants to assign blame for this "wrongness" to individuals.
An auto-formatter removes a ton of deviations that don't matter, and desocializes the aesthetics.
This saves code reviewers time and stress and helps them focus on what actually matters in the code.
And it only has to save more time than it takes to run "pipenv run black" to be measurably worth it.
- epistasis 7y agoAgree 100%, except for a minor quibble at the end. I've tried a few small projects with pipenv and black recently, and though I love black, I'm still struggling to accept pipenv as good. It's so slow so often, and I can't understand why.
- ben509 7y agoI'm coming from managing virtualenvs with s*ty bash scripts on a complex application, so pipenv got rid of a ton of jank, even though it's slow and has issues resolving certain dependencies. I like it because I can document most maintenance tasks as "pipenv sync && pipenv run X" and they Just Work with exactly the library versions specified for that commit. But definitely look into poetry if you're packaging a library.
- epistasis 7y agoThanks for the suggestion!
- dumdedum 7y agoI have similar experience, pipenv is not bad but it's definitely not great. Personally I'm starting to use poetry in new projects and it's being great, much better than pipenv. Whenever I have time I want to migrate all my pipenv projects to poetry.
- Tenzer 7y agoI've previously profiled pipenv and found it to be slowed down massively due to launching pip for each package it was working on. Unfortunately the maintainers think the progress bar is more important than performance: https://github.com/pypa/pipenv/issues/2207 https://github.com/pypa/pipenv/issues/2207
- ben509 7y agoThat's interesting; they actually discuss the issue and talk about parallelizing it, but all you need to do is pass a requirements file to pip. It would be nice if pip could act more as a base tool and pass information back to a wrapper.
- meddlepal 7y agoI used pipenv on a few projects and my experience has been somewhere between "this is hot garbage" and "meh". I'm no longer using it for Python projects.
- AlexCoventry 7y agoTry poetry. https://johnfraney.ca/posts/2019/03/06/pipenv-poetry-benchmarks-ergonomics/ https://johnfraney.ca/posts/2019/03/06/pipenv-poetry-benchma...
- franey 7y agoI've been meaning to update that post to mention that Poetry has been releasing fixes and improvements more frequently than Pipenv. Poetry is great for developing packages, too. (Showing up in an HN thread is a neat little milestone for my blog and me. Thanks for sharing!)
- jimbo1qaz 7y agoI use poetry. It has bugs (`poetry install/add/update` treats git-URL dev-dependencies as end-user dependencies). I sent a bug fix and it was not merged for months. I now use my own fork of Poetry with this fix added.
- camel_Snake 7y agoIt's not you. There are plenty of people who dislike pipenv. Another commentor suggested poetry, which is what I favor when 'python3 -m venv .env' isn't appropriate.
- kissgyorgy 7y agoProbably because pipenv is the worst Python package manager ever.
- task_queue 7y ago> It's so slow so often, and I can't understand why. The Python community is victim to pipenv's creator's marketing and shoehorning, that's why.
- AceJohnny2 7y agoI'm saving your and cjbprime's comments for future reference. You've both perfectly expressed the benefit and contextual benefit of code formatters.