4 ms·
No, it won't. OO has ruled the roost in the so-called Enterprise space for nigh-on 20 years now. Java hasn't (yet?) fully displaced C++ in 10 years despite, for
by gaius 18y ago
No, it won't. OO has ruled the roost in the so-called Enterprise space for nigh-on 20 years now. Java hasn't (yet?) fully displaced C++ in 10 years despite, for this specific class of application, have several clear advantages. This is as much cultural as technological. Large corporations have a morbid (and self-fulfilling) paranoia about staff turnover and have adopted technologies such as OO because it is far easier to manage a hundred average coders each of whom has a clear boundary (the object) than it is to manage 10 rocket scientists. The power of the functional paradigm comes with a steep learning curve, there's no way around that.
- yariv 18y agoThe irony is that Erlang is so much easier than Java.
- gaius 18y agoShhh, don't tell anyone :-D On a more serious note yes, but again that's a cultural thing. Languages like Erlang (and OCaml, and Haskell, and...), you spend more time thinking than typing. You don't (need to) write much code, and if you think of a better way you might completely overwrite yesterday's work. You might deliver a huge chunk of functionality in a couple of pages of code that took weeks of thought, but that looks like it was typed in a day (I have been in that situation). Functional languages don't fit big-company management comfortably. They don't look like "work" in the sense that most IT organizations are used to. Java will be with us for a long time.
- anamax 18y agoThat's nice, but how easy is it to understand those 2 pages of brilliance later and how brittle are they? Remember - the author is the smartest person who will ever see a given piece of code. The reader, even if it's the same person, will be dumber. Programming isn't literature or poetry. No one ever had to add a mail reader to"Ode to a Grecian Urn".
- yariv 18y agoI think it's a lot easier to understand what some code does if you don't have to read a lot of language imposed cruft that surrounds the actual 'meat' of the algorithm. Erlang really is easier than Java -- both to read and to write. I think people too often confuse "different" with "difficult".
- anamax 18y agoI wasn't thinking Java. I was thinking lisp or python.
- silentbicycle 18y agoFor one thing, the pattern matching used in Erlang, ML, and Haskell can be quite easy to read. For example, something like let days_in_month m = match m with | Jan | Mar | May | Jul | Aug | Oct | Dec -> 31 | Apr | Jun | Sept | Nov -> 30 | Feb -> if leap_year () then 29 else 28 It takes a small amount of context (all "| Val" sections without a -> ... side match together), but it's a pretty direct correspondence.
- nostrademons 18y agoThat's not much harder in C or Java, given appropriate enum declarations: public int days_in_month(month) { switch(month) { case JAN: case MAR: case MAY: case JUL: case AUG: case OCT: case DEC: return 31 case APR: case JUN: case SEPT: case NOV: return 30; case FEB: if(leap_year()) return 29; else return 28; } } Pattern-matching really shines when you need to destructure the argument, then do something similar to the result regardless of which case resulted in the destructuring. For example, compare red-black trees written in Java: http://www.docjar.com/html/api/java/util/TreeMap.java.html http://www.docjar.com/html/api/java/util/TreeMap.java.html vs. those written in Haskell: http://www.cse.unsw.edu.au/~dons/data/RedBlackTree.html http://www.cse.unsw.edu.au/~dons/data/RedBlackTree.html The rebalancing code in Java is 80 lines long. The rebalancing code in Haskell is 6.
- rcoder 18y agoThe Java protection model is in many ways less strict than the process isolation model exploited in Erlang. Giving each programmer responsibility for their pool of classes may sound like a good way to limit their ability to damage the rest of the system, but as long as anyone else is dependent on the stability of their API (and the absence of unchecked runtime exceptions), a single bad line of code can easily bring down an entire system. Also, while it may technically be a "functional" language by virtue of disallowing destructive update of values, it really reads more like a scripting language. Variables are dynamically typed, and the functions only have an arity, not a signature. Programmers used to the expressive type systems and polymorphism of more "academic" functional languages like ML or Haskell, on the other hand, would probably chafe at Erlang's lack of support for any abstractions other than forking and message-passing. Real rocket scientists, on the other hand, would probably like Erlang, since the semantics of the language are simple, and its fault-tolerance and concurrency features could be well-suited for high-availability systems like mission data collection. (Its lack of hard real-time features make it a non-starter for actual avionics.)
- jrockway 18y agoI don't think this is the issue. You could easily give each developer a Haskell module to flesh out, like: foo :: Foo -> (Bar -> Baz) -> Quux hello :: IO this :: Is -> Starting -> To Get -> Boring Arguably the restrictions they are bound to are much stricter than with Java. But anyway, I don't think most Java programmers really "get" OO. So OO is not the reason they use Java -- there is something else. Probably a lot of marketing from Sun; constantly hearing about "certification" and whatnot makes the managers happy.