3 ms·
> The original post went deeper than that. If there was depth, I missed it. The only two points I got from it were 'I prefer static typing over duck typing' an
by mbell 10y ago
> The original post went deeper than that.
If there was depth, I missed it. The only two points I got from it were 'I prefer static typing over duck typing' and 'avoid dependency hell'. The original post didn't add anything new to either argument and both have existed and been rehashed over and over again for decades.
- blub 10y agoThe trick is to ignore everything until the "duck typing" picture including the picture. Then to pay attention to the last four paragraps.
- mbell 10y agoThere still isn't much there, and some of it is just unfounded. For example, while the author claims there are 'crazy levels of duck typing' in Ruby / Rails he provides no such evidence of it and as noted by recent work from Aaron Patterson the vast majority of calls sites even in a very large rails app are actually monomorhpic (https://www.youtube.com/watch?v=6Dkjus07d9Y https://www.youtube.com/watch?v=6Dkjus07d9Y). But more important than this cherry picked example is the complete lack of this type of technical discussion, which is why I find the post very shallow.
- collyw 10y agoAnd he didn't point out how any of his "todays languages" are any better at avoiding dependency hell.
- weberc2 10y agoGo statically compiles everything into a single binary. I'm not sure what is meant by "dependency hell", but this at least simplifies the runtime story.
- collyw 10y agoFair enough. He would have done well to explain that. Java does the same. Is it considered tomorrows language? At the end of the day its another trade off between compiled and interpreted languages, and one thats been around for years.
- weberc2 10y agoJava doesn't do this. There are tools that let you bundle all of your jar files, but even then, you typically have the JVM as a runtime dependency.
- pdkl95 10y ago> simplifies the runtime That has been a solved problem in ruby for a long time. Bundler[1] (or similar tools) does the equivalent of static compilation by copying[2] all of the dependencies into the project and statically loading[3] them. [1] http://bundler.io/rationale.html http://bundler.io/rationale.html [2] http://bundler.io/v1.12/bundle_package.html http://bundler.io/v1.12/bundle_package.html [3] http://bundler.io/v1.12/man/bundle-exec.1.html#ENVIRONMENT-MODIFICATIONS http://bundler.io/v1.12/man/bundle-exec.1.html#ENVIRONMENT-M...
- weberc2 10y agoI'm sure it helps, but you still have a runtime dependency on Ruby as well as something to unbundle the bundle. Maybe this isn't a big deal, but it's not as easy as a single static binary.
- deleted 10y ago[deleted]
- quetzthecoatl 10y agoalso, the image of a pig's face as electric socket while hilarious, shows how much the original author mis understood duck typing. It's not just look like duck, but also quack like a duck. Since when does a pig's nose behave like an electric socket? The idea behind duck typing is about concentrating on behavior instead of identities. He completed missed it.
- IshKebab 10y agoIt was just a funny picture. And besides, duck typing doesn't rely on things behaving the same. It relies on them appearing the same (in terms of method names). A pigs nose appears like an electrical socket in that it has holes in the same places. So actually it is a pretty accurate picture. That said, I don't think duck typing is Python's biggest problem. Go sort-of has duck typing, in that you can make a type implement an interface just by giving it methods of the right names. It's a bit safer because you have to specify the 'ducks' though. It's kind of static duck typing. Rust gets it totally right. But anyway the dynamic typing is a far worse issue than duck typing.
- geebee 10y agoA language with more strictly enforced interface inheritance would probably require a more, uh, deliberate intent to stick an electrical outlet into pig's snout, but you could probably still go ahead and do this if you were really hellbent on it. I will concede that duck typing allows you to do this sort of thing more casually, though.