Hacker News new | ask | show | jobs
by jeremycarter 1365 days ago
Syntactically Python is great. Runtime though, its not. Its fast to code in - that is all.
1 comments

Agreed. I'm past the "it's like writing pseudo-code - so cool!" honeymoon phase and onto the "some sort of static typing is actually pretty useful" as a developer.
Good thing is that python3 provides typing.
Optional type hints are not the same at all.
No, its better. You can build the code first, test that it functions as expected, then add types, then compile it.

This is miles ahead of having to struggle with getting types correct in C++ before you even have anything resembling a workable solution.

I don’t get the struggle with types people have. It’s not hard to use a knife instead of a hammer to cut stuff. What’s the struggle with types, specifically?
Try teaching c++ to a new programmer and you’ll understand the struggles people have with types.

You might have forgotten, but you had head scratchers too when you where learning. Everyone has them. I’ve taught people who are absolute geniuses, even they struggled initially. And sure you get over it, just like people can become quite adapt at programming in esoteric languages like brainfuck, but that doesn’t mean there aren’t any better ways.

I don't disagree but I wish Python had builtin support for runtime type checking. I've thought about switching to Go or Rust for certain projects but Python's rich ecosystem makes it hard for me to switch, so for now I long for runtime type checking without needing an external library (e.g typeguard).
Very much agree. It's one thing I really appreciated about how php added type annotations. You didn't need them but once you added them they became a gaurantee.
You can check types at runtime in python. You can even check values at runtime. Heck you can check the weather at runtime if you like. What’s the problem exactly?
You can configure vscode to fail on typing problems and it will show errors in your editor