Hacker News new | ask | show | jobs
by sgarland 42 days ago
> the fact that programs and websites are delivered by large teams, there are dozens of submodules that are often loaded even when not needed

Precisely this. We had an incident once where a CSV had a postal code field be interpreted as an integer by pandas, which of course results in stripping any leading 0s. After looking at what the code needed to do, I asked why they were using pandas in the first place, as it was literally just “read the CSV as-is into a list.” Guess what Python’s stdlib csv module doesn't do? Type inference.

Instead of replacing the unnecessary pandas import (which brings along a fairly heavy transitive chain) with stdlib, they added additional code and tests to ensure this wouldn’t happen going forward.

Some devs learn by trying. Others learn by reading docs. Most seem to learn by reading blog posts that use unnecessary 3rd party packages.

2 comments

It's called resume-driven-development. You can't add stdlib into your resume while you can pandas.

If there are no guardrails, loose quality control and nobody cares about performance - why should they replace current pandas with stdlib?

I naïvely assumed that avoiding being paged was motivation enough, but experience has disabused me of that notion. Time after time, “we’ll fix one more thing on our hacky, bespoke bullshit” has won out over “we will use boring, pre-existing solutions.” My favorite example was a team who built a load balancer / health checker for Postgres in NodeJS. Despite causing roughly one incident per month, I was never able to convince anyone that they should abandon their special baby.

I honestly don’t understand how it’s even helpful to put shit like that on your résumé. If I read that in an interview, my immediate question would be “why did you build this instead of using HAProxy / AWS NLB / etc.?”

Reason number 500 why I hate pandas with a passion. Just had basically the exact same thing happen at work
I have no problem with pandas (though polars is immensely faster, for those cases where it matters), just as I have no problem with numpy; what I dislike is people reaching for them for the most trivial of things that are already solved by stdlib. It’s even more irritating when they cite performance as the necessary reason, but they’re just passing data in a loop, negating nearly all the potential gains.