this post was submitted on 05 Aug 2025
111 points (98.3% liked)

Programmer Humor

37617 readers
96 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 6 years ago
MODERATORS
 

That's it. That's the meme.

you are viewing a single comment's thread
view the rest of the comments
[–] tetris11@lemmy.ml -4 points 1 day ago* (last edited 1 day ago) (15 children)

Yes, we should all use rigid types. Name me one language you actually like writing quickly with that has types?

Pyth-oh. Bash-oh. Lisp-oh. Perl-oh. Oh yeah... typed languages suck because of all the boiler

Edit: Fine, Python / Lisp / Perl are all technically "typed" languages, but I ask you what's point of throwing type errors at runtime. Javascript and Rust actually have it right here that the code is either going to run, or it simply isn't. No pussyfooting letting it run first to throw complaints

[–] alsimoneau@lemmy.ca 5 points 1 day ago (10 children)

Python. Don't know why you excluded it.

[–] barubary@infosec.exchange -3 points 1 day ago (1 children)
[–] alsimoneau@lemmy.ca 4 points 1 day ago (1 children)

It's not. It's a strongly typed langage.

[–] barubary@infosec.exchange -3 points 1 day ago (1 children)

"Strongly typed" is meaningless. (Or nearly so; in practice it means "I like this language" and "weakly typed" means "I dislike this language".) The point is that Python has no type system.

[–] alsimoneau@lemmy.ca 4 points 22 hours ago (1 children)

You're spewing nonsense.

There absolutely is a type system in Python. The fact that you have dynamic types doesn't preclude having also strong types and certainly doesn't mean you don't have types at all. Try to do 2+"a" in Python and you'll get a TypeError. The thing with Python is that values have a type, not variables. Because all variables are essentially pointers.

[–] barubary@infosec.exchange -1 points 21 hours ago (1 children)

Again, "strong types" doesn't mean anything.

But from a type theory perspective, having "dynamic types" absolutely means you don't have a type system. All Python has is runtime exceptions. The fact that one of them is named TypeError doesn't make it a type error in the formal sense.

The point of a type system is not that variables have types, but that types are assigned to expressions (i.e. pieces of code in your source file), not to values (i.e. pieces of data). This is important because it guarantees that certain errors cannot occur in a program that passes the type checker (assuming you have a sensible/useful type system). And you get this assurance without running a single line of code.

To get a similar guarantee from Python, you need to write exhaustive tests, just as with any other runtime error.

[–] alsimoneau@lemmy.ca 1 points 15 hours ago (1 children)

That's a very narrow definition of limited usefulness, and in practice it means your code is overly verbose and inflexible. You get stuck with polymorphism everywhere or you're explicitly converting data all the time for nothing.

Plus, if you try to process some data from an external source (which you have to if you want to do anything useful) you don't have any way to test if it's the right type before execution, so you're back at the same place that Python is, without the ability to cleanly recover.

[–] barubary@infosec.exchange 0 points 11 hours ago (1 children)

I believe now it is my turn to say you're spewing nonsense. Have you ever used a language with a type system? Because this whole idea of "testing external data to see if it is the right type" doesn't really make sense.

At the lowest layer, generally, external data is an array of bytes. It has no other type you could "test". However, you can decode or parse it into a form that makes sense for your program. And why couldn't I cleanly recover from parse errors? (And how do you think Python does it?)

[–] alsimoneau@lemmy.ca 1 points 3 hours ago

Clearly you've never programmed anything outside of theoretical computer science or heavily enclosed and controlled systems.

load more comments (8 replies)
load more comments (12 replies)