Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
The Essence of Dynamic Typing (yokomizo.org)
11 points by pwpwp on May 3, 2012 | hide | past | favorite | 5 comments


Nice summary. Some extra commas would've helped.

But what I really often miss in this discussion (dynamic vs static typing), and also in this article, is that statically typed languages fundamentally allow for better tool support. With modern IDEs and refactoring tools being pretty powerful weapons, this has a major impact on programmer productivity.

Of course, there is no reason why some sort of refactoring / code inspection support can't be added to dynamically typed languages, but it's certainly more difficult to make, and more error-prone.

I believe that in the next decade, this gap will widen, and that because of this, some statically typed language will be the next hip language. The current IDEs are too Windowsy for many hackers' tastes, but there is no reason for this to be so. You can have a VIM-like tool with Visual Studio-like powers.


That's if you prefer tools like Visual Studio to tools like Squeak.

That is, if you prefer your tools to perform static analysis as opposed to allowing you to inspect and modify your system while it's running.


That's a fair point which I don't know how to counter well, mostly because I know virtually nothing about the Smalltalks of this world.

That said, how can you refactor your code while it's running? Also, is dynamic typing a requirement to get tools like Squeak to work? Or could it work equally well in statically typed languages?


A small example of refactoring running code is at http://www.youtube.com/watch?v=1kuoS796vNw

And a more lengthy example of writing tests first, letting the code fail, and fixing things in the debugger: http://vimeo.com/19591202

This is kind of like writing code that doesn't exist or doesn't work, and letting the type checker guide you through the things you need to fill in. The difference is that Smalltalk is actually executing your code, so you can see actual values rather than just type errors, and it will keep trying to execute your code while you change things.

It might be possible to do something like that with static typing, but I think the real issue is that most advocates of static typing wouldn't really _want_ to mess around with programs in inconsistent states in the first place.


Small light grey code on white background. You might want to change that.




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

Search: