6 ms·
I'd write the code in Python (or indeed any sensible modern language). foo = {}
by cabalamat 16y ago
I'd write the code in Python (or indeed any sensible modern language).
foo = {}
- leon_ 16y agoand then you get an int instead of a string and your python app explodes. let's not start on "sensible modern" languages.
- cabalamat 16y agoYes, you do get bugs in Python due to variables being the wrong type... however the time it takes to fix them is vastly less than the time it takes to write the reams of boilerplate that Java requires (not to mention the cognitive overload caused by said reams of boilerplate). My ideal would be an optionally typed language.
- xyzzyz 16y agoWhat if you want to create an instance of other type of dictionary? {} works only for built-in dicts.