3 ms·
> However, for puzzles where the data structures were straightforward, dynamically typed languages had me moving faster out of the gate." I don't understand th
by ummonk 4y ago
> However, for puzzles where the data structures were straightforward, dynamically typed languages had me moving faster out of the gate."
I don't understand this. I don't really encounter situations where the data structures are "straightforward" that type inference isn't able to handle on its own (or at most with explicit type specification for just a few variables).
- wink 4y agoNot 100% sure what's meant in this specific example but as someone who did advent of code a lot, there are truly benefits of an untyped python dictionary over anything in Rust or Java or C++. You can just put None next to your integers without having to wrap in Optional or even worse, a struct.
- still_grokking 4y agoYou can't compare Python to something like Rust, Java, or C++. Compare to for example Scala, that would make more sense.
- ummonk 4y agoJava and C++ don't have type inference. It would surprise me if Rust isn't smart enough to infer that the type of the dictionary is "Optional<Integer>" or "Integer | None". I haven't used Rust myself, but every language that I've used with type inference and algebraic data types will make this inference on its own.
- rowls66 4y agoRecent versions of Java have type inference.