3 ms·
Not true at all. I encounter incidental complexity all the time when writing code in Java, Ruby, and Python. Especially when I need to interface with other libr
by swannodette 16y ago
Not true at all. I encounter incidental complexity all the time when writing code in Java, Ruby, and Python. Especially when I need to interface with other libraries and other frameworks.
Ruby, Python, Java deal with the expression problem very poorly. The desire to write code generically is real so you have the mess of generics and people run to dynamic langs. In dynamic langs the desire to monkey-patch is real because you often need to extend objects whose source you do not control. In dynamic langs you often want an extension point, that does not a mean a list of methods to call, rather a list of method signatures to implement so I plug my own functionality in w/o reading through your source.
All this adds up to countless hours wasted.
These are real problems in real software today that current mainstream languages address very poorly.
- ghotli 16y agoThus summarizes the negatives. Do you have any examples of languages with effective solutions to the expression problem?
- swannodette 16y agoScala (implicits, structural typing) and Clojure (protocols, extend-type) both have great solutions to these problems. Anyone know of other langs that deal with these issues properly?
- Zaak 16y agoHaskell has type classes and type inference which seem like they would be helpful.
- joshhart 16y agoScala has (limited compared to Haskell, but still powerful) type inference and a way to simulate type classes as well.
- gtani 16y agoScala type inference is still evolving (as are clojure, and, I think, haskell and F#) http://www.reddit.com/r/scala/comments/ectzr/why_no_type_inference_in_scala/ http://www.reddit.com/r/scala/comments/ectzr/why_no_type_inf...
- rlmw 16y agoHaskell. Aside from usual functional facilities for code reuse such as polymorphism and Higher Order Functions, monads (specifically monadic composition) and Type Classes are quite useful for writing generic code.
- vegai 16y agoGo also.
- uros643 16y agoAm I correct in assuming that any language with support for overloading functions for new types, instead of extending existing types with new members/methods, would have a solution to such issues? This would then also cover: * anything CLOS-inspired: Common Lisp, Dylan, Factor, Clojure * but also presumably anything with C++- or Clay-like (http://tachyon.in/clay/ http://tachyon.in/clay/) generic programming, namely w.r.t generically using freely-overloadable functions. I believe Haskell achieves something similar to this using type classes.
- anamax 16y ago> In dynamic langs the desire to monkey-patch is real because you often need to extend objects whose source you do not control. And in static languages, you never need to extend objects whose source you do not control. I must be doing it wrong - I've only been tempted to monkey patch once, and that was because the folks who controlled the code explicitly said to monkey patch in certain circumstances.