News for hackers. Stuff that matters.
Re:Why I don’t like Dynamic Typing by wpietri on Saturday February 25, 2012 @10:47AM (#3633155)
> Complaints like "refactoring" or compiler error checking however are the oldest FUD in the book.

What makes you say that?

First, I happen to have worked with this fellow before [Hi, John! Long time no see. Fun to come across your post here.] and I'm sure he's quite sincere.

Second, having spent a bunch of time lately in dynamic languages (Ruby and JS mostly), I do indeed miss the automated refactoring tools that existed for Java. It's really nice to be able to rename a method everywhere across the code base without worrying that something else got mangled. I also miss the magic documentation that a type-aware IDE can provide; I spend a lot more time digging through layers of code to figure out what a particular parameter is expected to be.

Not that I want to switch back; I agree that a language with strong type inference is the way to go. But man, I miss the tools.

Re:Why I don’t like Dynamic Typing by lucisferre on Saturday February 25, 2012 @10:56AM (#3633169)
Not saying he isn't sincere I'm saying it's a common misunderstanding that the improved refactoring and compiler errors are that valuable, that they alone can support a strong argument for static vs. dynamic.

There are generally very few situations where you have a single method from a single class sprinkled across an entire codebase for a good reason. That always indicates high coupling and design problems. There are even fewer reasons to rename a well designed method. Constant renaming and high-coupling are bad habits that seem to be commonplace when working in strictly static languages and yet they are known to be bad habits even there. At least dynamic languages discourage these anti-patterns. Not to belittle your friend, I found myself falling into these traps constantly when working in C#.

Honestly, what I'm saying is that these problems just are not nearly as significant in say, Ruby, as they are often made out to be by static typing proponents. It's a bit disingenuous to point to these trivialities as reasons why static > dynamic. If it were true then there would be little benefit in dynamic languages. Clearly there is.

Re:Why I don’t like Dynamic Typing by cageface on Saturday February 25, 2012 @11:12AM (#3633207)
After 10 years of programming almost exclusively in dynamic languages I'm very much enjoying the refactoring abilities of modern IDEs when I'm doing native mobile development. I rarely have to change a method across an entire code base, but the ability to rename a method or package name in half a dozen files with a single key press is indisputably not only a productivity boost but an encouragement to more extensive refactoring.

More generally, the ability of modern IDEs to manipulate code structurally, and not just texturally, has been eye opening for me.

Re:Why I don’t like Dynamic Typing by wpietri on Saturday February 25, 2012 @12:53PM (#3633408)
I agree that high coupling is bad. I strongly disagree about renaming, though.

The theory that you can get good design up front depends on having both a stable problem and a stable solution. Most places don't have stable solutions, because creation of software is usually an exploration of the solution space. (If you don't need to explore the solution space, that often means you should just buy something off the shelf.) Quite a number don't have stable problems, either. Some people have innovative competitors; others are doing startup-ish things.

As Keynes said, "When the facts change, I change my mind. What do you do, sir?" I think that applies to design as well, method names included.

Re:Why I don’t like Dynamic Typing by jmount on Saturday February 25, 2012 @03:23PM (#3633761)
Hi William!

I am reserving most of my replies for the comment section of my own blog, but I couldn't resist say hi to you. I am in fact sick of typing in type labels (so strong type inference is great, it is just finally becoming available to us masses).

Also I would like try defend refactoring. Those that don't think it is important have not seen it used well (there are a lot of trivial uses of refactoring). I remember pair programming with Brian Slesinsky (when the two of you were coaching). We wanted to change some deep functionality of the project. Brian slowed the moment down for a bit and then said something like: "we call this refactor method, then introduce this error here, fix it here and then call this last refactor to clean it up." He was definitely not only doing what the IDE supplied but thinking in a very deep way how to trick the IDE into correctly performing a big change it was not designed for.

Re:Why I don’t like Dynamic Typing by gruseom on Saturday February 25, 2012 @06:51PM (#3634254)
I am reserving most of my replies for the comment section of my own blog

I don't think you should post it here if you aren't prepared to discuss it here. That seems disrespectful to the community.

For example, I'd like to hear your response to this objection: http://news.ycombinator.com/item?id=3633596.

Re:Why I don’t like Dynamic Typing by jmount on Sunday February 26, 2012 @01:12PM (#3636211)
Not "unwilling to discuss it here," just trying not to post everything twice. Now as regard to that objection- I have also read that the empirical studies of defect rate seem to show that defect rate does not correlate with anything once you control for size (leading to the argument that you should decrease size at any cost). I haven't examined the studies or the nature of the code in them. My personal observation is that not all code bases are the same (even those with the same number of defects). Some code bases seem to have a brittle behavior where there is an unlimited reserved of subtle bugs that depend on particular circumstances to happen (so likely undercounted, so called mysterious crashes) and other code bases do not (they are rock solid). I don't think this is captured by just counting tracked defects (as a "mysterious crash" can one bug or many interacting). But, yes current industrial consensus is size is most important.
Re:Why I don’t like Dynamic Typing by gruseom on Sunday February 26, 2012 @01:42PM (#3636325)
Thanks for replying. "Current industrial consensus" isn't that size is most important - far from it, approximately nobody pays any attention to that. Programs are routinely built by slathering code and people are proud of how much they write instead of how little.

Yet it seems to be what the evidence is telling us.