4 ms·
Is there actual hard data out there that suggests that Python provides significant benefits over a statically typed compiled language? I’ve been thinking quite
by ilovecaching 7y ago
Is there actual hard data out there that suggests that Python provides significant benefits over a statically typed compiled language?
I’ve been thinking quite a bit about how it seems that despite how fun Python is to write the dynamic types are really just a determinant with upsides that are essentially anecdotal. Why would one take a performance hit and give up a type system without hard evidence that there would be significant improvements to other metrics?
- The_rationalist 7y agoDevelopper productivity is order of magnitude more important than performance on most software. Dynamic typing is by design more productive at first. Static type systems might allow better productivity on the long term (maintenability, scalability of à big, complex codebase). If this advantage of static typing is a myth, or a truth (and by how much does it increase average productivity, for which project size?) is a really interesting question and I don't know any scientific study on the topic. I did read a study that showed that static types catch only a few percentage of bugs and that practices such as systematic code reviews, documentation/comments, unit testing and integration testing, and methods such as TDD, each of them has a far bigger impact than static typing. (it would be nice if they had measured too the impact of fuzzing, analytics, debuggers and language features such as having a GC). This study does not say that using all those practices obscolete the need of static typing but it show the irrationality that many "purist/religious" developpers have by claiming writing a program in a dynamically typed language is a maintenance nightmare while not saying anything about enforcing the said practices despite them having empirically a far bigger impact on bug catching and thus "code quality".
- sethammons 7y agoHaving cut my professional teeth on php, perl, ruby, and python, I find no reduced speed working in Go. In fact, I think it is faster to develop in Go. The only time this is not the case is very simple run-once scripts where I don't need tests, and even then I'm not convinced that python is faster.
- deleted 7y ago[deleted]
- MadWombat 7y ago> Is there actual hard data out there that suggests that Python provides significant benefits over a statically typed compiled language? You are asking for hard data on a badly defined question. What kind of benefits are you talking about? Does learning curve count? Does speed of development and prototyping count? Does lack of build/compile cycle count? If I want to run analysis on some data or play around with a machine learning model or actually do any other "I just wanna see what happens" type of experiment, python provides a lot of advantages over a lot of other languages. If I want to create a simple set of REST style fetch-from-db-and-return-JSON APIs, python is great. There are other options, like Go and Node, but Python is pretty good. There are other scenarios like this, but these two are the first ones that come to my mind. I am currently working on a medium sized python project (about 25K LOC or so) and I am starting to think of rewriting some of the key pieces in a compiled, statically typed language for better performance and maintainability. But I feel that at this size and smaller I still have the benefits of quick development cycle.
- sethammons 7y agoAs someone who has been working in the _same_ python codebase for near a decade (off and on, it is an ancillary internal service with ~150k lines of code that does not get enough love), I speak from experience when I say that any service being maintained needs to have static typing. `def foo(bar)` - what _is_ bar?! What can I do with it? I either get to dig up and up the stack or pull out a debugger. Additionally, in python, you can iterate over a string or a list, so now you have to protect against both being passed in. Even this simple thing has caused many-o-bug in my experience. Half the tests are type validations.
- odiroot 7y agoThese sort of question is already getting nauseating. Appearing in every thread about Python. Different strokes for different folks, my friend.