Slashdot Mirror


Love and Hate For Java 8

snydeq writes "Java 8 brings exciting developments, but as with any new technology, you can count on the good, the bad, and the headaches, writes Andrew C. Oliver. 'Java 8 is trying to "innovate," according to the Microsoft meaning of the word. This means stealing a lot of things that have typically been handled by other frameworks and languages, then incorporating them into the language or runtime (aka standardization). Ahead of the next release, the Java community is talking about Project Lambda, streams, functional interfaces, and all sorts of other goodies. So let's dive into what's great — and what we can hate.'"

434 comments

  1. I'm disappointed by msobkow · · Score: 2

    I'm disappointed. I expected Lambda functions to be closer to Erlang's implementation, where you can access the variables of the enclosing function/method safely. But perhaps the examples in the article are just too simplistic to show such behaviour.

    --
    I do not fail; I succeed at finding out what does not work.
    1. Re:I'm disappointed by Anonymous Coward · · Score: 0

      Can you do that without adding an indirection layer that would break optimization in existing VM implementations?

    2. Re:I'm disappointed by msobkow · · Score: 3, Interesting

      I think the bigger reason they probably didn't do it is that Erlang only lets you assign a variable once, so there are no concurrency issues with read/write of variables. One of the neat side effects of this is that a service/method which takes a lambda argument can be parallelized behind the scenes without changing the meaning of the code execution.

      Another thing that puzzles me is that Java lambdas seem to be based on the idea of overriding a method of a class. That seems to me to be a critically limiting way of implementing them vs. function prototypes/templates, as there is no way to specify multiple lambdas being passed to the evaluator.

      --
      I do not fail; I succeed at finding out what does not work.
    3. Re:I'm disappointed by EvanED · · Score: 1

      Another thing that puzzles me is that Java lambdas seem to be based on the idea of overriding a method of a class. That seems to me to be a critically limiting way of implementing them vs. function prototypes/templates, as there is no way to specify multiple lambdas being passed to the evaluator.

      Huh? I'm pretty sure you're not right about it being a limitation, but nor do I understand what you mean from "versus" to the end. Can you elaborate?

    4. Re:I'm disappointed by Anonymous Coward · · Score: 0

      Your last sentence doesn't make much sense to me. Do you mean there's no way to specify a polymorphic lambda that would use static type information to call the appropriate method for a given set of arguments? I'll assume so.

      Setting aside that it's a terrible idea... if you really need that to be done efficiently, you can create an interface or abstract class that has a set of polymorphic methods that each take different arguments, and then pass in anonymous inner class that implements each polymorphic variant. That way when the caller calls ifoo.bar(baz), the compiler will choose the correct version of the method.

      Hint: Java 8's lambdas are just syntactic sugar for the non-polymorphic version of what I just described; they save you from having to declare the interface/abstract class, save you some typing when instantiating the anonymous inner class, and they save you a few keystrokes when invoking the method.

      Your desire to include polymorphism would overly-complicate the lambda-syntax, and its only benefit would be so that a few inexperienced devs could say "look what I did, dur hur" and then leave a maintenance nightmare where people would occasionally end up accidentally calling the wrong version because of typecasts carried forward by automated refactorings, except nobody would notice the mistake until it's in production.

    5. Re:I'm disappointed by datavirtue · · Score: 1

      This reminds me, did they ever publish the answers to our questions from Gosling?

      --
      I object to power without constructive purpose. --Spock
    6. Re:I'm disappointed by binarylarry · · Score: 3, Funny

      They're still waiting for the application with the answers to start up.

      --
      Mod me down, my New Earth Global Warmingist friends!
    7. Re:I'm disappointed by pspahn · · Score: 4, Funny

      "Knock Knock..."

      "Who's there?"

      ...

      ...

      ...

      ...

      Java!!!

      --
      Someone flopped a steamer in the gene pool.
    8. Re:I'm disappointed by Anonymous Coward · · Score: 0

      It looks like they can. The variable just can't be assigned multiple times. Basically, the actual requirement is that the variable has to be final except no one actually uses the final keyword on their variables, so they don't require it to be written. Remember that to access a variable from an anonymous inner class, the variable has to be declared final and lambdas are basically sugar for a certain type of anonymous inner class.

    9. Re:I'm disappointed by Anonymous Coward · · Score: 0

      That's because Lambdas are not real closures.

    10. Re:I'm disappointed by msobkow · · Score: 1

      No, I think we're talking about different things.

      With Erlang, any function that matches an argument signature can be passed to a function that can take a lambda. But with Erlang, a given function can take more than one lambda at the same time as an argument. The closest analogy I could think of with the Java approach is to override *multiple* methods with a single lambda specification, not jujst one.

      So it's not polymorphic in the sense that I think you're describing. It's just a broader-scoped implementation.

      For example, you might define one lambda in Erlang that gets the next value from some abstract container to be defined by the programmer. You might define another lambda to compare elements. The lambda-receiving function sort() accepts both, producing a sorted list based on the arbitrary "key" of the lambdas. I don't see any way of doing that with the Java approach, because there is no way to specify multiple lambda arguments for the implementation of sort().

      In "normal" Java you could do it by expecting two interfaces for sort()'s arguments, so perhaps you could then specify lambdas of the interfaces, but I'm not sure. I'm pretty sure Java would mandate that you use classes, not interfaces, which kind of limits the generic approach that Erlang offers.

      --
      I do not fail; I succeed at finding out what does not work.
    11. Re:I'm disappointed by Anonymous Coward · · Score: 0

      Java Who? ... (HDD trashing) ... (web browser hung) ... (User tried to kill task)

      So ugly and bloated, It must be Jabba the Hutt... (user mutter to himself)

    12. Re:I'm disappointed by msobkow · · Score: 1

      Let me try a different tack.

      Imagine Java had function pointers added to it. You might be able to do such a thing using introspection, but I'm not sure.

      Now define a lambda-accepting method that takes a lambda function as an argument.

      The implementation specifies an anonymous method accepting the arguments of the function pointer signature inline with the invocation of the lambda-accepting method. Within the body of that anonymous function you have access to the variables of the enclosing method as well as the members of the method's class.

      Because the anonymous method is an inline argument to the invocation of the lambda-accepting method, you can specify more than one lambda as an argument to that method.

      With Erlang, everything is based on functions and function pointers, but their syntax and implementation are cleaned up greatly compared to a language like C++ so you have a much harder time hanging yourself.

      It's also much lighter weight than a class method override, because you don't instantiate a new instance when the lambda body gets invoked, but pass the existing object instance of it's enclosing method.

      --
      I do not fail; I succeed at finding out what does not work.
    13. Re:I'm disappointed by msobkow · · Score: 1

      Whereas with Erlang lambdas are anonymous inner methods/functions. Much lighter weight invocation, and no issues with trying to invoke something other than the default constructors.

      --
      I do not fail; I succeed at finding out what does not work.
    14. Re:I'm disappointed by gstoddart · · Score: 2

      I think the bigger reason they probably didn't do it is that Erlang only lets you assign a variable once

      Hmmm ... I'm not sure I'd call it a variable then. ;-)

      --
      Lost at C:>. Found at C.
    15. Re:I'm disappointed by Anonymous Coward · · Score: 0

      /** Java 6 */
      import java.util.Arrays;
      import java.util.Comparator;
      public class Test {
          static interface IPoymorphicLambda {
              public abstract void call(int arg1);
              public abstract void call(String arg1);
          }
          static void whatMagicIsThis(IPoymorphicLambda func) {
              func.call(42);
              func.call("42");
          }
          static class Closure {
              int calls;
          }
          static void test1() {
              final Closure closure = new Closure();
              whatMagicIsThis(new IPoymorphicLambda() {
                  @Override public void call(int arg1) { ++closure.calls; System.out.println("Int: " + arg1); }
                  @Override public void call(String arg1) { ++closure.calls; System.out.println("String: " + arg1); }
              });
              System.out.println("Calls: " + closure.calls);
          }
          static void test2() {
              Comparator<Integer> forward = new Comparator<Integer>() {
                  @Override public int compare(Integer arg0, Integer arg1) { return arg0 - arg1; } };
              Comparator<Integer> backward = new Comparator<Integer>() {
                  @Override public int compare(Integer arg0, Integer arg1) { return arg1 - arg0; } };
              Integer[] array = { 1, 9, 2, 8, 3, 7, 4, 6, 5 };
              Arrays.sort(array, forward);
              System.out.println(Arrays.toString(array));
              Arrays.sort(array, backward);
              System.out.println(Arrays.toString(array));
          }
          public static void main(String[] args) {
              test1();
              test2();
          }
      }

      Here's the disassembly for whatMagicIsThis:

      static void whatMagicIsThis(Test$IPoymorphicLambda);
        Code:
        0: aload_0
        1: bipush 42
        3: invokeinterface #16, 2; //InterfaceMethod Test$IPoymorphicLambda.call:(I)V
        8: aload_0
        9: ldc #22; //String 42
        11: invokeinterface #24, 2; //InterfaceMethod Test$IPoymorphicLambda.call:(Ljava/lang/String;)V
        16: return

    16. Re:I'm disappointed by msobkow · · Score: 1

      Do you consider something like BigDecimal in Java to be a variable?

      Surprisingly enough, this restriction in Erlang is compensated for quite handily through it's functional programming approach. It took me a while to grok it, and I'm still no expert, but it's definitely off the beaten path and quite powerful. I've applied a number of techniques I learned from a couple of years of Erlang programming to my work in other languages. It forced me to "think different", and that's not always a bad thing.

      --
      I do not fail; I succeed at finding out what does not work.
    17. Re:I'm disappointed by Anonymous Coward · · Score: 0

      Think of the meaning of variable in mathematics.

    18. Re:I'm disappointed by Anonymous Coward · · Score: 0

      There isn't a lambda in existence that is a closure. It might have the property of a closure. Closure is a property of something. I am really getting sick of retards using closure interchangably with anonymous function, block, and lambda.

    19. Re:I'm disappointed by Anonymous Coward · · Score: 0

      Hmmm ... I'm not sure I'd call it a variable then. ;-)

      It's way too late to change it! Mathematicians coined the term 'variable' hundreds of years ago and it's taught to every school child. You were probably thinking of its more recent usage as the term for named storage location. I think that arrived at about the same time as Fortran.

  2. Finally Fixing the Date stuff by CastrTroy · · Score: 4, Informative

    Proper date and time handling is one of the reasons I really prefer .Net to Java. The support for dates is just deplorable in Java. One shouldn't have to use an external dependancy, like JodaTime to handle basic date operations. If they could also add a "Decimal" data type, that is, a base-10 decimal primitive datatype, I think Java would be a much more useful language for day to day programming. Almost all the programming I do I would rather use a Decimal data type rather than a float data type, but very few languages support it as a native data type. .Net is one of the few environments where they got this right.

    --

    Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    1. Re:Finally Fixing the Date stuff by msobkow · · Score: 2

      How would your Decimal concept be any more powerful than Number?

      The one thing I wish they'd have done with Number is added Precision and Scale to it's usage, which would be invaluable for things like financial and scientific calculations.

      --
      I do not fail; I succeed at finding out what does not work.
    2. Re:Finally Fixing the Date stuff by msobkow · · Score: 1

      Sorry. I meant "BigDecimal".

      --
      I do not fail; I succeed at finding out what does not work.
    3. Re:Finally Fixing the Date stuff by CastrTroy · · Score: 2

      They need to support it as a native numeric type, so it's not so difficult to use. If it was a native type with proper mathematical operators you wouldn't need questions on Stackoverflow about how to add two values together.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    4. Re:Finally Fixing the Date stuff by msobkow · · Score: 3, Insightful

      I'd hardly call it "difficult" to use, any more than it is to use the wrappers for the native types. Still, it would be *nice* if you could use "+" instead of "add()", but really that's just syntactic sugar.

      --
      I do not fail; I succeed at finding out what does not work.
    5. Re:Finally Fixing the Date stuff by Anonymous Coward · · Score: 5, Insightful

      I'd hardly call it "difficult" to use, any more than it is to use the wrappers for the native types. Still, it would be *nice* if you could use "+" instead of "add()", but really that's just syntactic sugar.

      To some extent, anything beyond raw binary notation used by your processor is just some form or another of "syntactic sugar" transformed by some intermediate tool.

    6. Re:Finally Fixing the Date stuff by Anonymous Coward · · Score: 0

      *clap* *clap*

    7. Re:Finally Fixing the Date stuff by Anonymous Coward · · Score: 0

      Where are my mod points when I need them? I'd +1, thumbs up if I could.

    8. Re:Finally Fixing the Date stuff by Anonymous Coward · · Score: 0

      > you wouldn't need questions on Stackoverflow [stackoverflow.com] about how to add two values together

      Sorry, but if you dont know what an immutable object is, then you need to go back to first or second year CS (depending on where you went).

      What's even funnier is that the "native type" syntax would also be like immutable objects since you would also need an assignment.
      its
      a=a+b
      not just a+b

    9. Re:Finally Fixing the Date stuff by petermgreen · · Score: 5, Insightful

      People like to dismiss syntactic sugar as unimportant but IMO it's the difference between code that is pleasant to read and write and code that is a PITA to read and write.

      I wish some fork of java would happen and take off that adds back in the basic features sun left out. Stuff like properties*, user defined types without an implicit reference, unsigned numeric types, operator overloading, parameter pass by reference etc. Some of that is syntactic sugar, other parts not so much. Ideally these features would be done in a way that could somewhat work on existing VMs though some features would likely require VM enhancements to operate efficiently.

      Unfortunately MS has already taken the name J++ :(

      * No that javabeans shit doesn't count.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    10. Re:Finally Fixing the Date stuff by viperidaenz · · Score: 5, Informative

      New Java Date Time API for Java8: http://openjdk.java.net/jeps/150
      AKA JSR 310

    11. Re:Finally Fixing the Date stuff by Alomex · · Score: 3, Insightful

      Actually it isn't. The add() method belongs to the first parameter, whereas the native '+' implementation (used to) belong to neither and if you think about it really should be that way.

      '+' is not a method or property of the first parameter. the correct interpretation of a+b is that this creates a unnamed virtual object number tuple with the method add.

    12. Re:Finally Fixing the Date stuff by EvanED · · Score: 2

      Sorry, but if you dont know what an immutable object is, then you need to go back to first or second year CS (depending on where you went)

      Maybe the person asking the question (I didn't look) was in first or second year CS.

      What's even funnier is that the "native type" syntax would also be like immutable objects since you would also need an assignment.
      its
      a=a+b
      not just a+b

      a += b.

      In fact, even well-aware of how it actually behaves,

      a.add(b)

      still seems to me like it should be closer to

      a += b

      than to

      a + b

      .

    13. Re:Finally Fixing the Date stuff by Alomex · · Score: 4, Insightful

      Academic types have rejected 95% of all real advances in programming languages for nearly 4 decades as "syntactic sugar" while they carry on with their abstract type theory which has had rather limited impact in the real world in the same time span.

      Do yourself a favor and do away with the "syntactic sugar" crutch and try to judge a language proposal on it's own merits. Is it better to write 3+5 than 3.add(5) ?

      The answer is obviously YES, so who the hell cares if it is syntactic sugar, syntactic salt or syntactic coconut sprinkles.

      If it makes life better it should be adopted. End of story.
      p.s. there are potential drawbacks with operator overloading, but "syntactic sugar" ain't one of them.

    14. Re:Finally Fixing the Date stuff by jythie · · Score: 2

      I think in general people use the term 'syntactic sugar' when they feel that it does not increase readability. I know I tend to use it to describe features that neither add functionality nor seem to make the code easier or harder to write. Things that do one or the other I just call 'useful'.

    15. Re:Finally Fixing the Date stuff by jbolden · · Score: 1

      There are lots of languages built on top of the JVM that can even use Java libraries which have totally different syntax. Clojure being a great example, and Scala another.

    16. Re:Finally Fixing the Date stuff by KonoWatakushi · · Score: 2

      Unfortunately, it seems that JVM based languages are still limited by the lack of unsigned types. What a remarkably stupid decision to omit them.

    17. Re:Finally Fixing the Date stuff by Anonymous Coward · · Score: 0

      Agree with the general comments on operator overloading, perhaps without the vitriol. If Scala had left out operator overloading it would be a pretty awesome language.

    18. Re:Finally Fixing the Date stuff by LO0G · · Score: 1

      Interesting. I've always used "syntactic sugar" to mean language features that are fundamentally implemented in the front end. For example C++ lambdas are effectively syntactic sugar - it's a clean syntax that wraps an anonymous class declaration (with the lambda capture values being class members and the lambda body being an "operator()" method).

      Another example is C++ reference parameters - under the cover most C++ compilers implement reference parameters as pointer to type parameters and the reference parameter access is syntactic sugar for pointer indirection.

      These examples are simplifications but they serve to demonstrate my thinking.

    19. Re:Finally Fixing the Date stuff by EvanED · · Score: 2

      I've always used "syntactic sugar" to mean language features that are fundamentally implemented in the front end

      But what does that mean? Lots of stuff is implemented in the front end. Without knowing for sure, loops and conditionals are language features that are probably almost always lowered to gotos by the time it hits the back end. Classes are almost guaranteed to be syntactic sugar, even if they have virtual functions. Templates and macros are syntactic sugar.

    20. Re:Finally Fixing the Date stuff by mrchaotica · · Score: 1

      It sounds like what you really want (if you can't have operator overloading) would be something like Number.add(a, b).

      --

      "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

    21. Re:Finally Fixing the Date stuff by bzipitidoo · · Score: 3, Insightful

      What bugs me about operator overloading is how tediously verbose it can get. For example, say you define operator functions for < and ==. You still have to do <=. Even when all the <= function is is: return this < that || this == that;, you still have to write it. It's so tempting to skip writing the code for an unused operator that many programmers do so. Languages are mostly unable to automatically fill in obvious code of that sort. C++ does have a default assignment operator function, but that's all. Too much chance of the obvious being wrong, so they opt not to do anything.

      To make matters worse, the above implementation of <= is inefficient. Down at the machine level, the computer does not stupidly require 2 separate comparisons to test <=. It has instructions such as JLE. The above function will at the least result in the computer having to do JL; JE;. While JE may be executed only 50% of the time that JL is executed, depends entirely on the data and code, it's still a waste. Further, two branches takes more space in the CPU's branch prediction, and the extra instruction takes more space in cache, so JL; JE is not as good as 50% slower.

      I find your gratuitous slur against "academic types" unwarranted and unfair. Academia has produced much innovation in programming. Do you forget the proof that Structured Programming is sufficient, and GOTOs are not necessary? All the work done on Turing machines, and universal computation? Automata Theory, with the classification of grammars into such categories as "context free"? BNF? Without that academia you sneer at, we couldn't be sure of all that. What of the entire concept of OOP? Where did that come from? And functional programming and LISP? It's easy for some hack to bang out a programming language built around what he feels are a few good ideas, drawn from perhaps years of experience. But without careful examination of the problems, insightful modeling that leads to good, pertinent questions which can be proven one way or another, we would just be flailing around even more than we already do. We might all still be trying to program in ALGOL. I put more trust in academia's ability to create a good programming language than I do a modern corporation with its dismissive attitude towards fundamental research.

      --
      Intellectual Property is a monopolistic, selfish, and defective concept. It is "tyranny over the mind of man"
    22. Re:Finally Fixing the Date stuff by Anonymous Coward · · Score: 0

      Too much sugar is not good for you. It rots your brain.

    23. Re:Finally Fixing the Date stuff by Alomex · · Score: 2

      All the examples you give predate the "nearly four decades" timespan that I wrote about in my post. With those you just have--inadvertently-- confirmed my point.

      Academics made great contributions to programming languages until the "programming languages=type theory" and "usability improvements=syntactic sugar" mindsets crept in. I am far from the first person to observe this btw, e.g.:

      http://matt-welsh.blogspot.ca/2013/04/the-other-side-of-academic-freedom.html?showComment=1366600358822#c5765593833050647322

      Don't get me wrong, I'm all in favor of research. I'm just pointing out that the PL community has chosen a narrow focus of their discipline to the detriment of progress in real life PLs.

    24. Re:Finally Fixing the Date stuff by EvanED · · Score: 1

      A somewhat snarky rebuttal:

      What bugs me about operator overloading is how tediously verbose it can get. For example, say you define operator functions for < and ==. You still have to do <=.

      Get a better language.

      For instance, in Python, functools.total_ordering will give you all six comparison operators when you give it < and ==. In C++, std::rel_ops will do the same thing. (Admittedly, in the C++ version it isn't on a per-class basis without some work because those are function templates, so you either get them for all classes or none.)

      Down at the machine level, the computer does not stupidly require 2 separate comparisons to test
      Get a better compiler.

      Given the code

      bool leq_native(int a, int b) {
          return a <= b;
      }
       
      bool leq_or(int a, int b) {
          return a < b || a == b;
      }

      GCC at -O1 or -Og or higher and Clang at all optimization levels all produce identical code for the two functions.

      (OK, my "get a better compiler" is a bit harsh here. Interestingly, Intel's C++ compiler leaves in a jl/jne sequence at all optimization levels, as does MSVC.)

    25. Re:Finally Fixing the Date stuff by Westley · · Score: 1

      The support for date and time handling in .NET is deplorable too, in my view. If it weren't, I wouldn't have bothered to create the Noda Time library (http://nodatime.org) which I'd like to think does a rather better job.

      Having a single type (well, two with DateTimeOffset) to represent all kinds of different concepts is simply a bad idea. See my rant about this for more details:
      http://noda-time.blogspot.co.uk/2011/08/what-wrong-with-datetime-anyway.html

    26. Re:Finally Fixing the Date stuff by Anonymous Coward · · Score: 0

      Yip, I noticed this as well. Type inference is an interesting one. Academia has researched type inference for many years, but has come to the conclusion that, like the halting problem, it cannot be done for all problems. So therefor there should not be any languages that do. Oh and the points where it can't be done are on the edge of your application where it needs to talk to hardware at some point.

      Luckily I am an engineer not a scientist, I am not bound by notions of 'perfect'. Anyway I am making a practical-type-inference object oriented compiled language, wish me luck.

    27. Re: Finally Fixing the Date stuff by gmueckl · · Score: 3, Insightful

      Clearly you have not yet had a chance to write code that does real maths with real mathematical types like vectors or matrices. This is wheree operator overloading really shines. You don't want to implement complex formulas with tons of explicit function calls. With overloaded operators you can basically transfer the formulas you calculated on paper into machine code almost exactly. Without them, it's a sad mess of nested function calls, long lines, superfluous temporary variables and almost inevitable mistakes in code that nobody wants to read.

      Of course there are times when operator overloading is exactly the wrong thing to do. But if it is used the right way, it is an amazing feature.

      --
      http://www.moonlight3d.eu/
    28. Re:Finally Fixing the Date stuff by Anonymous Coward · · Score: 0

      About half your list of "basic features" are things that I'm glad I never have to deal with again (in other people's code.)

    29. Re: Finally Fixing the Date stuff by gmueckl · · Score: 1

      Using ints makes this kind of optimisation very easy. Usually, the types you use overloading for are more complex and the operators that are called will likely be inlined, but not combined in a meaningful way.

      --
      http://www.moonlight3d.eu/
    30. Re:Finally Fixing the Date stuff by 91degrees · · Score: 1

      A decent Time mechanism would be great. I'm worried we might end up having to juggle three of them.

    31. Re:Finally Fixing the Date stuff by MadKeithV · · Score: 1

      Do yourself a favor and do away with the "syntactic sugar" crutch and try to judge a language proposal on it's own merits. Is it better to write 3+5 than 3.add(5) ?

      The answer is obviously YES

      Except someone overloaded the + operator to return an expression template type so that a longer expression might be collapsed into a simpler statement through compiler optimizations. The expression is evaluated only in specific circumstances when it is assigned back to the root data type. This worked fine for regular code for a while because no-one could ever guess the exact type of the expression template type returned, so you couldn't store the template. You could only write stuff like BaseType result = foo + bar;. However, suddenly everyone writes

      BaseType foo = 3; auto result = foo + GetBar();

      And now the type of "result" isn't BaseType, it's actually the expression template type, unevaluated, and referring a temporary return value from GetBar() that "magically" worked before because you couldn't store the result value anywhere previously :)

    32. Re:Finally Fixing the Date stuff by smittyoneeach · · Score: 3, Funny

      Well, you have to instantiate a BigDecimaFactory in the inversion-of-control container and pull in a lot of org.apache.whizbang.dont.we.love.us.some.nested.hierarchies code, plus update your ant scripts to maven, and don't forget to feed the Tomcat, but, with sufficient struggle, you can still get to "Hello World 1.0" in Java.

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    33. Re:Finally Fixing the Date stuff by smittyoneeach · · Score: 1

      But what does that mean?

      It could still mean "an address in memory", or "the datum at that address" but I'm not sure.

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    34. Re:Finally Fixing the Date stuff by Anonymous Coward · · Score: 0

      That would be a step forward, because it would allow you to:

      import static Number;

      and then just use add() as a function.

    35. Re:Finally Fixing the Date stuff by Anonymous Coward · · Score: 0

      Take a look at Scala. It is a really pragmatic language taking a lot of ideas from academy but not taking them too seriously (i.e. it is actually useful in practice while freaks out some of the zealot purists).

    36. Re:Finally Fixing the Date stuff by aaaaaaargh! · · Score: 1

      Hey, Ada has a decimal type! It's about as big, cumbersome and verbose as Java but at least it's safer and 3-5 times faster. Ah, nevermind...

    37. Re:Finally Fixing the Date stuff by leaen · · Score: 1

      find your gratuitous slur against "academic types" unwarranted and unfair. Academia has produced much innovation in programming. Do you forget the proof that Structured Programming is sufficient, and GOTOs are not necessary?

      Nice now I can write

      l1: foo();
      l2: bar();
      l3: if (baz()) goto l1;
      ...

      as

      line=1;
      while (1) {
      if (line==1) {
      foo();
      line=2;
      }
      else if (line==2) {
      bar();
      line=3;
      }
      else if (line==3) {
      if (baz())
      line=1;
      else
      line=4;
      }
      ...

    38. Re:Finally Fixing the Date stuff by sourcerror · · Score: 2

      I sense a fellow Prolog programmer here.

    39. Re:Finally Fixing the Date stuff by jeremyp · · Score: 1

      The native types are immutable effectively. The expression 5 + 3 doesn't change the value of 5, it returns an "object" withe the value 8. I think the problem arises from the name of the function which sort of implies you are doing something to the receiver. Objective-C has an analogous class to BigNumber but its methods are less ambiguous and they make it obvious that the receiver isn't changing, just returning the result of the addition, so translating the syntax back to Java, the method would be bigNumberByAdding() which is less ambiguous but even more of a problem when you are trying to implement a complex formula.

      Smalltalk had it right. You can send + as a message with one parameter.

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    40. Re:Finally Fixing the Date stuff by jbolden · · Score: 1

      Almost all the programming I do I would rather use a Decimal data type rather than a float data type, but very few languages support it as a native data type.

      Because CPUs don't support it in a system independent way. Also for finance there is rarely enough data to make efficiency on decimal make sense. Either there is a limited (say millions of rows) amount of data in which case a library is fine or there are huge swarms and or it needs to be recomputed frequently and it makes sense to convert the data to integer and store it that way.

      Decimal types are really a holdover of a vision of computers doing math like humans on the CPU.

    41. Re:Finally Fixing the Date stuff by Anonymous Coward · · Score: 0

      To some extent, anything beyond raw binary notation used by your processor is just some form or another of "syntactic sugar" transformed by some intermediate tool.

      Yeah, who needs things like type safety, easy to use inheritance, static error checking, etc. anyway?

    42. Re:Finally Fixing the Date stuff by Anonymous Coward · · Score: 0

      "Proper date and time handling is one of the reasons I really prefer .Net to Java. The support for dates is just deplorable in Java. "

      This is satire right? The date/time handling in .net is simply.fcking.awful.

      DateTime.ticks - according to the docs, thats the number of 100 nanosecond ticks since Jan 1st 0001, not including leap seconds. That's "jan 1st, 0001 in your current timezone", although they don't tell you that bit. Oh yeah, those iron age societies were sticklers for daylight saving.
      Ok, so you've got DateTime.utcTicks, which is a massive advantage over unix epoch because....well, because you don't have to use minus numbers to handle dates before 1970. Yeah Microsoft, got to get those historical dates right. Which is why .net DateTime knows nothing about the Julian/Gregorian shift in 1752 I guess.

      Proper date and time handling my arse. I could have saved hundreds of hours of effort over the last few years if .net *had* proper date time handling, if the Microsoft designers had bothered to learn from decades of C/Unix coding experience instead of deciding they'd better invent a new wheel, and make it square. /rant

    43. Re:Finally Fixing the Date stuff by hey · · Score: 1

      Isn't the Calendar class the preferred way to do dates in Java now.

    44. Re:Finally Fixing the Date stuff by Anonymous Coward · · Score: 0

      As one .Net developer to another, I too consider .Net to be "Java Done Right".

      But you need to watch out for your use of the decimal type in .Net. You mention that you'd like to have "a Decimal data type rather than a float data type". .Net's decimal is not a fixed-point data type. It's a base-10 floating point type. It seems that floating point types are faster and/or easier to work with, while the base-10 change was trivial. So the decimal was coded to cover most cases well enough, but if you need fixed-point, you're stuck having to find another option.

      If you want a true fixed-point decimal, you'll have to either roll your own or use System.Data.SqlTypes.SqlDecimal or something out of a D3D/OGL wrapper.

    45. Re:Finally Fixing the Date stuff by Ksevio · · Score: 2

      Just imagine how many lines of useless java code could be removed if it had implemented properties! No more of these pointless getValue(){return value;} that everyone in the java world seems to admire. if there's a part of your code that can be auto generated, there's a problem with the language.

    46. Re:Finally Fixing the Date stuff by ACE209 · · Score: 1
      why not

      do {
      foo();
      bar();
      } while (baz())

      Am I missing something?

      --
      "we are all atheists about most of the gods that societies have ever believed in. Some of us just go one god further."
    47. Re:Finally Fixing the Date stuff by Anonymous Coward · · Score: 0

      Well a bigger question is whether we want to do type inference to begin with. I'll be the first to admit that type declarations are a hassle, but perhaps much like doing your seat belt before you drive, they are a necessary hassle in the name of safety.

    48. Re:Finally Fixing the Date stuff by Anonymous Coward · · Score: 0

      Agreed 100%. Maybe it's just because I don't use Java everyday but I feel like C# is much easier to remember, read, and write. Like to instantiate a List type in Java you have to call the ArrayList constructor, not intuitive in the least bit. There's probably some stupid reason for it, and I probably knew it at one time. But either way, whenever I need to come back to a language or framework I haven't used in a while, I find Java to be the hardest to get something done.

    49. Re:Finally Fixing the Date stuff by Westley · · Score: 1

      It's not always "in your current time zone" - it depends on the "kind" of the DateTime. If you use DateTime.Now you will indeed get a value which is in your current system time zone. And I think you meant either DateTime.UtcNow or DateTimeOffset.UtcTicks rather than DateTime.UtcTicks...there's no such property as DateTime.UtcTicks.

      When it comes to using the system time zone, It's not about "those iron age societies" using daylight saving - it's more about DateTime basically always representing some sort of "local" date, either in your local time zone, UTC, or an unspecified time zone. That's a very broken design, but not (IMO) in the way that you claim it to be.

      Likewise it's entirely reasonable IMO to ignore "the" Julian/Gregorian shift in 1752, partly as it happened in different years depending on the place(and Sweden is particularly strange in this regard). All kinds of aspects of a date/time become weird if you swtch calendar system - and the DateTime type *only* represents the Gregorian calendar system. (If you give it a different one in the constructor, it effectively translates the value into the Gregorian calendar.) Again, I view that as a broken design - but not because of "the" 1752 shift.

      So yes, there are plenty of valid criticisms of .NET's date/time handling, but yours didn't quite hit the mark for me.

    50. Re:Finally Fixing the Date stuff by Anonymous Coward · · Score: 0

      Ruby (and perl, and other languages) implement the spaceship operator... ; you override this, and you get >, , =, ==, between? for free.

    51. Re:Finally Fixing the Date stuff by Anonymous Coward · · Score: 0

      Doh. <=>; >, < , =>, =<, ==

    52. Re:Finally Fixing the Date stuff by leaen · · Score: 1

      why not

      do {
      foo();
      bar();
      } while (baz())

      Am I missing something?

      You missed ... Actually it continues with:

      l4: if (baw()) goto l2;
      ...

      With generic proof you can just append

      else if (line==4) {
      if (baw())
      line=2;
      else
      line=5;
      }

      without resorting to ad-hoc constructs.

    53. Re:Finally Fixing the Date stuff by tbid18 · · Score: 1

      I think that definition of "syntactic sugar" is too strict, since it's used to describe any feature that is merely a syntactical one. E.g., $ is syntactic sugar in haskell for establishing precedence, such as "foo $ bar x" which here translates to foo (bar x). This is particularly useful for readability when combined with function composition.

    54. Re:Finally Fixing the Date stuff by Anonymous Coward · · Score: 0

      Coincidentally for 4 decades, computer lay people have exaggerated the amount of real advances in programming languages.

    55. Re:Finally Fixing the Date stuff by Hentes · · Score: 1

      You can already do that in C++. There's also a Boost library that offers a bit more flexibility.

    56. Re: Finally Fixing the Date stuff by matfud · · Score: 3, Insightful

      As soon as you get beyond complex numbers you rapidly find out that there are not enough operators to overload for operator overloading to make much sense.
      is "*" the dot or cross product or is it convolution or is it correlation or autocorrelation?

      There are not enough operators to make it useful so you have to have method calls anyway. If you are calling methods then it is clearer to always call methods

    57. Re:Finally Fixing the Date stuff by matfud · · Score: 1

      No JodaTime is the preferred way to handle date/time related things in java. a version of which is part of JDK1.8

    58. Re:Finally Fixing the Date stuff by shutdown+-p+now · · Score: 1

      I think the most reasonable definition of syntactic sugar is that it is any feature of the language that can be achieved by a purely syntactic rewrite of the code (usually with the caveat that it can use otherwise unaccessible generated identifiers) - i.e. it's syntax that's a higher-level abstraction of another syntax. So e.g. while-loop is syntactic sugar for if+goto. In many cases, this kind of thing is explicit in the language spec. For example, if you read the language spec for Lua, it defines the for-loop as a syntactic rewrite.

      I've never heard of the term carrying any negative connotations.

    59. Re:Finally Fixing the Date stuff by shutdown+-p+now · · Score: 1

      The native types are immutable effectively. The expression 5 + 3 doesn't change the value of 5, it returns an "object" withe the value 8.

      Primitives are not objects in Java, unlike many other OO languages. So no, there are no objects created here.

    60. Re:Finally Fixing the Date stuff by Anonymous Coward · · Score: 0

      The "stupid" reason is : List is an interface in Java.
      You can't instantiate an interface, you instantiate a class that implements that interface.
      The C# List class is roughly equivalent to the Java ArrayList class.
      And the C# IList interface is similar to the Java List interface.
      If you have to program both, the naming sucks, but they're different languages after all...

    61. Re:Finally Fixing the Date stuff by Anonymous Coward · · Score: 0

      I wish some fork of java would happen and take off that adds back in the basic features sun left out.

      How has no one mentioned Groovy yet? It is my JVM language of choice.

    62. Re:Finally Fixing the Date stuff by Anonymous Coward · · Score: 0

      One thing I would personally add to operator overloading versus what C++ does. I'm unsure how well it can be enforced, but require objects that overload operators to preserve the mathematical structures behind those operators. The use of "<<" and ">>" on the C++ iostream library were obscene. I would argue this allows a hash to use the [] operator with a string between the [] (an array can only map a number to an element, while a hash handles strings; I'd want one in the standard library). Don't require all of <, >, <=, >=, ==, and != to be implemented separately, merely having < and == is sufficient to produce all the others.

    63. Re: Finally Fixing the Date stuff by Anonymous Coward · · Score: 0

      Well, yeah, there are a lot more math operators than there are standard ASCII symbols. (I can think of dozens off the top of my head!) But for people who do math, it's pretty standard that + and - are addition and subtraction/negation; * is either ring multiplication or matrix multiplication (including inner/outer product for vectors, depending on whether row or column vectors); and / is field division. These are the most common operations, and so it vastly improves readability and writability if they're overloaded.

      * doesn't make sense as cross product unless you are specifically doing 3d vectors. Certainly convolution, correlation, and autocorrelation should not be overloads for *. I know multiplication is written as * in math, but when translating to computer programming, we all know * is multiplication.

    64. Re:Finally Fixing the Date stuff by tigersha · · Score: 1

      Why don't you program in ASM then?

      MOV DX,10
      MOV AX,10
      ADD DX,AX

      That is what this look like in Java right now!

      --
      The dangers of excessive individualism are nothing compared to the oppressiveness of excessive collectivism
    65. Re:Finally Fixing the Date stuff by Anonymous Coward · · Score: 0

      What bugs me about operator overloading is how tediously verbose it can get. For example, say you define operator functions for
        Ruby has a nice solution for this. You can define one master compare operator "" and then mix-in the set of all comparators that are a function of this.

      class Item
        def (other)
            return [-1, 0, or 1]
        end

        include Comparable
      end

    66. Re:Finally Fixing the Date stuff by sg_oneill · · Score: 1

      For what its worth , date time handling is a screwed up mess in almost all languages. Its bad in python, and recently I was dragged kicking and screaming into some PHP/mysql/html work and the combination of mysql,php AND javascripts date handling is some seriously unholy shit. God help me.

      --
      Excuse the Unicode crap in my posts. That's an apostrophe, and slashdot is busted.
    67. Re:Finally Fixing the Date stuff by oreiasecaman · · Score: 1

      +1 SadButTrue

      --
      This is a UDP joke, I don't care if you get it or not...
    68. Re:Finally Fixing the Date stuff by vilanye · · Score: 1

      Too bad Java isn't very type-safe.

    69. Re:Finally Fixing the Date stuff by vilanye · · Score: 1

      Only if you are using a stupid language

      In ruby all you have to do is mixin Comparable into your class , define the <=> method and you get <.>,==,<=,>=, and between? methods for free.

      Note, that I didn't say operator. Ruby does not support operator overloading( you can't overload the operator = fer instance) +,-,*./,etc are also methods not operators.

    70. Re:Finally Fixing the Date stuff by petermgreen · · Score: 1

      What bugs me about operator overloading is how tediously verbose it can get. For example, say you define operator functions for < and ==. You still have to do <=. Even when all the <= function is is: return this < that || this == that;, you still have to write it. It's so tempting to skip writing the code for an unused operator that many programmers do so.

      That isn't really specific to operator overloading though. If you want your users to be able to do "less than or equal to" in one step then you have to provide an implementation of that regardless of whether you are using conventional functions or operator overloading.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    71. Re:Finally Fixing the Date stuff by Anonymous Coward · · Score: 0

      loops(for while do/while,etc) are definitely syntactic sugar.

    72. Re: Finally Fixing the Date stuff by matfud · · Score: 1

      There certainly are more symbols and many are similar or used in place of the operators you know. Convolution can be expressed as a "*" or as a "x" with a containing circle.

      Just read APL code for an example of why so many operators are necessary to write code handling arrays let alone matracies.
      Is that readable (well yes for me it can be sometimes) is it ascii? nope.

      Simple operations on complex numbers can just about be coped with. Everything else makes the small number of over loadable operators in a language like C++ pitiful and more importantly painful.

  3. Re:Nooooo by armanox · · Score: 2

    Oracle is good at one thing: making Larry Elison money. Microsoft isn't sure what they're good at.

    --
    I'm starting to think GNU is the problem with "GNU/Linux" these days.
  4. Re:Gawd by jcr · · Score: 5, Insightful

    Java is a real language, and a lot of real programs have been written with it. It's not a good language, but that doesn't make it trivial.

    -jcr

    --
    The only title of honor that a tyrant can grant is "Enemy of the State."
  5. Who has the biggest kitchen sink? by Anonymous Coward · · Score: 0

    Having grown up on Java, I know that it's always had a mindset of trying to be pretty much everything to everyone (even if sometimes half-heartedly.) That said, I'm tired of every language trying to see just how much of every possible programming model, paradigm, or feature it can tack on. It really seems like some bizarre dick-measuring contest among language designers these days.

    1. Re:Who has the biggest kitchen sink? by Anonymous Coward · · Score: 0

      "Why standardize common and popular features from other languages and incorporate them directly into the language? It's much more fun to manage conflicting, incomplete, and thoroughly fucked up inter-library dependencies, or have 17 different programming language standards along with their associated toolchains, maintenance nightmares, and patching hassles!"

      Oh wait, not a bit of that is remotely true.

    2. Re:Who has the biggest kitchen sink? by jythie · · Score: 2

      Sadly, people like to think that their tool of choice is the best, and it is the best everywhere and applicable to all situations, thus language designers over time try to make their preferred language more and more like every other language till it becomes and over complicates mess that you basically have to learn half a dozen dialects in order to understand any random chunk of code. Just look at C++, you can almost tell which year the person who wrote the code learned it in.

    3. Re:Who has the biggest kitchen sink? by Anonymous Coward · · Score: 0

      And yet I'm sure in the next breath you'd complain that Perl was too complicated.

    4. Re:Who has the biggest kitchen sink? by flimflammer · · Score: 1

      So...the language should never advance in areas where it is lacking?

    5. Re:Who has the biggest kitchen sink? by Anonymous Coward · · Score: 0

      More like if you manufacture cars and then see how agile and quick motorcycles are, you should probably not attempt to improve your car either by slapping a motorcycle on to the side or cutting your cars down the middle. It's not to say you can't find inspiration from motorcycles to improve the design of your car (e.g., lighter weight), but let cars be cars and motorcycles be motorcycles and let the user pick the right tool for the job.

    6. Re:Who has the biggest kitchen sink? by elabs · · Score: 1

      It should advance legitimately instead of just copying other people's stuff. Java 8 is simply playing catch-up to C# at this point. They need to come up with their own ideas and contribute something new.

    7. Re:Who has the biggest kitchen sink? by Anonymous Coward · · Score: 0

      It's so much easier to figure out which of the 17 different programming language standards are being used when they're all called "Java" than when they're separate languages with different names.

      Oh wait, that's not remotely true.

    8. Re:Who has the biggest kitchen sink? by Anonymous Coward · · Score: 0

      Actually no, I quite enjoy Perl. I like it's inclusive and expressive nature, and for scripting purposes, it's still my go-to language. Python isn't bad, but it still feels somewhat wrong when I'm writing it.

    9. Re:Who has the biggest kitchen sink? by EvanED · · Score: 1

      I actually really like C# as a language, but if you want to accuse a language of just copying other people's stuff, well, glass houses and all....

      (LINQ is pretty cool though. I'm unaware of anything like it before, not to say there isn't one.)

    10. Re:Who has the biggest kitchen sink? by hey · · Score: 1

      I like Perl too but Perl5 has some bad stuff. You can't put the argument names in sub definitions, etc.

    11. Re:Who has the biggest kitchen sink? by flimflammer · · Score: 1

      I agree that Java is basically playing catch-up with C#, but I don't agree that taking concepts that are useful in C# and implementing them in Java which is a very similar language is illegitimate, unless they half-ass the implementation.

    12. Re:Who has the biggest kitchen sink? by flimflammer · · Score: 1

      That isn't even close to what is happening here, though.

    13. Re:Who has the biggest kitchen sink? by dkf · · Score: 1

      I like Perl too but Perl5 has some bad stuff. You can't put the argument names in sub definitions, etc.

      Still better than Perl4, which was completely demented in places.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
  6. Re:Gawd by antsbull · · Score: 0, Troll

    Java is a real language, and a lot of real programs have been written with it. It's not a good language, but that doesn't make it trivial.

    -jcr

    Its no better or worse than any other languages out there. If you think it is, then you probably need to get out of your mom's basement and into the real business world more.

  7. Re:Gawd by multiben · · Score: 4, Funny

    So you're saying that *all* programming languages are exactly as good each other then? Perhaps you are spending too much time in the "real" world?

  8. Re:Gawd by CastrTroy · · Score: 5, Insightful

    I would almost agree, that any language is as good as any other. With a few exceptions, like "whitespace" which isn't meant to be a practical language anyway. What really sets languages apart is the tooling that's built up around them. The debuggers, the IDE, the profilers, etc. Also, the consistency and extent of the standard API plays a huge role in how useful a language is. I would rather use Brainfuck with an amazing tools and a rich API than use Java, Python, or Ruby with bad tools and an inconstent and incomplete API.

    --

    Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
  9. Re:Gawd by cheesybagel · · Score: 3, Insightful

    Well its a mixed bag really. It is a lot more verbose than other recent languages. The type system is inane. The main advantage is you have binary portability across platforms and a really huge standard API to use.

  10. Re:Gawd by Anonymous Coward · · Score: 1, Insightful

    Yes, yes, real programmers use real machine code, because assemblers are for pussies and compilers are for faggots. You keep telling them! I'll be over here, earning money.

  11. Re:Gawd by Anonymous Coward · · Score: 0

    Java isn't a language, it's an operating system. And, no, I'm not just talking about the JVM. Java applications are utterly isolated from their environment. It's about as easy to get a Java program to interoperate with other Windows or Linux applications using basic system primitives as getting two applications on two different hosts to interoperate.

    Once you go Java, you get sucked in. Nothing matters outside of the Java world. If you don't like the language itself, you use other languages, like Scala, which are built on Java (no, not just the JVM, but the Java libraries, too).

  12. Re:Gawd by hey! · · Score: 5, Insightful

    Newsflash: People write major systems in Java that work pretty well. People do mission critical, bet-the-company stuff in Java, and it works. *Your* mileage may vary, but it always does.

    This doesn't mean it' the best choice for everything, because *nothing's* the best choice for everything

    And it doesn't mean Java doesn't have serious flaws. There's something deeply ingrained in Java that encourages over-engineering. But every language has its pitfalls.

    --
    Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
  13. Re:Gawd by Anonymous Coward · · Score: 1

    No, real programmers use butterflies

  14. Re:Gawd by Anonymous Coward · · Score: 0, Interesting

    http://www.paulgraham.com/avg.html

  15. Re:Fuck java! by Anonymous Coward · · Score: 0

    Theres just no way out of it for me aside from something serious. Like death

    Surely quitting your job and getting a new one is less serious than death.

  16. Re:JavaFX (the new Applet?) and Swing - anything n by viperidaenz · · Score: 1

    One new thing for JavaFX http://openjdk.java.net/projects/jdk8/features#153
    It's pretty minor.

  17. Java? by Anonymous Coward · · Score: 0

    Deleted from all systems at least a year ago. Why bother?

    1. Re:Java? by wmac1 · · Score: 3, Insightful

      Oh boy!! If that's what you understand of java...

      FYI, You are still using java every single day (as in websites using Java in server side, on phones, on smart cards, on home appliances, ...).

    2. Re:Java? by Anonymous Coward · · Score: 0

      home appliances

      People always bring this up, but I've never actually seen it. Show me one home appliance that is not a novelty item (like the KDE refrigerator) that uses Java. And by home appliance, I mean something like a blender, a toaster, or a microwave.

    3. Re:Java? by Anonymous Coward · · Score: 0

      You mean like all of my Blu-Ray players?

    4. Re:Java? by Anonymous Coward · · Score: 0

      Washing machines, Set top box, VCD/DVD players,

    5. Re: Java? by Anonymous Coward · · Score: 0

      From all systems? Now I know why your Android phone is broken!

    6. Re:Java? by Anonymous Coward · · Score: 0

      Seriously? Home appliances in java? It's really a myth, all I've seen so far is either asm or C. Ask Apple users how much java they have on their phones, or if you like counting numbers, how many dumbphones use java instead of other propietary clusterfuck.

    7. Re:Java? by prionic6 · · Score: 1

      I guess Java installed via java.com or such packages on PCs is going away. Most of the stuff in Java runs on a server anyway. Applets/JavaFX were never that useful. We still develop a desktop application in Java but are seriously considering just bundling a JVM with the app and be done with it. Btw. that's the only way to get a java app into the Mac App Store - Not that I have ever tried to do that.

      The only thing I will miss is Webstart - I really liked the concept.

    8. Re:Java? by wmac1 · · Score: 1

      ... translated to a completely different VM which partially makes up for at least one of Java's shortcomings - ridiculous lack of speed...

      You obviously don't know what you are talking about. I converted a huge simulation program from Java to C++ only to find that the java version had almost the same (sometimes better) performance.

      C++ compilers compile a generic executable which can run on every CPU. JVM adapts to the CPU capabilities and runs the byte code with better performance.

      Java is not slow (at least not slower than say C#, and even C++ in my case).

    9. Re:Java? by Anonymous Coward · · Score: 0

      Since when are mobile phones home appliances and even if they are, they are hardly the entire set.

  18. Re:Gawd by jcr · · Score: 1

    Its no better or worse than any other languages out there.

    That's the voice of inexperience, right there...

    get out of your mom's basement

    Gosh, what a clever quip. You must be positively venerable to be able to toss off a withering cutdown like that.

    -jcr

    --
    The only title of honor that a tyrant can grant is "Enemy of the State."
  19. Re:Nooooo by Anonymous Coward · · Score: 0

    Microsoft isn't sure what they're good at.

    Now, now, that's just not true. They know for sure that they are good at not selling Surface RT tablets.

  20. The old adage comes back and back by countach · · Score: 5, Insightful

    The old adage is always applicable: Those that do not use LISP are condemned to reinvent it. Badly.

    1. Re:The old adage comes back and back by Anonymous Coward · · Score: 1

      Is it even possible to make LISP worse?

    2. Re:The old adage comes back and back by manu0601 · · Score: 2, Funny

      Sure: reimplement it in Java. Even better, use it within J2EE so that it takes 45 seconds to start up.

    3. Re:The old adage comes back and back by Anonymous Coward · · Score: 0

      What fraction of your +1 mods have ever written so much as one expression in LISP?

    4. Re:The old adage comes back and back by Alomex · · Score: 1

      Except that no one ever said that. Santayana said that about history and Henry Spence paraphrased it with Unix, but no one said it about Lisp.

      In fact all the modern functional languages are remarkable in how much they are not like Lisp, starting from Scheme which managed to maintain the horrible parens notation but did away with almost everything else (dynamic scoping, no state, no control structures, no defun, etc.) and moving on to Python, Haskell and Scala.

    5. Re:The old adage comes back and back by ebno-10db · · Score: 5, Funny

      Sure: reimplement it in Java.

      That's called Clojure.

      Even better, use it within J2EE so that it takes 45 seconds to start up.

      They sped it up?

    6. Re:The old adage comes back and back by hibiki_r · · Score: 1

      Every expression must be surrounded by three parenthesis, and followed by a semicolon. Also, when you reach 5 levels of depth, the last element of a list of parameters becomes the function, instead of the first.

    7. Re:The old adage comes back and back by TFlan91 · · Score: 0

      Too bad this poster is AC, I'd be owning this call out.

    8. Re:The old adage comes back and back by AtlantaSteve · · Score: 1

      Python is a "functional language", a la Scala or Haskell? Not even its creator believes that...

      http://python-history.blogspot.com/2009/04/origins-of-pythons-functional-features.html

    9. Re:The old adage comes back and back by phantomfive · · Score: 2

      Clojure is Lisp on the JVM, not Lisp in Java. There's a difference.

      --
      "First they came for the slanderers and i said nothing."
    10. Re:The old adage comes back and back by Alomex · · Score: 1

      Not even I believe that. You are, so far, the only person to state that "Python is a functional language a la Scala or Haskell".

      Python is a rather interesting mixture of functional language constructs overlaid (nearly by accident) on top of an imperative language syntax. It is, in this sense, a rather unique and innovative modern functional language.

    11. Re:The old adage comes back and back by Anonymous Coward · · Score: 0

      Clojure is Lisp on the JVM, not Lisp in Java. There's a difference.

      Thanks for giving the subject some closure.

      Isn't Chloe Jure a Bond girl?

    12. Re:The old adage comes back and back by countach · · Score: 1

      The differences between Scheme and Lisp are really mere details, in the larger scheme of things. Dynamic scoping is (probably) a bad idea, but it doesn't change the basic nature of the beast. The similarities between Lisp and Scheme are WAY more than paren notation.

      People who whine about the paren notation don't seem to have grasped just how powerful the idea is. Yes sure, it can be hard to read for newbies, but the payoff is real.

    13. Re:The old adage comes back and back by Anonymous Coward · · Score: 0

      Python is not a functional language in any shape or form,
      Haskell and OCaml are modern functional languages.

    14. Re:The old adage comes back and back by delt0r · · Score: 1

      You know why i don't use lisp... Because almost no one learns it, and my code needs to be accessible and multi platform. That means i can really only choose between java,C and C++. I am keeping an eye on Julia... But everyone runs away from lisp because they don't like brackets. I remind them that C syntax just uses different types of brackets and extra syntax (semi colons etc). But still a lot of brackets...and syntax and stuff.

      --
      If information wants to be free, why does my internet connection cost so much?
    15. Re:The old adage comes back and back by Alomex · · Score: 1

      The differences between Scheme and Lisp are really mere details,

      Functions and variables live in the same namespace? Ready embracing of data structures other than a list? heavy use of scope? structure types? many control structures? Scheme is like a mature lisp that finally got over the initial excitement that lists alone are surprisingly powerful.

      People who whine about the paren notation don't seem to have grasped just how powerful the idea is.

      Are you serious dude? do you really think the power of lambda notation and list processing has anything to do with parens? Heck, a slightly more intelligent parser using carriage returns a la python can do away with more than half of the parens while underneath being 100% equivalent to Lisp, just like the C compiler is smart enough to treat

      if a==b

      as

      if (a==b)

      without asking you to explicitly add the unnecessary parens.

    16. Re:The old adage comes back and back by Anonymous Coward · · Score: 0

      The thing about Python that I like, is it is functional (if you want it to be), it is OO (if you want it to be), etc. you can do so many things in it, and most of it you can do much easier than in C/C++.

    17. Re:The old adage comes back and back by frank_adrian314159 · · Score: 1

      do you really think the power of lambda notation and list processing has anything to do with parens?

      No, but it does have everything to do with the ease of code transformation and transformation of input data to code. Come back and tell me how handy syntax is after writing about a dozen DSLs.

      --
      That is all.
    18. Re:The old adage comes back and back by Alomex · · Score: 1

      I don't know about a dozen, but three suffice?

      Perl supports the same transformation without hairy parens, so once again you are pissing outside the bucket.

      It is typical of people inexperienced programmers to confuse mere artifacts of Lisp with its true essence.

    19. Re:The old adage comes back and back by vilanye · · Score: 1

      Lisp is not a functional language. It is paradigm agnostic. Python has a little bit of features that support functional programming, Ruby has more but isn't a functional language either.

    20. Re:The old adage comes back and back by Alomex · · Score: 1

      Lisp is not a functional language.

      Lisp fits perfectly the main two definitions of functional language

      1) Functions are first class citizens that can be passed around

      and/or

      2) It attempts to avoid state as much as possible.

      [Personally I think definition 2 is wrong. That defines a stateless language, not a functional one, but let's stick to standard definitions for the time being].

      So now can you explain to us how come you don't think Lisp is a functional language?

    21. Re:The old adage comes back and back by Anonymous Coward · · Score: 0

      Not the OP.

      The only reason Lisp could be called that is because you can use it that way.

      If that is your only criteria than Ruby is a functional language.

      Come back when you understand functional language but by then you will understand Lisp is agnostic. It can be anything you want it to be.

      A purely functional language is stateless. Things like Monads just nail state into a functional program when needed. That is the whole point behind being referentially transparent.

  21. Re:Gawd by Anonymous Coward · · Score: 5, Insightful

    I think one of the big problems is that programmers are very much biased towards thinking that what should be considered matters of preference are absolute right/wrongs, and most of the differences between major languages themselves are simply matters of taste or convenience. It's why you can get almost any software engineer to tear apart someone else's code, even if the code is written as well or better than anything they've written: there's pretty much always small differences that the engineer will find offensive even though there's no practical impact.

  22. Re:Gawd by jythie · · Score: 4, Interesting

    That was my general thought. Most languages are pretty much interchangeable. What tends to set them apart is the ecosystem they exist in... not just in terms of the 'hard' things like libraries and tools, but the 'soft' things like how much of a developer community (and candidate pool) exists for any particular domain.

    Which kinda makes me wonder why language designers bother with these updated versions out side some fetishistic desire to make their language of choice more complicated. Though I guess it does help separate out the 'elite and in the know' from the 'newbies and outsiders'.... though I think C++ really takes the cake in that regard.

  23. Re:Gawd by nmb3000 · · Score: 2, Interesting

    Java is a brogrammer language. It's for people that find writing real programs, in real languages, too hard.

    Well consider this your lucky day! With Java 8 you can now write JavaScript to run inside of Java! Sayeth TFA:

    Netscape created a piece of software called LiveScript to allow for scripting on its Web servers. It decided to port it to its browser and needed a fancier name, so it licensed the Java trademark from Sun and called it JavaScript -- which would long promote the confusion that JavaScript had very much to do with Java. However, after the apAOLcalypse, some members of the 12 colonies of Netscape were not done and sought to continue Netscape's plan of rewriting their browser in Java. In order to do so, it needed to create an implementation of JavaScript in Java. Netscape called the project Rhino; as with turducken, ours is not to question but to enjoy.

    So just in case the seemingly unquashable confusion between Java and JavaScript wasn't bad enough, it's about to get worse. But I guess you can't blame Oracle -- they heard you like to use JavaScript and Java, so now you can JavaScript with your Java while you Java with your JavaScript. Or something. Plus throw in some Node.js bullshit for good buzzword coverage.

    While there are many places that it can be useful to run JavaScript from within Java....

    This is just plain bad.

    --
    "What do you despise? By this are you truly known." --Princess Irulan, Manual of Muad'Dib
    /)
  24. Re:Gawd by jythie · · Score: 1

    Yeah, that is one of the things that tends to drive me crazy about programming in Java. I am used to languages that can link with each other or at least work together, java seems almost pathologically isolating.

  25. Re:Gawd by jbolden · · Score: 1

    If you think that all programming languages are the same it is perhaps time you get out of your mom's basement and look at 60 years of efficiency studies which show much the opposite.

  26. Re:Gawd by Anonymous Coward · · Score: 0

    If you need all of those things to help you program better, maybe the language you're using really does suck.

  27. Re: Gawd by S.O.B. · · Score: 5, Insightful

    I used to work on a Java transaction processing application at a major financial institution that handled more than 1,000,000 transactions a day that consolidated data from Unix, mainframe and Windows systems. The transactions came from batch and online, client-facing applications that had five nines uptime requirements.

    I don't know, sounds major to me. And we had no more "major system problems" than any other app and less than most.

    It's not to say that Java is the answer to everything because nothing is. But it is definitely capable of doing the heavy lifting.

    --
    Some of what I say is fact, some is conjecture, the rest I'm just blowing out my ass...you guess.
  28. Guy Steele by Anonymous Coward · · Score: 1

    The old adage is always applicable: Those that do not use LISP are condemned to reinvent it. Badly.

    Not that I totally disagree with you, but that's an amusing statement given that Guy Steele helped to write the implementation of Java per invitation of Bill Joy.

    One must also remember the historical context when Java was created. A quotation from Steele on ll1-discuss: "We were not out to win over the Lisp programmers; we were after the C++ programmers. We managed to drag a lot of them about halfway to Lisp. Aren't you happy?"

    Given how mainstream Ruby, Python, and even JavaScript are now for "real" development, back in the day "real" programmers only used native binaries for "real" applications. Java managed to pull a lot of people towards the dynamic-ish side of things. Certainly Perl (and shell) was around for use by sysadmins and the like, but those guys weren't "real" programmers.

    IMHO, without Java being pushed as an alternative to C/C++, I don't think we would have gotten the renaissance of dynamic languages we have today; or, at the very least, it would have taken longer to get to the same point we are today. I say this as someone who has no great love for the language, but I have no trouble accepting its place in the evolution of languages in terms of technology and culture.

    1. Re:Guy Steele by ebno-10db · · Score: 2

      The email you cite also contains (quoting a previous email?) what I've long considered the real secret of Java's success:

      Java did not achieve acceptance based mainly on the
            features it has (or does not have). It was accepted because
            Sun expended a huge amount of effort (not to mention money)
            promoting Java and the things built from it, and wisely
            positioned it against the nightmare that is C++.

      The Guy Steele wrote:

      We were not out to win over the Lisp programmers; we were after the C++ programmers. We managed to drag a lot of them about halfway to Lisp.

      Halfway to Lisp? Other than GC, there isn't much about Java that's Lisp like. Guy was rationalizing.

      IMHO, without Java being pushed as an alternative to C/C++, I don't think we would have gotten the renaissance of dynamic languages we have today

      I think Moore's law had a lot more to do with it than Java. Computers are now fast enough and have enough memory that you can afford to write many things in languages that are slow and memory intensive.

    2. Re:Guy Steele by sourcerror · · Score: 1

      Halfway to Lisp? Other than GC, there isn't much about Java that's Lisp like. Guy was rationalizing.

      Reflection is pretty lispy, and C++ couldn't do it without some hacks (that were later standardized to RTTI).

    3. Re:Guy Steele by jbolden · · Score: 1

      I don't buy it. Java is a static typed language arguably moreso than the C's were. The LAMP paradigm is what created the dynamic languages by having huge numbers of people exposed to Perl-CGI and later PHP.

    4. Re:Guy Steele by jbolden · · Score: 1

      I agree. I'd argue that C++ is more LISP like than Java. Certainly if you look at the research.microsoft group which does great LISPy things with language they often port it over to C# as their "mainstream language test".

  29. Re:Gawd by ebno-10db · · Score: 5, Funny

    May you spend 100 years in purgatory, writing AI programs in COBOL.

  30. Re:Gawd by ebno-10db · · Score: 5, Funny

    Lisp may be an interesting language, but Lispers scare me. The glow in their eyes when they evangelize about the Mother of All Languages reminds me of Village of the Damned.

  31. Re:Gawd by ebno-10db · · Score: 1

    Do you have a cite for that? Serious question. I've never seen such a study and would be very interested.

  32. Re:Gawd by Atzanteol · · Score: 1

    Why are you all feeding the troll? Let the moderation work and ignore the asshole.

    --
    "Ignorance more frequently begets confidence than does knowledge"

    - Charles Darwin
  33. standardization != stealing by ChaseTec · · Score: 2

    Since when is standardization stealing? Do you think the Redhat/JBoss devs that wrote Seam complained when they were asked to create the CDI spec? Or when Gavin King (creator of Hibernate) worked on JPA? Maybe in some bizarro world standardization actually happens as technologies mature. You can look at the expert list of any of the JSR and see who these *thieves* are.

    --
    My Hello World is 512 bytes. But it's also a valid Fat12 boot sector, Fat12 file reader, and Pmode routine.
  34. Re:Gawd by antsbull · · Score: 1

    No, its just the realisation that if Java was a terrible language it would have died a long time ago. The financial services and banking industry that I work in - the only other services we have ever had to interop with in the last 12 years are Java or .Net based. If Java was such a rubbish language that would not be the case, although I suspect that due to you not really knowing any better you don't have a clue about the real world.

  35. Re:JavaFX (the new Applet?) and Swing - anything n by Anonymous Coward · · Score: 0

    thanks dude - yes, the one new JavaFX feature ("Enhance the java command-line launcher to launch JavaFX applications.") is pretty minor but that page you provided is very informative.

  36. Still 32GB barrier by michaelmalak · · Score: 2, Informative

    Java 8 is still limited to 32-bit array indexes, meaning, e.g. that arrays of doubles are limited to 32GB. Java won't get true 64-bit support until Java 9 in 2016.

    1. Re:Still 32GB barrier by Max+Threshold · · Score: 1

      So declare an array of 32GB arrays. :P

    2. Re:Still 32GB barrier by Anonymous Coward · · Score: 3, Funny

      Java 8 is still limited to 32-bit array indexes, meaning, e.g. that arrays of doubles are limited to 32GB. Java won't get true 64-bit support until Java 9 in 2016.

      32GB should be enough for anybody.

    3. Re:Still 32GB barrier by GodfatherofSoul · · Score: 3, Funny

      Why would you need an array longer than 2^32? Unless...wait, are you sequencing alien DNA????

      --
      I swear to God...I swear to God! That is NOT how you treat your human!
    4. Re:Still 32GB barrier by Anonymous Coward · · Score: 0

      Why would you need an array longer than 2^32? Unless...wait, are you sequencing alien DNA????

      You lack imagination. Broaden what you're talking about to scientific operations. Then at statistical applications, financial applications, data warehousing....any number of applications where sequentially running through a large data set or pre-allocating arrays is appropriate.

    5. Re:Still 32GB barrier by Anonymous Coward · · Score: 0

      Just wrap a native buffer (not sure if NIO buffers can handle >4G elements, but in doubt just write your own one). Is that super ugly? Yes. Is it a real barrier towards using Java in serious projects, say, sequencing alien DNA? Hell, no. And BTW there are worse flaws in the language than this one, and people can still get over it.

      But then I'm forced to write PHP at work so I can only shake my head in confusion about your "problems" ;)

    6. Re:Still 32GB barrier by Joviex · · Score: 1

      Java 8 is still limited to 32-bit array indexes, meaning, e.g. that arrays of doubles are limited to 32GB. Java won't get true 64-bit support until Java 9 in 2016.

      32GB should be enough for anybody.

      Great reference, if I had the points, I'd mod you up.

    7. Re:Still 32GB barrier by Anonymous Coward · · Score: 0

      Hopefully they'll also fix NIO buffers (e.g. ByteBuffer.allocateDirect() and RandomAccessFile.map()), which are also limited by 32-bit signed int indexes.

    8. Re:Still 32GB barrier by Anonymous Coward · · Score: 0

      If you need and index with 2^32, you are doing it wrong.

    9. Re:Still 32GB barrier by Anonymous Coward · · Score: 0

      Use sun.misc.Unsafe

    10. Re:Still 32GB barrier by countach · · Score: 3, Funny

      I'm sequencing alien DNA you insensitive clod.

    11. Re:Still 32GB barrier by msobkow · · Score: 1

      For example, it prevents you from reading a binary object larger than 2^32 into memory for subsequent manipulation or serving up from cache. With modern media files, it's quite possible (and even common) to exceed the 2GB file size limit of 32 bits.

      --
      I do not fail; I succeed at finding out what does not work.
    12. Re:Still 32GB barrier by Anonymous Coward · · Score: 0

      Java 8 is still limited to 32-bit array indexes, meaning, e.g. that arrays of doubles are limited to 32GB. Java won't get true 64-bit support until Java 9 in 2016.

      I'm surprised it's "Java 8", because I expected Oracle to rename it to "Java 12c"... but maybe they'll wait and make "Java 9" into "Java 13q" or whatever letter they pick next.

    13. Re:Still 32GB barrier by delt0r · · Score: 1

      Memory mapped files work in java. And they are pretty fast too. The OS does the caching for you and will do a better job than you anyway.

      --
      If information wants to be free, why does my internet connection cost so much?
    14. Re:Still 32GB barrier by Xest · · Score: 1

      Point is if you're in a job where you're dealing with that much data then you should also be competent enough to work round the limitation in one of a number of trivial ways.

      If that limitation is a real actual problem for you then you shouldn't be dealing with such large data sets anyway because you obviously lack the pre-requisite knowledge to do so.

    15. Re:Still 32GB barrier by msobkow · · Score: 1

      Point is it's a stupid hangover limitation from the 32-bit CPU era.

      --
      I do not fail; I succeed at finding out what does not work.
    16. Re:Still 32GB barrier by Xest · · Score: 1

      Many things in computing are stupid hangovers from bygone eras unfortunately.

    17. Re:Still 32GB barrier by vilanye · · Score: 1

      If you need a larger array than that, chances are that an array is not the correct data structure.

  37. Seems familar... by ndykman · · Score: 3, Informative

    I remember when C# and .Net first came out, it was noted that it was just borrowing (some said stealing) from Java. When C# first came out, I didn't see it as becoming a leader in new language features, but it is clearly is, as Java 8 addresses a lot of things that been part of C# for a while.

    Streams: Similar to IEnumerable and parts of LINQ (LINQ to Objects). Of course, IEnumerables are less strict on multiple enumeration (it may work). Being a bit more strict on this as Streams isn't a bad idea. Functional Interfaces; The article was light on details, but it seems to address the use cases that extension methods in C# addresses. Interesting that the body of the method appear in the interface. The ability for a class to override this default is a new idea, it will be interesting to see how this plays out. Not a bad way to go about this at all. Lambdas:Well, it's -> versus =>. I can't imagine the discussions that occurred over which one to choose.

    I'm not sure about the JavaScript in Java feature. But, I've always said being able to execute Scheme in .Net would be useful to me, so this something that MS may have to address down the road.

    For me, Java still needs some catching up in terms of parallel programming versus the Task Parallel Library (and the Dataflow Extensions). This is especially true with C# 5.0. Async and await are powerful language features. Personally, I'm still prefer C#. I like having first class generics, the full LINQ library (Expressions) and libraries like Reactive Extensions and Code Contracts (plus the static verifier) are nice features. But, all this in Java 8lis a step in the right direction. I just hope it isn't a case of too little, too late.

    1. Re:Seems familar... by hibiki_r · · Score: 4, Interesting

      More than reacting to C#, they seem to be reacting to other JVM languages that are just more attractive for any shop with experienced people.

        The JVM is often used to write large amounts of business crud: Take a parameter, query a database, process a list. Make a service call, transform the result into a slightly different list, merge the results with a different service, then return. You could write that kind of computation in a functional way using Groovy or Scala in half the number of statements. And if there's one rule for programming productivity is that the less statements you need to write, the faster the job can be written, and the less bugs you get.

      When the people using your virtual machine start migrating to other languages you do not control, you are at risk of having the people building the language just porting the language away to a different one, and poof, Java becomes obsolete. Therefore, Oracle just has to improve Java.

    2. Re:Seems familar... by elabs · · Score: 2

      C# was a fusion of Java, C++ and Delphi. Java 8 is just playing catch-up, sucking in all the innovation that the Microsoft guys have been doing over the past decade. I think you're right that Microsoft is innovating and blazing new trails at a much faster rate than Oracle can copy.

    3. Re:Seems familar... by ndykman · · Score: 1

      This is an good point. Certainly, the reason C# has these features is to address those cases you describe with less code. As you noted, getting parity with advances in languages like Scala, Clojure is important.

    4. Re:Seems familar... by Hypotensive · · Score: 0

      the less statements you need to write

      Fewer.

    5. Re:Seems familar... by Anonymous Coward · · Score: 1

      As you noted, getting parity with advances in languages like Scala, Clojure is important.

      Which is self-defeating of course, since these languages where touted as complex and dangerous. Now Java 8 validates the ideas of these languages, and more, it will actually lure a lot of developers into the functional land. All those developers will quickly recognize that what the got is just some ugly syntax.

    6. Re:Seems familar... by gbjbaanb · · Score: 1

      The JVM is often used to write large amounts of business crud: Take a parameter, query a database, process a list. Make a service call, transform the result into a slightly different list, merge the results with a different service, then return. You could write that kind of computation in a functional way using Groovy or Scala in half the number of statements

      unfortunately COBOL was invented to do these kind of operations with a handful of statements. The merge the list part is usually a single statement in COBOL.

      So Java is not as good as Cobol :)

    7. Re:Seems familar... by Anonymous Coward · · Score: 0

      The power of java nowadays lies in the myriad of third party frameworks anyway, if you lack something in parallel programming then I seriously would consider to have a look at third party libraries like Akka.

    8. Re:Seems familar... by Anonymous Coward · · Score: 0

      They are not even close to Groovy Scala or Clojure, still properties are left out, which is probably the biggest sin they have committed since version 1.0.
      I just wonder whats so hard about properties, both Groovy and Scala do it right also C# has done it properly.
      If you look at the myriad of setters and getters in Java code you will be amazed how much more readable a code with real properties is.

    9. Re:Seems familar... by Anonymous Coward · · Score: 0

      Everyone goes on about lambdas, but I have to say that as someone who writes a lot of C#, I've rarely found a use for them. They're just short-form anonymous delegates, which I could already use without ever needing to use a stupid-looking arrow thankyouverymuch. The same goes for LINQ. It's just a crappy, limited SQL syntax for developers that are too piss-poor at their craft to actually learn how to work with databases effectively. (You know the type... the ones that pull huge datasets into memory and search it row-by-row to find the one they want. LINQ is an enabler. Ugh.) Yes, yes, I know, it can be used to "query" other objects that support it. I have yet to find any of these that aren't already hooked up to a database with an actual query engine.

      Meanwhile, I use abstract classes all of the time, and "functional interfaces" are just a fancy name for abstract classes. Abstract classes cannot be instantiated. You define the class with any "base" methods, events, and other plumbing you want all of its derived classes to have. Then you add some "abstract" methods that force the derived classes to implement them. Just like an interface, but with common plumbing code included in it.

      Inheritance, as usual, makes it more complicated. Abstract classes can implement or ignore interfaces or other abstract methods that they inherit, so only the first concrete class has to implement anything defined in an interface or as an abstract method. But it's important to note that an abstract class inheriting from another abstract class or from an interface can implement those inherited methods. This also has the effect of satisfying the requirement "downstream" in derived classes. So you can build an entire class tree that implements an interface without needing to actually implement the interface outside of the abstract base class. This is great when you have to deal with some shitty "interfaces or die" library written by someone only familiar with Java (or ported directly from Java).

      In C#, there are few, if any, reasons to use an interface. Abstract classes can do almost everything an interface can do, and quite a bit more. They only lack "explicit implementation", which I have yet to find a really good use for in anything I do. I'm sure somebody needs it, and I don't mind having the tool at my disposal, but I just haven't ever needed it, ever.

      So welcome aboard, Java users. Functional interfaces are about to make your language a LOT more productive. Now you just have to wean people off of Java 6 and 7 to actually use the new hotness. Good luck!

    10. Re:Seems familar... by Anonymous Coward · · Score: 0

      I suggest you be quiet when you don't know what you're talking about.

    11. Re:Seems familar... by Hentes · · Score: 1

      Coming up with new features is easy, implementing them efficiently is the hard part, and C# is quite lacking in that even though it only has to target one platform.

    12. Re:Seems familar... by shutdown+-p+now · · Score: 1

      Functional Interfaces; The article was light on details, but it seems to address the use cases that extension methods in C# addresses.

      The article actually named this incorrectly. A "functional interface" in Java 8 is an interface with a single method - basically, J8 equivalent of a delegate type in C#.

      The default thingy is called a "default method", and there's no special term for interfaces having them. In effect, these make Java interfaces closer to traits (i.e. allow multiple inheritance of behavior).

      Streams: Similar to IEnumerable and parts of LINQ (LINQ to Objects).

      The big catch here is that they're still using interfaces with the same old Java generic model based on type-erasure. This, in turn, means that generic functions applied to a stream of primitives do a lot of boxing. To avoid that, they provide special-cased implementations for int, double etc, which have the same exact implementation for a specific primitive types. If you look closely at the samples in the article, you'll see that they call a function named mapToDouble. Note how C# doesn't need anything like that, since its generic Select<TSource, TResult> mapping method can handle primitives just as efficiently as any reference type.

      Also have a look at javadocs for the standard functional interfaces in Java 8. Note how many they needed just to cover int, long and double (and this still doesn't cover combinations like int+double).

    13. Re:Seems familar... by ndykman · · Score: 1

      Thanks for the clarification. The term really didn't make that much sense, but the default method does.

      And, it's true that C# approach to generics makes this kind of programming interface much simpler versus the new streams API.

    14. Re:Seems familar... by vilanye · · Score: 1

      With the possible exception of LINQ, what in the MS world is actually new?

  38. Re:Gawd by hedwards · · Score: 2

    That's sort of the point of the language. The ability to write once and not have to rewrite the entire thing because you're now on a different platform.

    Your complaint is sort of like complaining about how hard assembly is and how they should figure out how to make it more easily read and do things for you.

  39. Re:Gawd by Coryoth · · Score: 5, Insightful

    And it doesn't mean Java doesn't have serious flaws. There's something deeply ingrained in Java that encourages over-engineering. But every language has its pitfalls.

    I don't think there's much in Java the language that encourages over-engineering; it's more in the community that surrounds Java. It's in the tutorials, and books, and code examples and discussion groups . It's in the frameworks and libraries.

    The reality is that a "language" is as much shaped by the community that grows up around it as by the actual language itself. Perl doesn't have to be particularly unreadable, but the culture that grew up around perl in the late 90's that was obsessed with cute hacks, fewest keystrokes, and self created obscurity created a state where anyone learning perl was immersed in that culture and came out writing a lot of unreadable stuff. It is my understanding that since many of those programmers left perl for other languages perl has been remade as "Modern Perl" which is largely the same core language, just with a different and libraries, and is quite readable.

    Conversely python can be made quite diabolical (just through together chains of nested list comprehensions and single character variables for example), but because it grew up with a culture of "one obvious way to do it" and readability most code you'll see tends to eschew such things, and strive to read like pseudo-code. Again, there's not that much inherent in the language, it's the cultural conventions surrounding the language that enforce much of that.

    Java fell in with the Enterprise crowd, and consequently found itself immersed in a culture obsessed with design patterns and over-engineering. Had things gone a little differently with, say, in browser applets somehow becoming the primary driving force for java (let's assume they ran better say) then I doubt java would be known for over-engineering.

  40. Re:Fuck java! by hedwards · · Score: 1

    He's stuck on an island where there's only one job, and if he doesn't work he doesn't eat. Also, he can't get the job back if he quits.

  41. Re:Gawd by Anonymous Coward · · Score: 1

    Lisp is the perfect example of CastrTroy's point -- for a long time the interesting development tools were proprietary, expensive, and obscure. Supposedly things have improved now, but lisp wasn't very practical to use for anything other than emacs.

  42. Re:Gawd by jcr · · Score: 1, Flamebait

    No, its just the realisation that if Java was a terrible language it would have died a long time ago.

    Your optimism is astonishing.

    you don't have a clue about the real world.

    I spent most of the 90's working on Wall Street, and in Chicago at the Board of Trade. JP Morgan, Salomon Brothers, Phibro Energy, and UBS/Warburg. Since leaving the financial industry, I've been working in the Silicon Valley, much of that time being spent at what is now the most profitable technology company in existence.

    But, if as you say I don't have a clue about the real world, I suppose I'll have to bow to your superior intellect and settle for Java as you have. How depressing.

    -jcr

    --
    The only title of honor that a tyrant can grant is "Enemy of the State."
  43. Optimized for Minecraft? by charlesjo488 · · Score: 0

    That's the real question.

  44. Re:Gawd by gnupun · · Score: 5, Insightful

    I would almost agree, that any language is as good as any other. With a few exceptions, like "whitespace" which isn't meant to be a practical language anyway.

    This is a false statement, they are not as good as the other. Each language is designed to be strong in certain areas while weak/ignoring other areas. As an example, C promotes code close to machine language while Java shields the programmer from manual memory management (GC). There are many such design issues that make a language a natural fit for certain applications while making other languages ill-fitted.

    What really sets languages apart is the tooling that's built up around them.

    While tools may be important, they are of a secondary importance.

  45. Re:Gawd by Anonymous Coward · · Score: 0

    No matter how much money Apple makes, Objective-C is still a crappy language.

  46. After years of saying java didn't need C# features by elabs · · Score: 1, Troll

    After years of saying java didn't need C# features they go and steal tons of them from C#! Whether it's properties, lambdas, function pointers or async/await, the Java community has always insisted that those features weren't necessary and that Java was no worse for omitting them. Now they go and steal them and put them into their products and everyone will declare them innovative new Java features. Last month it was Apple stealing the "Metro" UI from Windows Phone. Now this. Is Microsoft the ONLY company doing anything innovative anymore?

  47. Re:Fuck java! by binarylarry · · Score: 1

    He also apparently has ADD.

    --
    Mod me down, my New Earth Global Warmingist friends!
  48. Re:Gawd by jbolden · · Score: 1

    Sure the classic discussion is in Mythical Man Month. Here (http://sequoia.cs.byu.edu/lab/files/pubs/Delorey2007a.pdf) is a paper from 2007 which has references to many of the classic discussion. And Brooks I believe cites the original FORTRAN vs. assembler tests.

  49. Stealing? by greg_barton · · Score: 2

    So if another framework or language has a certain feature Java isn't allowed to have them?

    Really?

    1. Re:Stealing? by Anonymous Coward · · Score: 1

      > So if another framework or language has a certain feature Java isn't allowed to have them?

      The issue isn't so much whether Java has those features, but that they're stolen from other languages, such as Lisp and C#. We're talking about theft here. If Oracle manages to get away with this, C# will have to do without real closures, LINQ and all the others and/or Microsoft will have to re-invent them to replace the stolen ones.

      The situation is even worse for Lisp which doesn't have the Behemoth behind it that is Microsoft, so it's basically up to a few small companies and the community to re-invent those language features, and there's a realistic chance that Lisp will become too uninteresting to revive it.

    2. Re:Stealing? by greg_barton · · Score: 1

      Is there an intellectual property claim over those features?

    3. Re:Stealing? by Anonymous Coward · · Score: 0

      > according to the Microsoft meaning of the word. This means stealing a lot of things that have typically been handled by other frameworks and languages, then incorporating them into the language or runtime (aka standardization)

      This is not what MS innovation means. Making up a nonsensical definition, is flamebait.

      Someone actually posted:

      > The issue isn't so much whether Java has those features, but that they're stolen from other languages

      jesus this synopsis is stupid and the discussion is braindead....

    4. Re:Stealing? by Anonymous Coward · · Score: 0

      Yeah it's funny when someone comes up with a new language that appears to be just going out of its way to be unique and different from what's already out there, slashdotters pan it as well.

  50. I wonder.. by Anonymous Coward · · Score: 0

    How much sh*t will break because of Java 8. My current employer of choice still has a core application which requires Java 6 and IE8..

  51. Re:Gawd by Anonymous Coward · · Score: 0

    No, you're not clueless. But you do have an overabundance of ego.

  52. Re:After years of saying java didn't need C# featu by Anonymous Coward · · Score: 0

    It's not stealing from C#. Lisp had many of those features and more as early as the 1960s. Lexical closures, anonymous functions (lambdas), first class functions (i.e. function pointers), garbage collection, all of that was pioneered by Lisp. They are hardly new. John McCarthy and his colleagues invented them decades ago.

  53. Unsigned by jbolden · · Score: 3, Informative

    I'm not sure how that connects to the GPs request. Anyway Gosling didn't include it because the behavior aren't defined in CPU independent ways.

    32-unsigned 0 minus 32-unsigned 1 = ?
    where ? is CPU dependent. Some you'll 0xFFFF other 0x8001 others 0xFFFE. That's precisely the sort of thing JAVA was designed to abstract away. And if you don't want unsigned to be doing raw CPU arithmetic on primitives then you can just use a library.

    1. Re:Unsigned by aztracker1 · · Score: 2

      How is int_minvalue - 1 handled? In .Net without an unsafe directive, it does bounds checking on the result and raises an exception.

      --
      Michael J. Ryan - tracker1.info
    2. Re:Unsigned by 0123456 · · Score: 1

      A computer language that can't natively handle unsigned bytes without extending them to 16-bit ints is pretty freaking dumb. Lack of unsigned types is one of the biggest annoyances we have with Java.

    3. Re:Unsigned by smittyoneeach · · Score: 1

      Gosling didn't include it because the behavior aren't defined in CPU independent ways.

      I don't follow this argument. The JVM is a "virtual" machine, no? Wouldn't offering consistent handling of unsigned types be a selling point of such?

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    4. Re:Unsigned by jbolden · · Score: 1

      For signed arithmetic JAVA uses CPU primitives. The result is that arithmetic operations happen often in 1 or a few simple operations (on a 3GHZ processor a simple operation = .33 nanoseconds). What I was saying above though is that these are done in CPU specific ways. Basically if you offer primitive unsigned ints you allow for some flexibility at the expense of introducing CPU specific behaviors which diminish cross platform.

        It is easy to offer a unsigned types on the JVM, that's not an issue. But there is no particular reason to build that into the language you just build libraries that handle it if you want them. Unsigned ints would just be like any other non-CPU supported object with an arithmetic structure. However, if unsigned are virtualized, you could be looking at performance of 1/100th of the CPU.

    5. Re:Unsigned by jbolden · · Score: 1

      Java is cross platform. Unsigned arithmetic isn't cross platform. If you want primitive behavior that varies by platform in a language a lot like Java, C++ will be happy to speak to you.

    6. Re:Unsigned by jbolden · · Score: 1

      Which is very slow. If you are going to do that sort of stuff why not just use a library why do you need it built in?

    7. Re:Unsigned by Anonymous Coward · · Score: 1

      Read the C standard some time. The unsigned types are the ones that generally behave exactly the same in all cases, including overflow, underflow, division modulo.
      The signed types are the ones that are different for each CPU.
      Congratulations on your ignorance.

    8. Re:Unsigned by jbolden · · Score: 1

      The well defined unsigned types in C quite often aren't primitives. They are a library though one built into the compilers.

    9. Re:Unsigned by Anonymous Coward · · Score: 0

      I'd really like an example, because in the real world they really aren't. At worst for architectures that do not allow byte-wise access to registers you need to do an extra &. But that still affects only the overflow case, which is far worse for the signed type (mostly due to the - admittedly rare - architectures using one's complement).

    10. Re:Unsigned by smittyoneeach · · Score: 1

      OK, so you're making the pragmatic point that, yeah, it's a virtual machine, but the expense of some operations could be prohibitive.
      I'm good with that, but I still want to laugh about how our mighty JVM is really kicking the "M" in the groin here, and reducing itself to a "common" scripting engine.

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    11. Re:Unsigned by jbolden · · Score: 2

      Take a look at any CPU architecture where the addition or subtraction isn't defined the same as the standard. The "addition" used by the C compiler is a short function. Similarly for subtraction... Just look at the assembler.

      A lot of this conversation happened in the late 1980s during the X3J11 meetings in places like the discussion of limits.h as far as the standard. I'd say Plauger's book is a good source I don't know what's online.

    12. Re:Unsigned by jbolden · · Score: 2

      Java has found some masterful ways of getting performance well above scripting engines for some things. They might have been able to pull it off with weird unsigned types. But ultimately the reason for C to have all these complex binary types is they encourage bit level thinking about programs. Java for safety reasons can't. I don't really see how a primitive unsigned type is useful for anything other than speed. Generally what people want unsigned for would be better to implement the way .NET does it where you get reach features so that 3 - 7 throw an exception rather than say returning 4 billion or 2 billion or something.

    13. Re:Unsigned by Anonymous Coward · · Score: 0

      I was asking for an example for a reason. Yes, for 8-bit microcontroller add/subtract will be multiple instructions (but certainly not a function call with any sane compiler). However for all those cases, the signed operations are _at least_ as complex as the unsigned ones.
      Even on x86 you can see the issue when doing e.g. a / 4, for unsigned this is translated to a simple shift, for signed it is much more complex (unless your CPU has a integer division unit).

    14. Re:Unsigned by Anonymous Coward · · Score: 0

      Overflow. Exceptions are expensive operations, I don't know if I want that type of bounds checking to be performed on primitives.

    15. Re:Unsigned by krischik · · Score: 1

      Not that slow. Most CPUs do that out of the box employing an overflow or carry flag.

    16. Re:Unsigned by jbolden · · Score: 1

      You should talk to the guy whose saying most CPUs do rollover as per the C definition.

    17. Re:Unsigned by krischik · · Score: 1

      Why should that be? All CPU I worked with had both signed and unsigned arithmetic.

    18. Re:Unsigned by frank_adrian314159 · · Score: 1

      The only correct response is to throw an exception. Yes, it sucks. But it is the only correct response.

      Plus, you're running on a VM already. It's not like the checking overhead is that great - you probably get an over/underflow indication from the ALU on an unsigned subtraction or addition if your hardware designer wasn't a complete idiot. In fact, you should be doing the same check for signed integers unless your language designer was a complete idiot - especially in a VM environment. But I guess you'd prefer your program to give you incorrect results slightly more quickly... Let me avoid your software, please.

      --
      That is all.
    19. Re:Unsigned by jbolden · · Score: 1

      They don't have the same unsigned arithmetic. C wants a defined standard so the compiler has to often implement as a short function not a primitive operation.

    20. Re:Unsigned by jbolden · · Score: 1

      Java supports that in a library fine. Not an issue.

    21. Re:Unsigned by shutdown+-p+now · · Score: 1

      In .Net without an unsafe directive, it does bounds checking on the result and raises an exception.

      .NET by itself doesn't have any "unsafe directive". The IL has two opcodes for each arithmetic operator, one with overflow checking and one without - e.g. add.ovf and add. Their use is explicit in any particular instance.

      Now C# has "checked" and "unchecked" blocks and expressions. The default is actually unchecked (so overflow wraps around), but if you wrap your expression with checked(), or it is (lexically) inside a checked{} block, then there is an exception on overflow. unchecked() works in reverse, disabling overflow checking if outer scope has it enabled. The default setting at global scope is unchecked, but that is a compiler switch that can be changed (which is probably a bad idea, as most C# programs are written assuming unchecked-by-default).

      "unsafe" is something else entirely. It is, again, a C#-specific language feature that permits the use of raw pointers and some other language features that circumvent the runtime verification layer and GC.

    22. Re:Unsigned by shutdown+-p+now · · Score: 2

      That makes no sense. How exactly is unsigned arithmetic not cross platform? It's the most basic arithmetic that any CPU can support!

      If you mean that wrap-around isn't cross-platform, then it isn't for signed arithmetic, either. In fact signed is less portable because there are more possible binary representations of it compared to unsigned.

    23. Re:Unsigned by shutdown+-p+now · · Score: 1

      Name a single C compiler that does that.

      While you're at it, name a single CPU architecture that doesn't support basic unsigned arithmetic with wrap-around, as defined by C99 spec.

    24. Re:Unsigned by jbolden · · Score: 1

      Wrap around is more likely to happen. 3 - 7 happens a lot. 1.2billion + 2 billion not so much. Anyway that's the reason Gosling didn't do it.

    25. Re:Unsigned by shutdown+-p+now · · Score: 1

      So what? Unsigned wraparound is extremely portable. It was, in fact, sufficiently portable that C89 required it for unsigned chars, and C99 required it for all unsigned types (because the committee couldn't find any living platform which did not allow for highly efficient, single-opcode unsigned arithmetic).

    26. Re:Unsigned by jbolden · · Score: 1

      I wasn't part of the X3J11 committee. I don't know. The issues with it are in the c-spec. I'm considering that an authoritative source. Feel free to do your own research beyond that. I'll take there word for it there was a problem.

      That being said I know that even x86 violates the standards in several places. INT_MIN div -1 is supposed to be 0 but it yields SIGFPE. As for a compiler that does this correction. Microsoft Visual Studio 2005 which had a comment on this specific issue.

    27. Re:Unsigned by shutdown+-p+now · · Score: 1

      You just gave an example of signed wraparound being non-standard across platforms, which is a well-known fact (hence why C99 does not require it in the standard). I was asking for an example of unsigned wraparound behaving differently.

      In any case, if the decision to exclude unsigned from Java was done for the sake of portability, then they should have excluded signed as well (first, in fact) on the same grounds.

    28. Re:Unsigned by vilanye · · Score: 1

      They also abstracted away integer overflow in the sense that they ignore it and there is no easy way to detect if it happened.

  54. Re:Gawd by Anonymous Coward · · Score: 4, Insightful

    Lisp is the perfect example of CastrTroy's point -- for a long time the interesting development tools were proprietary, expensive, and obscure.

    That's not the real problem with Lisp, Smalltalk etc though.

    The real problem is that you don't get to benefit from their strengths unless you live completely in their environment. Working with Lisp in a C* based world is like driving a car in the ocean.

  55. Love and hate for java 8 by Tooke · · Score: 1

    Stop rhyming, and I mean it!

    --
    Anybody want a peanut?
  56. Greenspun's 10th rule by subreality · · Score: 1

    "Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp."
    http://en.wikipedia.org/wiki/Greenspun's_tenth_rule

  57. Re:Gawd by jmhobrien · · Score: 1

    We each have a finite amount of time.
    Time spent learning the electronic implementation of every CPU is time I can't spend solving "real" problems.

    --
    Where is moderation: -1 False?
  58. Just switch to Scala and be done with it. by Anonymous Coward · · Score: 0

    It's a much better designed, more modern language, and as an added bonus it runs on the JVM, and integrates with a lot of the tools that Java devs are already familiar with.

  59. Scheme in .NET by zjbs14 · · Score: 2

    In case you weren't aware of it: http://ironscheme.codeplex.com/

    --
    No sig, sorry.
    1. Re:Scheme in .NET by EvanED · · Score: 1

      There's also a CLR (.Net) version of Clojure.

      My personal preferences put Clojure as a clear winner over Scheme overall from a language perspective (there are things I like about Scheme better of course, but they are outweighted in other areas), though I can't compare implementations.

  60. Re:Gawd by phantomfive · · Score: 1

    Java is a real language, and a lot of real programs have been written with it. It's not a good language

    It's very good at what it's designed for, which is keeping your co-worker from messing things up too badly. Every language has a purpose.

    --
    "First they came for the slanderers and i said nothing."
  61. Re:Gawd by tlambert · · Score: 2, Insightful

    I would almost agree, that any language is as good as any other. With a few exceptions, like "whitespace" which isn't meant to be a practical language anyway. What really sets languages apart is the tooling that's built up around them. The debuggers, the IDE, the profilers, etc. Also, the consistency and extent of the standard API plays a huge role in how useful a language is. I would rather use Brainfuck with an amazing tools and a rich API than use Java, Python, or Ruby with bad tools and an inconstent and incomplete API.

    I think it would be very difficult to convince Terumo Cardiovascular Systems to build their next blood gas monitor system, or any of their medical devices, on a Java substrate. I think it would be difficult to convince Radiometer Inc. to base their next portable point of care immunoassay system on a Java substrate. I will go further: I doubt you could get any company working on life support systems of any type to trust Java enough to use it as a substrate.

    Java is not suitable for a great number of applications, and, indeed, any language that uses a runtime system, and is either interpreted or JIT'ed, or not, is unsuitable for those applications.

    For those applications, you need a language that compiles to ROMable machine code.

    For applications like industrial control systems, both in manufacturing, and, again in life support, such as the control systems in nuclear facilities - or even coal-fired facilities, if they happen to have their output powering a pediatric ICU, any garbage collected language is unsuitable, since there is very little control, without infinite memory available, on when a GC will run. You can not implement hard real time in a GC'ed language.

    For those applications, Java is unsuitable.

    There are some languages suitable for those applications: assembly, C, Ada, FORTRAN, C++ (if you disable RTTI and certain aspects of polymorphism, and use an older version, rather than the current draft standard version). There are others, but they are infrequently enough practiced that they would be suspect, both in their mathematical provability, and in their ability to be audited for coding errors.

    So No, any language is NOT as good as any other. Not even close.

  62. Re:Gawd by oldhack · · Score: 2

    Java was a GOOD language, because before we had C++.

    --
    Fuck systemd. Fuck Redhat. Fuck Soylent, too. Wait, scratch the last one.
  63. pointless by stenvar · · Score: 2

    The basics still are wrong: generics still are slow and poorly implemented and Java still is bad for numerical apps.

    1. Re:pointless by DetriusXii · · Score: 1

      Well, to be fair, generics are also poorly implemented in C#. If scala can use higher order generics like Haskell can, there's no reason why C# and Java shouldn't be able to.

    2. Re:pointless by benjymouse · · Score: 1

      Well, to be fair, generics are also poorly implemented in C#. If scala can use higher order generics like Haskell can, there's no reason why C# and Java shouldn't be able to.

      I'm curious. C# avoided the stupid type-erasure mistake (one that has come back to bite Java, *especially* during the Lambda-J discussions). C# has define-site variance as opposed to use-site variance. What exactly is your problem with C# generics?

      --
      Reading slashdot one-liner: (irm http://rss.slashdot.org/Slashdot/slashdot).rdf.item | fl title,desc*
    3. Re:pointless by stenvar · · Score: 1

      The problem with generics in Java is their piss-poor implementation in the JVM. Scala's generics are just as bad because they use the same JVM.

    4. Re:pointless by DetriusXii · · Score: 1

      Well, to be fair, generics are also poorly implemented in C#. If scala can use higher order generics like Haskell can, there's no reason why C# and Java shouldn't be able to.

      I'm curious. C# avoided the stupid type-erasure mistake (one that has come back to bite Java, *especially* during the Lambda-J discussions). C# has define-site variance as opposed to use-site variance. What exactly is your problem with C# generics?

      You only have generics of the first kind in C#, so implemented things like monad transformers become difficult. A higher order generic can box an inner generic. Say if you had something like with the higher order generic boxing in the inner generic. That's not possible in C# and in F#. new Foo { G member = new G(); } A more concrete example of a .NET class that would be G : System.Collection.Generics.List such that G : System.Collection.Generics.List. But you can't pass G around freely and then box it in later. You can only have G an instance of A so new Foo { System.Collections.Generics.List member = new System.Collections.Generics.List() } is not possible.

    5. Re:pointless by DetriusXii · · Score: 1

      Need to fix some things because of the use of brackets You only have generics of the first kind in C#, so implemented things like monad transformers become difficult. A higher order generic can box an inner generic. Say if you had something like with the higher order generic boxing in the inner generic. That's not possible in C# and in F#. new Foo { G member = new G(); } A more concrete example of a .NET class that would be G : System.Collection.Generics.List such that G<A> : System.Collection.Generics.List<A>. But you can't pass G around freely and then box it in later. You can only have G an instance of A so new Foo<System.Collections.Generics.List, A> { System.Collections.Generics.List<A> member = new System.Collections.Generics.List<A>() } is not possible.

    6. Re:pointless by benjymouse · · Score: 1

      Fair enough. So you seem to think that C#s implementation does not go *far* enough - that it is *lacking* features. I would also like to see proper currying and more functional constructs. I also would like trais. However, language design is not the discipline of cramming in every potential useful feature you can think of.

      Proper language design also has a very important pragmatic dimension: How will the feature be used, what is the balance between the complexity it introduces and the value it will add to the domain that is targeted by the language.

      That is a legitimate discussion, and frankly, my book is still open on generics variance. While I believe that I understand it, I can tell you that there are a lot of developers who simply avoid the topic because it is complex and hard to wrap your head around.

      In the case of generics I believe that it is a conscious decision. Microsoft/Anders Hejlsberg have on several occasions stated that they do *not* add features unless it is driven by some very specific use case that will demonstrably ease development (directly or indirectly) for the majority of users. Java language designers have also been cautious (perhaps too much), but where they have not, the experience should be a warning. Nowhere is that more evident than with checked exceptions. That *exactly* is an example of a language feature which is theoretically correct (if a little verbose and cumbersome), but when tested in real life with real programmers falls flat.

      In other words: I don't buy your premise that because *you* believe that some feature should have been implemented, then somehow the language is "poorly implemented". Frankly, that is a elitist and somewhat ignorant position, and I hope the language designers of both Java and C# have more sense than that.

      The primary responsibility og language designers when opting to *not* implement a specific feature (e.g. higher order generics) is to not *prevent* it from being implemented at some later point in time. That would be "poorly implemented".

      It is in that sense that Javas generics are "poorly implemented": They way they have been implemented precludes them from becoming real reified generics in the future, and the problems with type erasure are real, not least evidenced by the problems designing and implementing lambda expressions in Java 8 (btw, *exactly* because of a combination of type erasure and checked exceptions Java 8 will still not have real closures).

      C# generics started out with generics without variance. Only in the next version were proper define-site variance cautiously implemented. But C# also has design mistakes (that I believe Anders Hejlsberg would readily admit), like e.g. variant arrays (impedance mismatch with collections), the delegate syntax for anonymous methods (since superceded by the more expressive lambda expression syntax), nullability (why are reference types always implicitly nullable?).

      --
      Reading slashdot one-liner: (irm http://rss.slashdot.org/Slashdot/slashdot).rdf.item | fl title,desc*
    7. Re:pointless by Anonymous Coward · · Score: 0

      How can generics, which does no more than provide compile-time annotation, cause runtime slowdowns?

    8. Re:pointless by Anonymous Coward · · Score: 0

      Generics don't even exist at runtime, so how can they be slow? Love it or Hate it Java puts backwards compatibility above all else and a true generics implementation would have violated that principle.

    9. Re:pointless by shutdown+-p+now · · Score: 1

      nullability (why are reference types always implicitly nullable?).

      Because reference types are not required to have a default constructor, yet on the other hand you need some sort of sentinel value to default-initialize things like array elements and class fields. This is a solvable problem, but it requires significant language redesign in other areas. For example, it would require a change to initialization rules such that it would never be possible to read an uninitialized reference-typed field of a class - so no circular class dependencies - and would require the dynamic type of object to change during construction, a la C++, to avoid calling overrides from base class constructors.

    10. Re:pointless by vilanye · · Score: 1

      Use JRuby where generics are irrelevant."What bugs me about operator overloading is how tediously verbose it can get. For example, say you define operator functions for < and ==. You still have to do <="


      Only if you are using a stupid language

      In ruby all you have to do is mixin Comparable into your class , define the <=> method and you get <.>,==,<=,>=, between? methods for free.

      Note, that I didn't say operator. Ruby does not support operator overloading( you can't overload the operator = fer instance) +,-,*./,etc are also methods not operators.

  64. Re:After years of saying java didn't need C# featu by Anonymous Coward · · Score: 0

    You stupid twat. Don't think for one second that C# invented any of those features. Those features existed long before MS ripped off Java.

  65. Re:Gawd by Anonymous Coward · · Score: 0

    7 years of pro development in Java followed by 6 years in C, and I find that even memory management -- that hugely feared thing -- is just a matter of preference. If you're writing unstable code that crashes in C, you're going to write shitty code in Java, and you need to learn whichever language well enough and write meticulously enough to avoid that.
     
    I would agree with the grandparent that it's the tools and support around the language that determine what to choose, at least for anything past a very quick project (e.g., academic display, quickie iOS app.) Hell, lack of auto-complete in an IDE would probably enough for me to disallow a language outside of very special circumstances.

  66. Re:Gawd by viperidaenz · · Score: 1

    The debuggers, the IDE, the profilers, is completly irrelevant to programming. I never used one before, I debug with print statements

    So you've just outed yourself as one of the amateurs in your first paragraph. Congrats.
    Everything else you say after that should be disregarded as gibberish.

  67. Re:Gawd by viperidaenz · · Score: 3, Informative

    A lot of medical devices are built using Java.
    First Google result: http://www.oracle.com/us/technologies/embedded/embedded-java-for-healthcare-433550.pdf

    It's been used in medical devices since the late 90's, shortly after it was invented.

    For those applications, Java is purpose built.

  68. Re:Gawd by viperidaenz · · Score: 1

    Have a look at SWT.

  69. Java? by cyberthanasis12 · · Score: 1

    After Oracle's suit against Google about Java, I am not going to touch Java again.

  70. Re:After years of saying java didn't need C# featu by nitehawk214 · · Score: 2, Insightful

    After years of saying java didn't need C# features they go and steal tons of them from C#! Whether it's properties, lambdas, function pointers or async/await, the Java community has always insisted that those features weren't necessary and that Java was no worse for omitting them. Now they go and steal them and put them into their products and everyone will declare them innovative new Java features. Last month it was Apple stealing the "Metro" UI from Windows Phone. Now this. Is Microsoft the ONLY company doing anything innovative anymore?

    Right, lets pretend Microsoft invented all of those things.

    --
    I'm a good cook. I'm a fantastic eater. - Steven Brust
  71. Re:Gawd by GodfatherofSoul · · Score: 1

    Java is a *very* good language with a great syntax. C is a great language with a great syntax. C++ has a very poor syntax that gives developers far too much rope to hang themselves with, though its ubiquity makes it powerful. While the typical novice programmer will blindly assume that "harder to use" means "better" and "easier to use" means "for bad programmers," all it takes is one look at Programming Research High-Integrity C++ Coding Standard Manuals juxtaposed with most C++ code you see in the wild to understand that "harder" means "more likely to contain bugs."

    I've been on Slashdot for 10+ years reading posts from young, brash coders pounding their chests and extolling the superiority of C++ and sneering at Java development. And, I've read enough code to know how wrong they are.

    --
    I swear to God...I swear to God! That is NOT how you treat your human!
  72. Re:Gawd by jcr · · Score: 1

    If you believe that, then by all means settle for something less.

    -jcr

    --
    The only title of honor that a tyrant can grant is "Enemy of the State."
  73. Re:Gawd by Anonymous Coward · · Score: 0

    Seriously, this entire thread is one of the best examples of why I hate both my industry and coworkers. It's just a horrible culture filled with petty superficial people.

  74. Java 6 here by Billly+Gates · · Score: 1

    After the disaster known as Java 7 I see no reason to change.

    Java 6 works just fine thank you very much and will use it for many more years to come!

    Java 7 had so many security vulnerabilities and with 6 I do not have to worry about shit breaking like the Android SDK and malware attacks that 7 has. I cringe thinking about the changes java 8 will include.

    1. Re:Java 6 here by Saija · · Score: 1

      Please can you point me to those features that make Java 7 a disaster?
      Seriously! I've been using Java 7 since it's early betas and appart from that humongous security holes I don't see nothing bad with this version.

      --
      Slashdot ya no es que lo era! ;)
  75. Re:Gawd by EvanED · · Score: 1

    I don't think there's much in Java the language that encourages over-engineering; it's more in the community that surrounds Java.

    I would suggest that it's in between, at least if you consider the contents of the java.blah package part of "Java the language". There are plenty of bits in that which are grossly overengineered... just look at how much crap you have to do in order to carry out simple tasks like file I/O or reading a line of input. It's not a ton in an absolute sense, but it's several times as much code as what "should" be required (according to me).

  76. Re: Gawd by 0123456 · · Score: 1, Funny

    I used to work on a Java transaction processing application at a major financial institution that handled more than 1,000,000 transactions a day that consolidated data from Unix, mainframe and Windows systems. The transactions came from batch and online, client-facing applications that had five nines uptime requirements.

    I don't know, sounds major to me.

    That looks like only 12 transactions per second to me. But then, I guess that's about all Java can handle between garbage collections.

    More seriously, we use Java for various server systems with high uptime requirements, but there's usually C++ stuffed in there to handle the performance-critical parts.

  77. What's the realistic alternative? by SpaghettiPattern · · Score: 2

    What's the realistic alternative to Java? Java is good enough and the main gripe is that Oracle is loosing the trust that Sub Microsystems built up.

    C# just isn't for political reasons. Financial institutions are very influential in programming languages becoming significant as they are the ones with deep pockets that hire huge amounts of -admittedly mediocre- programmers. So far all large to huge financial institutions I know bar Microsoft from entering their data centres.

    So, what's the realistic alternative to Java that financial institutions will embrace?

    --

    I hadn't the slightest objection to his spending his time planning massacres for the bourgeoisie... (P.G. Wodehouse)
    1. Re: What's the realistic alternative? by gmueckl · · Score: 1

      Obviously it will be PHP ;)

      --
      http://www.moonlight3d.eu/
    2. Re:What's the realistic alternative? by Anonymous Coward · · Score: 0

      Scala. And it is already used at financial institutions (in fact most of the early adopters are from finance).

    3. Re:What's the realistic alternative? by Anonymous Coward · · Score: 0

      Java's too popular. If Oracle doesn't stay on top of it, an open source solution will prevail.

    4. Re:What's the realistic alternative? by Anonymous Coward · · Score: 0

      There are plenty of "large to huge" financial institutions with Microsoft in their data centres. I'm not sure where you get your information from, but it's most definitely wrong.

      C# has made pretty good headway into just about all major banks and such.

  78. Re: Gawd by Anonymous Coward · · Score: 0

    1) That's not really a lot.

    2) Did they meet the 5 9s requirements?

    3) A lot of banking systems are build as layers after layer of ETL/batch. The systems often work but are grotesque in design and overall efficiency. They often would be no less efficient in Perl than Java.

  79. Re:Gawd by tlambert · · Score: 2

    A lot of medical devices are built using Java.
    First Google result: http://www.oracle.com/us/technologies/embedded/embedded-java-for-healthcare-433550.pdf

    It's been used in medical devices since the late 90's, shortly after it was invented.

    For those applications, Java is purpose built.

    This PDF is Oracle's "Markitecture" -- it's how they want things to work. They have not certified and indemnified their embedded JVM for use in life support systems. Don't expect them to. Don't expect a device manufacturer to bear the costs of certifying both the JVM and their application specific code, as a combination, for that use. IT's not going to happen.

    Yes, my Java ring is in a box in my workroom... I do not wear it every day and do Green Lantern-ish stuff with it, like Sun was predicting would happen when they gave them away at Java One.

  80. Re:Gawd by CODiNE · · Score: 1

    Nononono! It's 1960! Not 1995!

    --
    Cwm, fjord-bank glyphs vext quiz
  81. Answer not obvious by SuperKendall · · Score: 0

    Is it better to write 3+5 than 3.add(5) ?

    The thing 3.add(5) has going for it is clarity, in that I know 5 is being added to 3.

    3+5 in a world where operator overloading exists could mean 3 carves 3 and 5 on a tree, or 5 posts a nice message to 3's Facebook wall.

    Because "normal" humans do not have to read code, it's really not that obvious at all that 3+5 is better than 3.add(5) or other variants thereof...

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
    1. Re:Answer not obvious by Anonymous Coward · · Score: 0

      If we're going to be that obtuse, 3.add(5) could mean add in a non-linear way, or multiply, or divide, or add to the list of numbers that represents the value 3. Really pretty much anything.
       
      Not to mention that, thankfully, many languages (including Java) don't have operator overloading.

    2. Re:Answer not obvious by gbjbaanb · · Score: 3, Insightful

      no, all you "know" is that there is a method called "add" on the object named 3 that is being called with the parameter 5.

      So the 'add' method could easily carve 3 and 5 on a tree. You have no way of knowing what it does just from the method name. The classic example is string::add(). Does "hello".add("world") produce "hello world" or does it only apply to "3".add("5") to produce "8"? You may criticise operator+ for this reason, but note that the add() method is just as bad.

      So there is no difference between the operator+() method, and the add() method (except the name chosen, and the way its written by the developer).

      Now we've established that there is no difference between the two, we can say that as normal humans are the ones that read and write code, the former, operator, mechanism is easier to read, write and understand, then it is the one that should be preferred.

    3. Re:Answer not obvious by Anonymous Coward · · Score: 0

      And 3.add(5) could mean that 3 has adhd 5 times and the programmer was to lazy to write the h...

    4. Re:Answer not obvious by Xest · · Score: 1

      What? There's nothing about an add method that forces it to implement addition any more than there is for an overloaded operator.

      Your argument makes absolutely zero sense.

    5. Re:Answer not obvious by Alomex · · Score: 1

      Which brings up the point that overloading of binary operators such as "+" should only be done when it applies to neither, hence my comment about it being an operation that applies to a tuple and produces a new singleton.

    6. Re:Answer not obvious by petermgreen · · Score: 1

      The problem is that because there are a limited number of operators available and because operators make code less verbose there is a temptation to misuse operators that doesn't exist to anything like the same extent with function names. C++ even institutionalises such misuse by doing it in the standard library. So in one place might mean a shift operation, in another place it might mean writing something to a stream.

      The attitude of java's language designers seems to have been "if it can be misused it should be left out". The standard library desginers didn't seem to get the memo though. Personally I don't think this is a good attitude for a language designer to have.

      OTOH I don't think institutionalising misuse by doing it in the standard library is a good idea either.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
  82. Re:Gawd by aztracker1 · · Score: 2

    The fact is it's a bit of a self-propagating system. Kind of like it's current owner Oracle in general. Programmers who work in those environments persist their poorly performing "enterprise patterns" to the exclusion of other options. It happens in .Net too. I don't even blame the language so much as the developer ecosystem. I can't tell you the number of times I've seen in Java and .Net entire structures of Interfaces, and Classes, and Factories that which could be solved in a couple dozen lines of code in a single class. Sometimes the simpler, less enterprisey way is the better way. I even had friction from an enterprise architect trying to introduce automagic WCF client creation/registration in a solution that was already using Unity instead of explicit clients to the explicit service binding(s) implemented as a passthrough of the original interface. Fortunately, when I showed that it could be done wiring up a service binding with a single line, and the client with a single line in the config file, it was a much easier sell for the rest of the developers. Abstraction is awesome when it means less code, and less configuration. If that means writing an abstraction once to get that with all services, cool.. if it means having layers of crappy interfaces with only a single concrete implementation for no other reason, I'm less for it.

    I've spent most of the past year and a half with my time split between .Net and NodeJS... and I have to say, even without all the type safety and intellisense of VS and .Net, that I find NodeJS solutions, even relatively large ones (properly split up into testable, reusable modules) to be far nicer to work with than either Java or .Net have been. I'll take an application with a simpler codebase, with good unit test coverage any day. That's the difference of a platform more than the language itself.

    --
    Michael J. Ryan - tracker1.info
  83. Re:After years of saying java didn't need C# featu by Anonymous Coward · · Score: 0

    Because Microsoft invented those methods? You need to get out of the basement more often, and well did Microsoft "steal" java and change the syntax a little to make c# ? Hmmmm? Quit raging, and grow up.

  84. Re:Gawd by Anonymous Coward · · Score: 0

    No, its just the realisation that if Java was a terrible language it would have died a long time ago.

    Just like Cobol, the definition of a terrible language?

  85. Re:Gawd by jcr · · Score: 1

    Or anything else in COBOL.

    -jcr

    --
    The only title of honor that a tyrant can grant is "Enemy of the State."
  86. Re:Gawd by Chrisq · · Score: 1

    So you're saying that *all* programming languages are exactly as good each other then? Perhaps you are spending too much time in the "real" world?

    I think that GP is a turing machine

  87. Re: Gawd by Anonymous Coward · · Score: 0

    Indeed, 12 transactions a second is peanuts (it could be done with an antique 16 bit system), but it's not because garbage collection.

    Garbage collection adds jitter to the system and increases memory usage (by a factor 2 or 3), but nothing of this matters in a single purpose and well memory provisioned server (it kills interactivity and multitasking a desktop or mobile device, though).

  88. Re:Gawd by smittyoneeach · · Score: 1

    RIP, Mary Jo Kopechne

    --
    Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
  89. Re:Gawd by gigaherz · · Score: 4, Interesting

    Try "debugging with print statements" when the codebase takes over 10 minutes to compile, and that's when the resources don't need to be re-processed. After you admit to that, the rest of the post can't possibly be taken seriously.

  90. General Purpose languages meh by Anonymous Coward · · Score: 0

    We need to start using the right tools for the right job, or make tools for the right job..

    That is... DOMAIN SPECIFIC LANGUAGES, not General purpose language library bloat.

  91. Re:Gawd by gigaherz · · Score: 1

    I cannot possibly think Java is "*very*" good, until they give it operator overloading, so I can use [] to access lists and hash tables instead of get/set/put. And while they are at it, also give it properties, like in C# or Javascript, so I don't have to use getX/setX/putX. It's not BAD, but it's slightly lacking. Also, I dislike the methods in camelCase, and constants in caps-and-underscores, but that's not really a feature of the language, only a convention.

  92. Re:After years of saying java didn't need C# featu by benjymouse · · Score: 3, Informative

    Right, lets pretend Microsoft invented all of those things.

    If you had been following the language discussions for (for instance) lambda-J you would realize that there is a LOT more to it than simply deciding that a language must have this or that feature.

    Specifically, both Java and C# are statically typed languages (although in C# a variable can be statically typed to be dynamic, but I digress) with advanced multi-generation garbage collection, structured exception handling, generics etc. Any new concepts introduced into the language must respect the concepts already there. Designing new features for Java or C# requires significant amount of innovation to solve the interference problems and maintaining the "feel" of the language.

    LINQ is a real accomplishment, one that I have not seen put together like that in any other language. Yes, list comprehensions existed before. Yes, expression trees (ASTs) have been used in LIST and several other languages before. Don't know about extension methods, but I'm sure that there must be some research language. Yes, type inference had been used before. Yes, inferred classes must have been used in some language before. Certainly lifted types are well-known in certain other languages. But putting the whole package together and make it fit seamlessly with (and complement) the existing features and at the same time keep it so simple and generic that the useful parts are actually library features, that is a real accomplishment.

    Reactive Extensions is real research (primarily by Erik Meijer who has regrettably now left Microsoft to return to academia). Not least because it ties to beautiful in with LINQ. It is entirely new? No, as Erik himself would say, IEnumerable is just a monad. IMHO that does not take away from the accomplishment.

    Async and await are *really* cool and have inspired Scala to create something similar.

    No, Microsoft didn't invent "all of those things". But fitting them in with a curly-brace, statically typed language is real innovation.

    --
    Reading slashdot one-liner: (irm http://rss.slashdot.org/Slashdot/slashdot).rdf.item | fl title,desc*
  93. Re:Gawd by DrXym · · Score: 2
    Java is horribly verbose at times. Not Cobol bad, but insistent on needlessly complicating code with anonymous inner classes, decorations and so on. IDEs take most of the sting out of this but there are still some obvious improvements that could have been lifted from contemporary languages like C#, Groovy etc which would have made life easier and code a lot more readable - mixins, auto types, lambda, embedded dsls and so forth.

    Still, the platform itself is enormously powerful and well supported in software and hardware which is why it is so popular in the enterprise. It's stable, it's scalable and it's portable.

  94. Hate for Java 8 will be like hate for Java 7 by Anonymous Coward · · Score: 0

    When installing Java and seeing the "3 billion devices run Java" I couldn't help but shout out "3 billion flies eat shit".

    Just because something is popular doesn't mean that it's good.

  95. Re:Gawd by vyvepe · · Score: 1

    I would almost agree, that any language is as good as any other. With a few exceptions, like "whitespace" which isn't meant to be a practical language anyway.

    You may be right if you talk within one group of languages like e.g. procedural. But there is quite a difference between groups: (procedural, functional, logic), (strict, lazy), (pure, with side effects), (dynamically, or statically typed, or untyped), (static, lexical, dynamic scoping).

    No, programming languages are not equal to each other. They can be very different. But I agree that tools are important.

  96. ** sigh ** by eennaarbrak · · Score: 1

    I don't know. Reading the article, all I'm thinking is: how many ways can Jimmy find to fuck up his code now? At least with Groovy and Scala, these language features were pretty much limited to programmers who knew what they were doing. With Java, it's a bit like giving everybody in the world a glock and expecting everything to get better.

  97. Re:Gawd by DrXym · · Score: 1
    Not really true. If you want to do something "native", you can use JNI and put anything you like behind that. You also have the usual options of launching a script or another process and using sockets or another protocol communicate to system services.

    JNI isn't as easy as (say) .NET native calls but that could be seen as a blessing because it encourages developers to be platform independent to avoid the pain of JNI. By contrast .NET apps can and often are peppered with native calls to DLLs and Win32 which bind them to the Win32 platform and this bleeds into other bad practices such as hardcoded assumptions about directory structure, file behaviours etc.

  98. Re:After years of saying java didn't need C# featu by Anonymous Coward · · Score: 0

    Nice try. Java does not steal from .NET -- they are not afraid of them. They try to play catch up with the _other_ JVM languages like Scala, Closure.

  99. Re:Gawd by mrvan · · Score: 1

    Java -> python programmer, both around 5-10 years (partially overlapping and with some R thrown in)

    Although the skill and character of the programmer is absolutely the primary thing, I do think that language makes a difference, moreso than tools. If I'd have to rank, I would rank programmer > API/libraries > language > tools. I used to write java in Eclipse and could not live without autocomplete, templates etc. I write python in vanilla emacs and don't miss it at all. Without need for both memory management and "type management", you need a lot less cruft in python so less names, classes etc to remember, and certainly no WidgetConstructorFactoryInterface3. Also, having to reference the real documentation frequently is also a boon, as good documentation (e.g. python stdlib, django) contains very important information that might be missed by relying on autocomplete and assuming you know what something means.

    If someone would write a good autocomplete for a dynamic language with metaclasses and other magic I would be game, but I fear that that is either theoretically impossible to do completely & correctly, or somehow requires running the whole program dynamically while typing, which just sounds painful. I tried PyCharm a while ago but it was clunky and incomplete. But in any case, I choose python+plain editor over java+eclipse for any project unless I know that java has an excellent library for something I need, which rarely happens.

    (and just to defuse the compiler catches errors argument: unit tests + code checkers > compiler errors, especially given the horrible workarounds that are sometimes needed in Java to satisfy the typing system that enables the compiler to catch errors)

  100. Re: Gawd by Anonymous Coward · · Score: 0

    So, 6,000,000 orders per second on a single Java thread on commodity hardware isn't good enough for you?

    http://martinfowler.com/articles/lmax.html

    Java does major heavy lifting, and is extremely fast, if you know what you're doing.

    You can try to make minor parts of the program faster by calling C++ via JNI, but you risk harming performance in the long run, because then the JIT compiler can't inline or otherwise optimise that part of the code.

    Of course, you can make any language slow if you mess up enough.

  101. Re:Gawd by jkauzlar · · Score: 1

    Yeah but compare it to C# and .net. And Java libraries and tools are mostly open-source. I think you'll find it has libraries for almost any kind of interaction with other languages and they're often trivial to find. I feel dirty defending java, but i'm pretty confident it's actually the best tool for developing business apps in large-ish IT departments, all things considered.

  102. Re:Gawd by riT-k0MA · · Score: 1

    That's not over-engineering so much as a lack of decent functionality in the JDK. Having things just work right out the box is one of the things I miss the most after I switched to java.

  103. Unsigned int by Anonymous Coward · · Score: 1

    So does Java support unsigned integers (words) yet ?

    Quite how anything can profess to be a "programming language" without the concept of an unsigned integer is simply beyond me.

    1. Re:Unsigned int by aled · · Score: 1

      So does Java support unsigned integers (words) yet ?

      Quite how anything can profess to be a "programming language" without the concept of an unsigned integer is simply beyond me.

      There, there. I put a link for you: Shakespeare Programming Language.
      You are welcome.

      --

      "I think this line is mostly filler"
  104. Re:Gawd by ericloewe · · Score: 1

    I distinctly remember reading in Java's license terms that it may not be used in critical systems like nuclear plants, missile control systems, and, I suppose, medical aplications.

  105. Re:Gawd by allcoolnameswheretak · · Score: 1

    I don't know what you're talking about. Java has language bindings for every other major language. It's even standardized via the unified scripting API, with which you can call multiple scripting languages and exchange them under the hood without changing your Java program.

  106. Re:Gawd by sourcerror · · Score: 1

    I very much like my debuggers, but I can't imagine why a few added print statements would make the program compile for 10 minutes, unless your whole codebase is in one file. (Or you have fetish for static linking.)

  107. Re:Gawd by allcoolnameswheretak · · Score: 1

    I agree that the available toolset and libraries are what makes a language great, and Java is the best supported development platform in the world. It has the greatest availability of tools and frameworks. The language itself is secondary - you can code for the Java VM in practically any language you like -or you plug in Xtext and create your own. There really isn't anything you can't do with Java, including programming micro controllers.

  108. Re: Gawd by Anonymous Coward · · Score: 0

    You need to see more java dev teams :)

  109. Re:Gawd by serviscope_minor · · Score: 3, Interesting

    I don't think there's much in Java the language that encourages over-engineering; it's more in the community that surrounds Java. It's in the tutorials, and books, and code examples and discussion groups . It's in the frameworks and libraries.

    Indeed. The C++ world used to be like that. The sort of people who read the treat the design patterns pook not as a useful guide and taxonomy but as a way of life. They used to do the same stuff in C++ with massive class heirachies. I think they tend not to be very good programmers and they migrated en-masse to Java since it has fewer pitfalls. The C++ community has changed considerably since then and the modern style is very different.

    I don't think that really says anything about the C++ language or the Java language. As a dyed-in-the-wool C++ programmer, going over to Java, I was firstly not at all surprised by the legendary overengineering, but was surprised that there seemed to be nothing in the language making people write overengineered code.

    Don't get me wrong. It's not my favourite language: I find it a little dull and a little verbose, but it does not seem to be bad.

    It is my understanding that since many of those programmers left perl for other languages perl has been remade as "Modern Perl" which is largely the same core language, just with a different and libraries, and is quite readable.

    Much the same thing is happening in C++. The community (myself included) went mad with excessive template metaprogramming shortly after the mad with design patterns crowd left. It all seems to be calming down and the modern "Stroustrup style" (as it's known and given the name given to it is probably not all that new) of basically doing the sensible thing seems to be slowly taking over.

    --
    SJW n. One who posts facts.
  110. Re:Gawd by RabidReindeer · · Score: 1

    Or anything else in COBOL.

    -jcr

    100 years? That's just about enough time to type in the ENVIRONMENT DIVISION.

    And COBOL wouldn't be found in Purgatory. Look someplace lower.

  111. Re:Gawd by RabidReindeer · · Score: 1

    I debugged with print statements.

    Back before decent debuggers and IDEs were developed. Ran through miles and miles of Teletype paper over trivialities. Then had to make a 1-line change, recompile/link and do it all over again.

    No thanks. I also have a carton or two of punched cards over in the corner and I'm not going back to THEM either.

  112. Re:Gawd by RabidReindeer · · Score: 1

    Sure the classic discussion is in Mythical Man Month. Here (http://sequoia.cs.byu.edu/lab/files/pubs/Delorey2007a.pdf) is a paper from 2007 which has references to many of the classic discussion. And Brooks I believe cites the original FORTRAN vs. assembler tests.

    When The Mythical Man-Month was written, IBM FORTRAN was compiled by brute force and depended on a sizeable (for its day) runtime support library.

    These days, compilers are much, much better at code optimization and a lot of the things that required runtime support infrastructure for are now handled in the OS or even in basic hardware.

    That's going to alter the equation a bit.

  113. Re:Gawd by RabidReindeer · · Score: 2

    Java was a GOOD language, because before we had C++.

    One of my favorite definitions: "Java is like C++. But without the mace and knives."

  114. Re:Gawd by pjt33 · · Score: 1

    there are still some obvious improvements that could have been lifted from contemporary languages like C#, Groovy etc which would have made life easier and code a lot more readable - mixins, auto types, lambda, embedded dsls and so forth.

    Hence Java 8.

  115. Re: Gawd by RabidReindeer · · Score: 3, Informative

    So, 6,000,000 orders per second on a single Java thread on commodity hardware isn't good enough for you?

    http://martinfowler.com/articles/lmax.html

    Java does major heavy lifting, and is extremely fast, if you know what you're doing.

    You can try to make minor parts of the program faster by calling C++ via JNI, but you risk harming performance in the long run, because then the JIT compiler can't inline or otherwise optimise that part of the code.

    Of course, you can make any language slow if you mess up enough.

    Benchmarks have been done and Java can often out-perform C (and C purists will point out that C++ has its own inefficiencies). The reason being that in addition to garbage collection, modern-day JVMs often "waste" time analysing code execution and re-optimizing dynamically, which is something that C cannot do.

    A lot of things that are more efficient done small-scale become relatively less efficient when done large-scale. So much that the large-scale applications can actually benefit even further from processes that would be prohibitive on the small scale (such as on-the-fly re-optimization).

    Even memory management can sometimes be more efficient when garbage-collected if the dynamic memory base is large enough and organized in the right way, replacing thousands of small memory transactions with one big one that reclaims whole blocks of memory at a swoop.

    There's simply no one absolute answer. Only fools look for silver bullets or the One True Religion. But Java found its niche in high-performance, high-reliability backends and so it has received a lot of attention over the years towards making it handle that sort of stuff well.

  116. Re:Gawd by Zontar+The+Mindless · · Score: 1

    You use what's available. Back when I still did websites, there were no clientside JavaScript debuggers other than alert() and document.writeln() statements and whatever you wired them up with.

    And, please, no guff about it not being a real language or whatever. Again, you use what's available.

    --
    Il n'y a pas de Planet B.
  117. Re: Gawd by RabidReindeer · · Score: 1

    1) That's not really a lot.

    2) Did they meet the 5 9s requirements?

    3) A lot of banking systems are build as layers after layer of ETL/batch. The systems often work but are grotesque in design and overall efficiency. They often would be no less efficient in Perl than Java.

    Machine efficiency isn't the issue these days. The old equation where the machine was a major expense and programmers were relatively cheap has long since been reversed, even though we now expect programmers to be insanely cheap.

    If you want cheap programmers, though, don't expect them to be working in Perl. Only APL ranks higher in terms of "write-only programming languages". At least go with Python or something that doesn't take 3 days to comprehend before making any changes to the code.

    And I say that as a person who uses Perl as my preferred weapon - for short, one-shot regex-based tasks.

  118. Re:Gawd by pjt33 · · Score: 1

    You could do that in Java 6.

  119. Re:Gawd by RabidReindeer · · Score: 2

    That's not over-engineering so much as a lack of decent functionality in the JDK. Having things just work right out the box is one of the things I miss the most after I switched to java.

    Java is over-engineered in large part because it's used on large-scale projects where the quick-and-dirty approach doesn't hold up. From time to time, I've had to chastise people for attempting to use J2EE for stuff that doesn't deserve to be written in anything more complex than PHP.

    Then again, Sun made some really wretched design decisions. They're (as Oracle) now about to institute the third attempt to get dates, times, and calendars made easily usable. Although part of what made the first attempt so bad was that they DIDN'T over-engineer it. When you're programming for the World-Wide Web, you need support for multiple timezones and things like countries which use lunar calendars.

  120. Re:Gawd by RaceProUK · · Score: 1

    Have fun maintaining a million-line program in NotePad (or similar).

    --
    No colour or religion ever stopped the bullet from a gun
  121. Re:Gawd by Anonymous Coward · · Score: 0

    If your code base takes ten minutes to compile when you've added a print statement, you have an *extremely* shitty build system. There's simply no reason for it to take more than a few seconds (a minute if you have some recursive make-crap).

  122. Re:Gawd by RaceProUK · · Score: 1

    No, its just the realisation that if Java was a terrible language it would have died a long time ago.

    Just like Cobol, the definition of a terrible language?

    To be fair, COBOL didn't have much competition in the early days (pretty much just FORTRAN and ALGOL).

    --
    No colour or religion ever stopped the bullet from a gun
  123. Re:Gawd by Anonymous Coward · · Score: 0

    A lot of real languages have been written with it too.

  124. Re:Gawd by jbolden · · Score: 1

    How are changes to compilers going to alter statistics on programmer efficiency?

  125. Re:Gawd by DrXym · · Score: 1
    The point I was alluding to is this stuff existed elsewhere a long time ago. It's great that Java is getting some stuff which approximates what other languages have offered but progress is just too damned slow. And stuff like mixins, DSLs still don't exist and there is still lots of language bloat which could be remedied that isn't, e.g. auto vars, type inference in generics etc.

    It's like language development is stuck in a tarpit where stuff is bogged down in committees for years and then delayed (and potentially falls by the wayside) before a new version of Java turns up months or even years behind schedule. Look how long it took for Java 7 to appear and Java 8 is already delayed 6 months from its projected release. It wouldn't surprise me if some significant feature gets dumped between now and then.

  126. Re:Gawd by CastrTroy · · Score: 2

    But how it's compiled isn't part of the language, it's part of the tool-chain. PHP is an interpreted language, unless you work at Facebook, where they have this compiler that turns PHP into C, after which, you can easily compile it to a native executable. Which was kind of my point. When you say you want to use C, Assembly, Fortran or Ada for those applications, what you're really saying is you want a language where the existing tool chain supports compiling down to machine code. You're actually choosing based on the tool-chain, and not on the actual properties of the language itself.

    --

    Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
  127. Re:Gawd by Anonymous Coward · · Score: 0

    No. The important part was:

    For applications like industrial control systems, both in manufacturing, and, again in life support, such as the control systems in nuclear facilities - or even coal-fired facilities, if they happen to have their output powering a pediatric ICU, any garbage collected language is unsuitable, since there is very little control, without infinite memory available, on when a GC will run. You can not implement hard real time in a GC'ed language.

  128. Re: Gawd by deKernel · · Score: 2

    As someone who mainly does C++, I have to whole-heartly agree with you. There is no silver bullet when it comes to the world of high performance transaction processing systems. 9/10 times, it is not the actual speed of the system that really dictates which language should be used, it is peripheral requirements that can make one language over another a better choice (i.e. does your development/support staff have more experience in one language over another so minimal training required). 15 years ago, I would have said that Java was more than likely not the best choice (note: not the best but more than likely capable) but not any more. The JRE has improved sooooo much that it can run neck-n-neck with unmanaged code in most environments.

  129. Re:Missed Opportunity by Anonymous Coward · · Score: 0

    For a quality post such as yours, you really ought to login and attach a name to it.

  130. Re: Gawd by ebno-10db · · Score: 1

    Benchmarks have been done and Java can often out-perform C

    Cite? I've often seen that claim but don't recall many benchmarks. Maybe somebody found a ten line loop that a JIT optimizes the hell out of, but I'm very skeptical that Java can regularly outperform C.

  131. Re:Gawd by Anonymous Coward · · Score: 0

    There is a subculture of programming in which the players write code (normally undocumented) in which they dare other programmers to understand it. These CryptoWriters can then sit back and laugh while other people try to figure it out. It's a game that I've seen played in all languages. It's like a riddle object wrappered in an enigma wrappered in a puzzle, with abstracted variables. I think people also sometimes play this game when they get bored.

  132. Re:Gawd by gl4ss · · Score: 1

    If your code base takes ten minutes to compile when you've added a print statement, you have an *extremely* shitty build system. There's simply no reason for it to take more than a few seconds (a minute if you have some recursive make-crap).

    well there are some extremely shitty build systems.
    I'm inclined to think that debuggers wouldn't work with them anyways though - and I find debuggers cumbersome for finding complex problems(vs. strategic logging, even more so when more than one thread is involved), because in the debug logs I can choose to include the things I want.

    I'm still not going to start writing haskell though. who would pay for it?

    (anyhow, if you have to have nice gui debugger for debugging everything, what are you going to do when you can't? )

    --
    world was created 5 seconds before this post as it is.
  133. Re:Fuck java! by Anonymous Coward · · Score: 0

    Then start doing Python.

  134. Re:After years of saying java didn't need C# featu by Anonymous Coward · · Score: 0

    Of course they didn't invent lambdas and function pointers!

    They did, however, invent async/await and the Metro UI. They didn't invent async programming, but they did invent the state machine rewriting mechanism that makes async/await so easy. They didn't invent the flat Metro look (the Seattle Metro did), but they did invent the UI around it. They didn't invent monads, but they did invent LINQ (a way to write DB queries natively in whatever language you're using, like C# or VB).

    In this case, though, Java's not even copying the innovative features like async/await. They're adding features that have been around for decades, like lambdas. And even then, the lambda implementation doesn't include closures -- at best your lambda can access variables of the enclosing method that don't change, but they're just copying the values. Real closures actually include references to the variables so that they can change. The spec claims that it's to encourage concurrency, but really it's to address the shortcoming in the JVM that the escaping variable records are hard to create.

    dom

    dom

  135. Time to move to Scala by Lawrence_Bird · · Score: 1

    or Haskell. Scala has the advantage(?) of using the JVM. Of course, my personal preference is back to Fortran. For those still stuck in the Fortran IV/77 time warp, you might want to look at the 2003 specification (and the minor rev in 2008).

  136. Re:Gawd by godefroi · · Score: 1

    stuck in a tarpit where stuff is bogged down

    A tarpit called Oracle?

    --
    Karma: Poor (Mostly affected by lame karma-joke sigs)
  137. Re:Gawd by godefroi · · Score: 1

    Yeah but compare it to C# and .net. And Java libraries and tools are mostly open-source. I think you'll find it has libraries for almost any kind of interaction with other languages and they're often trivial to find. I feel dirty defending java, but i'm pretty confident it's actually the best tool for developing business apps in large-ish IT departments, all things considered.

    Compare what? C# makes it quite easy to call out to native code. Anything with a C api is most likely going to be easy to work with.

    Oh, and with IKVM, anything Java is also .NET. It's mind-blowingly awesome.

    --
    Karma: Poor (Mostly affected by lame karma-joke sigs)
  138. Re:Gawd by Anonymous Coward · · Score: 0

    The financial services and banking industry that I work in -

    You mean an industry that produces absolutely nothing of value and is only a parasite which ruins entire economies?

  139. Re: Gawd by RabidReindeer · · Score: 2

    Benchmarks have been done and Java can often out-perform C

    Cite? I've often seen that claim but don't recall many benchmarks. Maybe somebody found a ten line loop that a JIT optimizes the hell out of, but I'm very skeptical that Java can regularly outperform C.

    Lies, Damn Lies, and Benchmarks, as they say. Actual mileage may vary. For short runs, the sheer overhead of setting up a JVM puts it out of the running. For server systems running more or less continuously, the startup time becomes negligible. Loop optimization is probably not one of the things that Java can optimize better than C. On the other hand, on a lot of systems, there's a significant difference in the amount of time that it takes a conditional branch instruction to take the branch versus going straight. A C compilation produces static code and if the worst-case optimization (branch taken) is selected, that's the end of the story. A JVM monitoring performance can detect this sort of thing and rewrite the code to minimize the number of times the branch is taken. Needles to say, a 10-iteration loop run once a day isn't going to benefit, but a routine that runs millions of times an hour will.

    For some actual numbers, I asked my friend Google and managed to find some cases where people did a head-to-head with a greater or lesser degree of honesty (Lies, Damn Lies, ...).

    Here's one:

    http://keithlea.com/javabench/

    A Wikipedia discussion, for contemplation by those who don't knee-jerk reject Wikipedia:

    http://en.wikipedia.org/wiki/Java_performance

    And something a bit more scholarly:

    http://scribblethink.org/Computer/javaCbenchmark.html

    And something from IBM on Java's memory-management performance:

    http://www.ibm.com/developerworks/java/library/j-jtp09275/index.html

    Something I read a while back and cannot recall now asserted that Java won most of their benchmarks except for those involving floating-point numbers. The reason being that C could use the processor's native FPU, but Java's "Write Once/Run Anyware" requirements forced it (unless overridden) to use IEEE Floating-point, which often had to be done in software.

    IBM is a big Java proponent. The modern zSeries machines include 2 FPUs. One for the original, rather strange S/360 FP format and the other for IEEE. Not a co-incidence, I suspect. Reminds me of how a group of Honeywell engineers got together with an OS that had been written under government contract for NASA (thus available for public use), and designed a computer whose instruction set was optimized to run FORTRAN. They called they company Prime Computer.

  140. Re:Gawd by Grishnakh · · Score: 1

    If you'd been here any real time at all, you'd know that Slashdot's moderation system doesn't work at all.

  141. Let me know when it's no longer under Oracle... by luciano.moretti · · Score: 1

    Oracle has demonstrated through their Google lawsuit and their (mis) handling of OpenOffice & MySQL that they are not to be trusted and will screw former partners if they think it's financially beneficial.

    Let me know when Java enters the real world with an open specification process and the spec is managed by an independent industry group. Until then there is horrible vendor lock-in with a vendor I don't trust to not sue me if I do something they don't like.

  142. Fuck! by Anonymous Coward · · Score: 0

    I accidentally clicked an Infoworld link again. :-(

  143. Re: Gawd by Anonymous Coward · · Score: 0

    That is big but not as big as what I work on. A market data system that handles 2 billion messages a second in real time. It is written in Java 6. With parts of it updated nonstop. It is totally paralleled, with each instance running on 32-40 core servers (many threads), and instances running on dozens of servers. It is amazing.

  144. Re: Gawd by Anonymous Coward · · Score: 0

    Dunno what you think you're telling me, but you're wrong ("machine efficiency is never an issue for anyone these days, ever"). We have organizations that are spending 10x more on power for compute than the entire personnel for their entire software stack and management.

    I don't like cheap programmers.

    I wasn't suggesting writing such systems in Perl.

    Thanks.

  145. Re:Gawd by geminidomino · · Score: 1

    I would almost agree, that any language is as good as any other. With a few exceptions, like "whitespace" which isn't meant to be a practical language anyway.

    PHP doesn't fit your exceptions, and is objectively bad.

  146. Re:Nooooo by Xest · · Score: 1

    That's unfortunate given that Microsoft makes way more money as a company and for their investors and staff than Oracle does.

  147. Re:Gawd by JavaLord · · Score: 1

    Java is per definition a programming langauge for amatuers

    The definition of Amateur is unpaid, not too many people would use Java if they weren't being paid for it.

  148. Re: Gawd by Anonymous Coward · · Score: 0

    1MIL...? lol.. We do over 2.5 BILLION a day (in C#). Obviosuly you didn't talk about your hardwere. But, I deal with millions (pural) before breakfast. Not impressed.

  149. Re:Gawd by Rhacman · · Score: 1

    Doctor: "Clear!"
    ...
    ...
    ...
    Nurse: "Doctor, are you going to administer the shock?"
    Doctor: "Hang on, the defibrillator is still booting... Ok." -BZZT!- "Has the EKG finished installing that JVM update yet?"
    Nurse: "98%, 99%, 100%! ... Oh, it's installing now... want to grab a coffee?"

    --
    Account -> Discussions -> Disable Sigs
  150. Re:Gawd by Anonymous Coward · · Score: 0

    "The debuggers, the IDE, the profilers, is completly irrelevant to programming. I never used one before, I debug with print statements, I use emacs, which is stricly speaking to an IDE "

    It says something about a person when they can waste this much time on programming. It says their time isnt all that valuable.

  151. ArithmeticException by krischik · · Score: 1

    The is one and only one correct behaviour: 32-unsigned 0 minus 32-unsigned 1 = ArithmeticException — which is perfectly CPU independent. Obviously Gosling did not think far enough.

    1. Re:ArithmeticException by jbolden · · Score: 1

      I don't agree that's the only correct behavior. But regardless that's also easy to implement in an arithmetic library. Java handles unsigned arithmetic in the JVM fine. The debate is over whether to give direct access to CPU primitive unsigned operation.

  152. Do it right not fast by krischik · · Score: 1

    Of course it is cross platform. If you do it right instead of fast. Because when you do it right you raise ArithmeticException on overflows.

    1. Re:Do it right not fast by jbolden · · Score: 1

      If you "do it right" that's a library. Java supports libraries fine.

  153. Re:Gawd by Anonymous Coward · · Score: 0

    Java is a language that both enables and requires tooling. It is ridiculously over-weight language for small projects, but you really start to appreciate it when you work on a codebase shared by a hundred other developers of varying coding ability. It's a right tool for the job language that people too often use for the wrong job (see the poorly-sandboxed-in-browser version and associated APIs). It gets a lot of hate because it's been pitched as a panacea when it shouldn't have been. But it's a language that every serious developer should know and respect because it does things that no other language (that wasn't created as a knock-off) does as well. People too often myopically focus on only the technical merits of a programming language without considering the organizational flexibility it enables when used by large teams.

  154. Unsigned Byte by krischik · · Score: 1

    How about you need 0 … 255? Very common need in computing.

    Java bytes go negative => mayor pain in the arse
    short could be negative and 256 onwards => if (x<0 && x> 255) destroying all speed advantages. And you need twice as much memory.

    1. Re:Unsigned Byte by jbolden · · Score: 1

      Your HTML got screwed up. As far as signed (which I think you were asking about) I suspect what they want is sane subtraction 3 - 7 = -4.

    2. Re:Unsigned Byte by krischik · · Score: 1

      Actually those where UTF-8 characters. slashdot.org converts the UTF+8 characters to HTML entities. Does a good job on it. But then put them out literately. Maybe I have another look at the option.

      “sane subtraction 3 - 7 = -4.”

      That is only sane in the centre of the valid range. But how about: X = MIN_BYTE + 3; y = x - 7;

      The problem was just moved elsewhere where it is not so notable. My main critic on Java is that whenever the investors of Java encountered a difficult to implement possible feature; instead of thinking it through; finding the proper solution; the investors of Java shied away and declared it “unnecessary” or “dangerous”.

      I don't blame them. AFAIK Sun what breathing down there Necks telling them to finish by X. Probably also the reason why the few difficult features which did make in (like clone ()) tuned out to be a pigs ear.

    3. Re:Unsigned Byte by jbolden · · Score: 1

      My main critic on Java is that whenever the investors of Java encountered a difficult to implement possible feature; instead of thinking it through; finding the proper solution; the investors of Java shied away and declared it “unnecessary” or “dangerous”. I don't blame them. AFAIK Sun what breathing down there Necks telling them to finish by X.

      Yes. Java was not born from a user community naturally, unless you count Oak and the people who made television cable boxes. It was constructed and there was very limited time. But that being said this was difficult not simple. Difficult means complex tradeoffs. Complex tradeoffs mean there isn't an obvious solution. Java is reflecting the reality of what exists on CPUs.

      Most of this I think goes back to me not really seeing "primitive" as mattering much once you aren't going for mimicking the CPU anyway.

    4. Re:Unsigned Byte by krischik · · Score: 1

      Most of this I think goes back to me not really seeing "primitive" as mattering much once you aren't going for mimicking the CPU anyway.

      Good point. But then you should not have primitives outside a java.jni package anyway. Just like Smalltalk or Scala. That would then be truly OO.

    5. Re:Unsigned Byte by jbolden · · Score: 1

      I agree with you. But the speed costs of abstracting away machine primitives are immense. Things can easily be 100x slower or more.

      Fast requires machine dependent
      People wanted machine independent
      People wanted fast

      That ain't easy.

    6. Re:Unsigned Byte by petermgreen · · Score: 1

      Most of this I think goes back to me not really seeing "primitive" as mattering much once you aren't going for mimicking the CPU anyway.

      "primitive" wouldn't matter so much if java had operator overloading and user defined value types.

      But it doesn't, so any custom type you create will be more painful to use and will create more load on the memory manager.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    7. Re:Unsigned Byte by jbolden · · Score: 1

      Primitive matters because it passes through to the CPU directly. Often something like 100x speed up. What would make the most sense from an OO perspective is no guaranteed primitives. What would make the most sense from a performance perspective is access to machine primitives and good mappings. But portability demands compromise.

      As for operator overloading, Java syntax is longwinded. If you don't like longwinded syntax don't use Java. Operator overloading allows for subtle behaviors which can make maintenance difficult which is one of the things Java aims to avoid.

      Anyway... the main point is that Gosling didn't believe he could do that. It wasn't an error.

  155. Unsigned Byte by krischik · · Score: 1

    BTW: The OP said unsigned bytes. As in 0 … 255. Honestly who needs a byte to go from -128 … 127 — that is the most useless data type in the known universe.

  156. Re:Gawd by curunir · · Score: 1

    Working with Lisp in a C* based world is like driving a car in the ocean.

    This is a lesson that I wish more language designers would grok. At this point, with everything that has been written in C, the first feature you implement beyond the basics of your language should be easy bi-directional C interoperability. And if you can use C calling conventions, that's even better. It's super frustrating to watch a promising language like Go waste years creating their own API when they could have gotten near instant adoptability if they'd just allowed us to use their language with our existing C/C++ code.

    C is like email. Anything that seeks to replace it can't operate under the assumption that people will use the new solution instead of it. It has to be designed from the beginning to work with it and enable a gradual migration away from it.

    --
    "Don't blame me, I voted for Kodos!"
  157. Scala by krischik · · Score: 1

    Spot on. And that is the reason I prefer Scala — which has operator overloading.

  158. Re:Gawd by Anonymous Coward · · Score: 0

    Only 100 years? Sweet, I can represent all my dates with only two digits for the year!

  159. Re:Gawd by Anonymous Coward · · Score: 0

    Go ahead, use "libgc" with your C code and you have all the benefits of GC.

    What I find most painful in C is the lack of a standard SortedTree (it bugs Python as well). Of course, I have implemented them in both languages, but the programming community would benefit a lot if they were included in the standard C library.

    Virtual tables are somewhat painful in C but less than I imagined.

  160. Re:Gawd by Anonymous Coward · · Score: 0

    The real problem is that you don't get to benefit from their strengths unless you live completely in their environment.

    Ha, that's what I'd say about Java. JNI is frowned upon while Guile actively promotes integration with C.

    Guile (as well as Perl and Python, for that matter) exposes the OS facilities to the application, while Java makes it virtually impossible to do system programming. How do you do "fork()" in Java? How do you get the your process ID in Java?

  161. Re: Gawd by Anonymous Coward · · Score: 0

    On modern transaction processing systems, if you're application is CPU-bound, you're doing something wrong. I/O is the modern-day bottleneck and both Java and C++ are on equal footing in that concern.

  162. Java is a failure that won't go away by whitroth · · Score: 1

    Don't believe me? Go find some articles from the mid-nineties. Java was *literally* sold with lines like "you cannot have a null pointer exception in Java". (right) And that it would make the programming backlog go away. (right) And it would be far easier to debug, and there'd be far fewer bugs. (Ever seen a tomcat trace, with 150-200 lines *every* *time*?)

    No, thank you.

                          mark

  163. Boost to the Rescue! by c++0xFF · · Score: 1

    Once again, Boost comes to the rescue! Provide a couple of operators, and it fills in the other ones you may want. Very well thought out, as most Boost libraries are -- for example, NaNs mean floating point numbers can't necessarily be given a strict ordering, so they provide "partially_ordered" if you need that.

    When it comes to efficiency, compilers are remarkably capable these days. I just ran a test with GCC 3.4.5. It optimized "a < b || a == b" to the exact same as it generated with "a <= b" (at -O1). Source code available on request, but just try it yourself.

    The lesson here: never make assumptions as to what is most efficient until you actually compile and see what happens. Instead, give the programmer the tools to make the code readable and maintainable, and then fix inefficiencies as you find them. "Premature optimization is the root of all evil." (Donald Knuth)

  164. Re:Gawd by viperidaenz · · Score: 1

    Oracle are not the only provider of JVM's and not all medical devices are life support systems.

  165. Re:Gawd by shutdown+-p+now · · Score: 1

    A masterful troll, sir. Hats off.

  166. Re:Gawd by Sperbels · · Score: 1

    Seriously, this entire thread is one of the best examples of why I hate both my industry and coworkers. It's just a horrible culture filled with petty superficial people.

    I don't think it's necessarily industry. It's the anonymity of the internet that encourages petty behavior in otherwise normal people.

  167. Ada and Scala by krischik · · Score: 1

    Ada gives a access to CPU unsigned types without “implementation defined”. Mind you Ada prescribes RANGE_ERROR on for overflows in signed types and modulo operations on unsigned types. Either way it is well defined.

    Scala hides the difference between class Integer and primitive int behind a new type Int. The compiler decides automaticly if a class or primitive should be used. The quite old language SmallTalk does so as well. Primitives are only interesting when you JNI work. Worse case scenario: array of unsigned byte or short in to our out of a JNI call.

    Also it should have been build into the compiler. A library is not good enough because Java has no operator overloading. Ada has, Scala has. Almost all other OO Languages have. But not Java.

    1. Re:Ada and Scala by jbolden · · Score: 1

      Well if you object to long winded notation for obvious stuff you have many other problems with Java. For the purpose of argument since this is "what should Java do" I think I can assume that people don't object to writing fifty characters when one would do. :)

      As for ADA's treatment that's just like C's. And I think it is a good one. More or less that's Java's, the Java primitives are stuff that runs fast.

  168. Operator Overloading, Optimizer by krischik · · Score: 1

    Not good enough because Java is missing another important OO Feature: operator overloading. If I may expand the title of the Article “Love for the JVM and Hate For Java”.

    Also: Arithmetic contains great potential for optimisation. But for this the compiler need to know what kind of type he is dealing with:

    x + 1 + 2 should be optimized to x + 3
    MAX_FOO + 4 should be evaluated at compile time
    x < y ||&#160;x = y should be optimized to x <= y

    You can still have a library in background to be used by the compiler but the type must be part of the language. The SmallTalk approach that would be.

    Anyway: For me the solution was to use Scala when ever I can.

    1. Re:Operator Overloading, Optimizer by jbolden · · Score: 1

      Take another example:

      y * x * y => x*y^2 that assumes that * operation is commutative which isn't true for matrices. Compilers generally don't optimize overloaded arithmetic for that reason.

      MAC_FOO+4 there is no reason that shouldn't be evaluated at compile time in a pure language. If the compiler sees function (const A, const B) why not evaluate that under all circumstances? The problem is that this might have a side effect. If you want those sorts of computations to happen, at compile time you really want a pure language so again not Java.

      The 3rd example makes sense but that's best handled in a language with type classes, which again Java doesn't have.

      In general most of what you are looking for goes against the spirit of OO and Java.

    2. Re:Operator Overloading, Optimizer by krischik · · Score: 1

      In general most of what you are looking for goes against the spirit of OO and Java.

      More the spirit of Java. I have worked with other OO languages which did a better job of it. Either by not having primitives in the first place (true OO) or having more thought out concept of primitives (hybrid OO).

      So maybe the problem arise by Java trying to be pure OO but still having primitives. Which a pure OO language should not have.

    3. Re:Operator Overloading, Optimizer by jbolden · · Score: 1

      Absolutely. Java was always intended to be a compromise. Try and capture advantages of higher level with speed on par with C's languages. 5x slower not 100-3000x slower. Java today is maybe twice as slow as C++ which ain't bad at all.

      I didn't think the basket of compromises in Java was a good idea then (except for applets) and I don't think it is a good idea now. That being said I do believe Gosling is not an idiot, he made reasonable choices for good reasons given this objectives.

  169. Carry Flag by krischik · · Score: 2

    True. CPUs do roll over.

    And thinking of it (and correcting myself): Ada does for unsigned typed as well. Not for signed. There a RANGE_ERROR is raised. Strange but sometimes useful asymmetry.

    But that does not invalidate my statement. All CPU I know of (there might be others, more exotic CPUs of course) set a carry and/or overflow flag on signed and unsigned roll-overs as well. One does not exclude the other here.

    In 8 bit times those flags where extremely important to do 16 bit operation with only an 8 bit arithmetic logic unit. That is why it is called carry flag. And of course you can branch on the carry flag set or unset.

    1. Re:Carry Flag by jbolden · · Score: 1

      Yes. That's true. There are CPUs that handle it worse but you are correct about the carry flag. I assume Java could have just used the flag, and then the result being non-standard wouldn't matter. And that's arguably cleaner anyway. It is probably 1/3 the speed to keep checking that flag.

  170. one complent, two complement by krischik · · Score: 1

    They don't have the same unsigned arithmetic.

    That seems wrong to me. In fact it seem the wrong way around for me.

    For signed binary arithmetic there are two option:

    One-Complement: Where we have symmetric positive and negative ranges. Including a negative zero. Seldom used.

    Two-Comlement: Where we have asymmetric positive and negative ranges. With the negative range having one extra number.

    But for unsigned binary arithmetic I only know one way of doing it. 30 years of experience in the field. More then a dozen programming languages learned. Degree in computer science. I am hard pressed to even think of a different way to do unsigned binary arithmetic. Even on a purely abstract and academic level.

    But one is never to old to learn something new and I a the curious type: Please enlighten me!

  171. Re: Gawd by Anonymous Coward · · Score: 0

    I think it's what people are really like on the inside.

  172. Re:Gawd by aled · · Score: 1

    You are either absolutely right or absolutely wrong. Or in between.

    --

    "I think this line is mostly filler"
  173. Re:Gawd by aled · · Score: 1

    Someone is using FORTRAN for life critical control systems? really? FORTRAN?
    There are much more use cases that don't need that kind of hard real time constraint in today world. Even phones can run over more high level languages.

    --

    "I think this line is mostly filler"
  174. Re:Gawd by Cruxus · · Score: 1

    In Java land, we've been waiting for lambda functions for a long time.

    --
    On vit, on code et puis on meurt.
  175. Re:Gawd by dkf · · Score: 1

    Then again, Sun made some really wretched design decisions. They're (as Oracle) now about to institute the third attempt to get dates, times, and calendars made easily usable. Although part of what made the first attempt so bad was that they DIDN'T over-engineer it. When you're programming for the World-Wide Web, you need support for multiple timezones and things like countries which use lunar calendars.

    It doesn't help that dates and times are genuinely hard, and the more exactly you try to get them right, the harder they get. I know of someone who wrote his own date handling library from scratch simply because he was fed up with dealing with different bugs in strftime/strptime on each platform he was building on; better to have just his own bugs than everyone else's.

    Sane Java programmers use Joda-Time and don't worry about what's going on in C.

    --
    "Little does he know, but there is no 'I' in 'Idiot'!"
  176. Re: Gawd by dkf · · Score: 1

    Something I read a while back and cannot recall now asserted that Java won most of their benchmarks except for those involving floating-point numbers. The reason being that C could use the processor's native FPU, but Java's "Write Once/Run Anyware" requirements forced it (unless overridden) to use IEEE Floating-point, which often had to be done in software.

    IIRC, there's a way to change what Java does in that case which can get a reasonable speedup. Never needed it though; I don't write heavy numerics code.

    More of an issue is that Java's evaluation order is much more strictly specified than C and C++'s. That rather strongly reduces the space of optimizations that can be applied. OTOH, Java's going to have fewer problems with aliasing; if two references say they're different, they really won't overlap. AIUI, that helps.

    --
    "Little does he know, but there is no 'I' in 'Idiot'!"
  177. Re:Gawd by DrXym · · Score: 1

    Yes and before that in Sun. Basically they both love their precious language so much that they've ended up stifling it. Though in some sense perhaps the reason there are so many 3rd party libs and an increasing number of rival languages running over the JVM may be due to the way the language has been handled. So innovation has happened, just not in the one place where it would benefit the most people.

  178. Re: Gawd by Anonymous Coward · · Score: 0

    Benchmarks have been done and Java can often out-perform C

    ROFLMAO

    All else being equal, your claim is so absurd, all I will do is laugh. There is no argument to be had. LOL

  179. Re:Gawd by Anonymous Coward · · Score: 0

    C is far more portable than Java.

  180. Re:Gawd by Anonymous Coward · · Score: 0

    Not true at all.

    There is nothing on the underlying OS and hardware that you can't get to running an app on the JVM.

    I have also written a few apps that run on the JVM, and the Java language is by far the least used in them. Even my JavaFX 2 code is not written in Java.

    I have far more Ruby, C and Scala code that runs on the JVM.

  181. Re:Gawd by Anonymous Coward · · Score: 0

    I am not sure designing a language for the lowest common denominator is the best idea. Sure it results in the language being "popular" but that is not the same as being a good language. While Java is much better than PHP, both are crappy languages that target the LCD, and I will concede that unlike PHP, Java has legitimate uses, but things would be better if both languages never existed.

    It is not like there didn't exist many good languages that had garbage collection before Java and Java is not really a C++ replacement ie pretty anything where C++ is a good choice, Java is better - that case doesn't really exist.

  182. Re:Gawd by Anonymous Coward · · Score: 0

    Java has terrible, verbose syntax.

    Java was designed for the mediocre programmer. That is not even in dispute.

  183. Re:Gawd by Anonymous Coward · · Score: 0

    Rhino(which is JS on the JVM) has been around for over 10 years and part of the standard API since 1.5, IIRC.

    This is not something new.

  184. Re:Gawd by vilanye · · Score: 1

    Martin Fowler actually wrote a book on DSL's using Java. I think he has officially lost it.