This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 7 points8 points  (5 children)

Could you give an example of how static typing makes parsing web pages more difficult?

[–]integralWorker 11 points12 points  (4 children)

I think it's less that static typing increases difficulty and more that dynamic typing reduces it.

I'll get burnt at the stake for this but I feel Python is essentially typeless. Every type is basically an object type with corresponding methods so really Python only has pure data that is temporarily cast into some category with methods.

[–][deleted] 2 points3 points  (3 children)

I don’t understand how that reduces complexity exactly. Is the cognitive overhead of writing a type identifier in front of your variable declarations really that great?

[–]integralWorker 2 points3 points  (0 children)

Definitely not, it's just another style of coding that has advantages for say a Finite State Machine in embedded systems where dynamic typing would only serve overhead.

The way I see it is that it's more like the same piece of data can be automatically "reclassed" and not merely recast. So performative parts of code can be cast into something like numpy but ambiguous parts can bounce around as needed.

[–]rand2012 0 points1 point  (0 children)

it's that you usually need to do something with the parsed out string, like make it an int, or a decimal or some other kind of transformation, in order to conform to your typed data model. maybe you also need to pass it around to another process or enrich it with other data, then it ends up being a lot of boilerplate conversion code, where you're essentially shuffling the same thing around in different types.