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:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] magic_lobster_party@kbin.social 53 points 11 months ago* (last edited 11 months ago) (6 children)

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.

[–] cyborganism@lemmy.ca 14 points 11 months ago (3 children)

My brother. That's why you do unit tests.

[–] ryannathans@aussie.zone 21 points 11 months ago
[–] milkjug@lemmy.wildfyre.dev 7 points 11 months ago

But are you even a real programmer if you don’t test in production?

[–] magic_lobster_party@kbin.social 4 points 11 months ago (1 children)

I shouldn’t need to do unit tests for quick one off scripts

[–] Kache@lemm.ee 8 points 11 months ago (1 children)

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

[–] magic_lobster_party@kbin.social 3 points 11 months ago (1 children)

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.

[–] potustheplant@feddit.nl 4 points 11 months ago* (last edited 11 months ago)

Those support wheels are for your own (and apparently systematic) errors...

[–] nxdefiant@startrek.website 8 points 11 months ago* (last edited 11 months ago) (1 children)

You can solve this with git:

git gud

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.

[–] Johanno@feddit.de 6 points 11 months ago

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

[–] OpenStars@startrek.website 3 points 11 months ago (1 children)

Yeesh. I mean, perl would tell you about that immediately, I'm just saying... :-P

[–] Avg@lemm.ee 14 points 11 months ago (1 children)

Yeah, but then you have to use perl

[–] OpenStars@startrek.website 11 points 11 months ago* (last edited 11 months ago)

Using perl is not the problem, now trying to read perl code later? That's the challenge! :-P

load more comments (3 replies)