logoalt Hacker News

DanielHBtoday at 8:32 AM2 repliesview on HN

Languages like C and Go are so weak in the type system that it barely feels better than fully dynamic languages.


Replies

bbkanetoday at 2:53 PM

At least in C and Go, you can get structs where it's easy to reason about the fields.

In Python, a "class" is simply a dict under the covers and (by default at least) you can add attributes to it after definition (as well as things like properties). So it's difficult to reason about what the fields are at any given time. And that's assuming people USE classes! I've seen code where all the state is in one giant ever-changing dictionary and you have to pull out a debugger just to figure out what's IN the thing! God help you if you mispell a key!

Maybe you work with better quality code than I do, but I find Go's type system a lot easier to reason about than Python's.

show 1 reply
antonvstoday at 9:30 AM

I agree, I was referring to powerful type systems.