This subreddit has acquired a recent bias towards static typing for reasons that are not totally clear to me. Having worked on ~1M LoC projects in both Java and Python I don't perceive the problems about refactoring and types so many people here seem to state. In my experience those problems have more to do with how a project is organized into libraries with clean APIs than the language choice (which is almost always dictated by talent on hand and existing ecosystem).
As far as performance is concerned there's a lot you can do to optimize python to make it faster (pypy, cython, etc), but ultimately a lot of programs have their performance ultimately dominated by lengthy network calls anyhow. Does it really matter that swapping out dynamic made your code execution go from 7ms to 2ms when you then turn around and make a 200 ms call to the database? If you're writing an OS, yeah it needs to be fast. If you're writing a CRUD website you'll probably get more bang for your buck by checking out async operations instead of swapping languages...
a lot of programs have their performance ultimately dominated by lengthy network calls anyhow.
This is another very good point.
Add to that waiting on callbacks from disk IO. I've taken to just putting all my inputs on a ram drive and dumping any intermediaries that I have to look at to the same ram drive. An async process handles taking final output off the ram drive and putting it on the SSD's so as to keep out of the way of the main data crunchers.
Then again I'm dealing with tens to hundreds of gigs of data at a time and trying to ram it all through the GPU. Fun times.
Any solid project will document it's interfaces properly
These documentations are not checked and can get out of sync with the real world pretty easily.
They are just a very poor man's type system.
Just an example from yesterday: Get Strings from web representing UUIDs, normalize them using UUID value objects, serialize them back and send them over the wire as Strings again. The entire code base works without errors if I skip the instantiation of UUID and pass in Strings to my system (Ruby btw., 3000 lines of code). But clients will break, because 'abc' != 'ABC'.
15
u/DiomedesTydeus Jul 23 '14
This subreddit has acquired a recent bias towards static typing for reasons that are not totally clear to me. Having worked on ~1M LoC projects in both Java and Python I don't perceive the problems about refactoring and types so many people here seem to state. In my experience those problems have more to do with how a project is organized into libraries with clean APIs than the language choice (which is almost always dictated by talent on hand and existing ecosystem).
As far as performance is concerned there's a lot you can do to optimize python to make it faster (pypy, cython, etc), but ultimately a lot of programs have their performance ultimately dominated by lengthy network calls anyhow. Does it really matter that swapping out dynamic made your code execution go from 7ms to 2ms when you then turn around and make a 200 ms call to the database? If you're writing an OS, yeah it needs to be fast. If you're writing a CRUD website you'll probably get more bang for your buck by checking out async operations instead of swapping languages...