257m@lemmy.ml to Programming@programming.dev · 1 年前What are your programming hot takes?message-squaremessage-square885fedilinkarrow-up1352
arrow-up1352message-squareWhat are your programming hot takes?257m@lemmy.ml to Programming@programming.dev · 1 年前message-square885fedilink
minus-squareTrustingZebralinkfedilinkarrow-up4·1 年前How is dynamic typinf faster? Is typing num = 1 instead of int num = 1 really that much faster?
minus-squareGaveUp [she/her]@hexbear.netlinkfedilinkEnglisharrow-up2·edit-21 年前It’s not just the physical typing It’s the fact that you can be extremely flexible with data structures and variables E.g. you can have a list of strings and ints in Python but not java
minus-squaremorrowind@lemmy.mllinkfedilinkarrow-up1·1 年前This is why union types are great (also sum types are similar I think, never used those)
minus-squarecolonial@lemmy.worldlinkfedilinkarrow-up1·1 年前Plus, most statically typed languages either do type inference by default or let you opt in somehow. Even Java, which is probably the reason everyone hated static typing for the first decade of the century or so, now has var.
How is dynamic typinf faster? Is typing
num = 1
instead ofint num = 1
really that much faster?It’s not just the physical typing
It’s the fact that you can be extremely flexible with data structures and variables
E.g. you can have a list of strings and ints in Python but not java
This is why union types are great (also sum types are similar I think, never used those)
Plus, most statically typed languages either do type inference by default or let you opt in somehow.
Even Java, which is probably the reason everyone hated static typing for the first decade of the century or so, now has
var
.