this post was submitted on 02 Feb 2024
549 points (100.0% liked)
Programmer Humor
854 readers
7 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I would swap Python with C++. Constantly dealing with stupid runtime errors that could’ve been easily captured during compile time.
Did you forget to rename this one use of the variable at the end of the program? Sucks for you, because I won’t tell you about it until after 30 minutes into the execution.
My brother. That's why you do unit tests.
And lint
But are you even a real programmer if you don’t test in production?
I shouldn’t need to do unit tests for quick one off scripts
What kind of quick one off scripts have large complex scopes where variable renames are difficult to track?
Besides, these days Python has great LSPs and typing features that can even surpass the traditional typed langs
Mostly number crunching and data exploration tasks. Just so I can make informed decisions about the data I got. I do this rarely enough so it hasn’t been worth for me to install all these extra third party support wheels.
Those support wheels are for your own (and apparently systematic) errors...
You can solve this with git:
Seriously though, writing a monolith of a function and not testing anything until you run it the first time isn't the way to go. Even with a compiler you're only going to catch syntactical and type issues. No compiler in the world is going to tell you you forgot to store your data in the correct variable, although it or a a linter may have helped you realize you weren't using it anywhere else.
Python was typeless. And it was common to reuse variables with different types of content.
So you at some point never knew what actually is within the variable you are using.
Using typing in python solve 95% of your problems of having runtime errors instead of compile errors
Yeesh. I mean, perl would tell you about that immediately, I'm just saying... :-P
Yeah, but then you have to use perl
Using perl is not the problem, now trying to read perl code later? That's the challenge! :-P