Quote:
Оriginally Postеd by borup
platform independent‚ perfect for web programms
|
Hell no. Strong Statically typed languages are generally horrible for web programming. Groovy (Dynamic typing, Closures) > Java for web languages (if you want to stay inside the Sun VM).
If there's a good thing Java has is a huge standard library, but even then python has just as huge a library, and so does .NET (which IS cross platform as long as you use a 3rd party windowing toolkit like GTK# or wx.NET).
That leaves exactly what for Java? Enterprisey stuff? And why is Java popular in the enterprise? Marketing and legacy applications. Sun marketed the fuck out of Java and that's why it's popular. What's worse is that all those project managers that fell for the Java hype machine also fell for the pattern hype machine and now you have projects that are overengineered pieces of shit with 90% boilerplate code.
Java:
Code:
public List getIds(List items) {
List result = new ArrayList();
foreach( Item i in items) { //this syntax is wrong, but fuck if I am gonna look it up
result.add(i.getId());
}
return result;
}
Dynamically Typed Language with list comprehensions:
Code:
def get_ids(items):
return [i.id for i in items]
(actually doesn't need to be dynamically typed, you can do something similar in C#)
NОTE: Thе code above is a relatively weak representation in that I wouldn't even use a function get a member of items in a container‚ I'd normally uѕе a generator expression where I need the ids‚ thuѕ saving mе the re-allocation.