Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Having used many languages over the years, the biggest advantage I've seen to dynamically typed languages is that they're easier to learn.

Python and JavaScript are probably the most common "first languages" taught in school. The dynamic typing and lack of complex IDE, compilation, and build system make then easier to learn. Most founders only have a few years of programming experience. Most startups can't afford to hire anyone experienced. Given these constraints, using these languages makes sense.

Dynamic language aren't any faster in practice. You can write quick and dirty spaghetti code in anything. It's only the naive that consider building large, or potentially large, projects in languages without static typing and strong IDE support.

In time I've realized that dynamic typing doesn't give any real advantages. It allows you to reuse variables, something that should never be done. It allows you to put different objects in the same array without having anything in common, which also seems like a bad idea. What else do you get? The language still has types they're just not visible when your writing code. I would much rather have compile-time types so I can use auto complete



Having used many languages over the years, the biggest advantage I've seen to dynamically typed languages is that they're easier to learn.

I love Ruby because of its delightful standard library, its thoughtful syntax which makes manual refactorings easy, not because or in spite of its dynamic types.

I detest Java because of its verbose syntax, its love affair with XML, and because it isn't a good unix citizen. Not because of or in spite of its static type system.

I detest Javascript because of its non-existent standard library, its many, many design errors (slowly being fixed, I know). Not because of its particular type system.

All other things being equal, I would prefer my language of choice to have statically checked, expressive type system. Unfortunately, all other things have not been close to equal historically. Things are improving, and maybe these days it's possible to have your cake and eat it too.


In practice the Python language is so easy that you rarely have bugs related to types. And when you got it, you find it out pretty early.

Types are useful when you grow, but thinking that you can't do anything big and robust without it is ignoring all the people that actually do so.

Another thing is that the simplicity and power of Python leads to having a lot of libs that are actually clean and solid for a lot of stuff. If I need to create anything under 100000 vis/day, I'm 3 times faster than a Go or Java dev on the backend. Literally 3 times.

I also produce better results. With things like Django rest framework, I can get the same REST API, but all the edge cases will be way better handled, small error messages, multi type of auth, etc.

Those things exist because it's fast to code in Python. And yes, dynamic typing help with that a lot.

So yes, it's true I don't have as much code completion and I have to remember a bit more about the code, but it's an exchange I'm making.

When I want to scale up robustness, I use type hints with mypy and get a strong code completion on PyCharm.


3 times faster with zero proof? Java has similar REST frameworks, notably Jersey and Spring Boot. There's also the Play/Dropwizard crowd and Vert.x . Look at spring boot code vs flask, it's almost identical.

Java libraries, particularly those maintained by Google and other tech giants are some of the most solid code ever written. I doubt Python or any other language comes close to the quality of popular Java libraries.

I still don't see how dynamic typing helps with speed? Any Decent IDE will fill in the types for you so you don't even need to key then mostly


Actually develop in spring boot vs flask, and you'll see just how much faster it is to code in flask. Spring Boot has many peculiarities and boiler plate you have to deal with. Flask just works.

>I doubt Python or any other language comes close to the quality of popular Java libraries.

You complain about proof and then you throw out this line.


There is no proof of anything in any comments in this thread.


Hahaha yeah I just realized I've precipitated a classic flamewar, oops. I'll recuse myself from making further comments on this thread. :)


Couldn't have written this any better. Also add the need to write shed loads of "test code" in order to reduce the probability of runtime fatal errors that would have been caught by a compiler; and the fact that source code becomes very hard to understand and maintain due to lack of semantic clues from things like types and structure definitions.


Also add the need to write shed loads of "test code" in order to reduce the probability of runtime fatal errors that would have been caught by a compiler

People always say this, and I've never understood it. Can somebody provide an example of a test that you "have" to write in a dynamically typed language that you wouldn't with static typing? If you're referencing nonexistent properties, then any test that hits that line will fail, and such a test should exist regardless of whether you're using static types.


No, that's exactly the point: with a statically-typed language, you wouldn't need a test for a non-existent property reference. The compiler will choke on the bad reference, and any test that uses/references the module in which the code resides will fail to compile. In other words, just simply trying to compile the complete codebase serves as a baseline "type/sanity test". The compiler will simply not allow you to produce an application containing such code.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: