Hacker News new | past | comments | ask | show | jobs | submit login

I vote for not making the language more complicated than it already is in Java 7. Oh but we have Java 8 with closures and stuff, well OK how about no more complicated than Java 8. Please? Instead maybe introduce useful things that make programmers more productive. How about implicit generics. Where this whole mess of T and Any and <: extendsT< gobbldygook> melts away. Notice how a new class extends Object automatically? It always has. Why do I have to muck about with all the fancy and overly complex syntax. Give me the features of all of that but abstract it away so I can just write what I need to and it works implicitly. Either that or just leave the dang language alone and go make some cool libraries.



I am really rather tired of the appeal to simplicity that is often made in language design. Simplicity is not a virtue in a programming language. Consistency is a virtue, but not simplicity.

Simplicity is a tradeoff that takes away power and control from the programmer and gives it to the computer. Computers don't need to be more powerful, programmers do. The tradeoff is a poor one and rarely worth the little gained.

In this case, what do we gain by not adding primitive value types in Java? The fact that you sleep better at night because the language is more "clean"? Why should we want that? Sleep is definitely important, but the idea that a language can be too complex is silly.

It does matter that new additions do remain consistent with the overall architecture, but there is no reason to advocate less features simply because you find the idea of learning something new disconcerting.


Agreed. I feel like a C# Stan in here at the moment, given how often I'm speaking glowingly of it lately--I use it to make games but my day job is Ruby and Scala!--but you can look at C# to see what moderately progressive (not even "aggressive") iteration on a language to add more and more powerful features in a smart, clean way would look like. Nobody's complaining about C# having too many bells and whistles, honest.


I really agree with you as well, but I can think of a few reasons to want simplicity.

First, including features that you expect others (beginners) not to use is problematic. You can't really claim to know a language if you can't read other people's code when they are using standard language features. So you have to learn all those features whether you intend to use them or not. And learning them means knowing when and why they are used. Usually, this kind of stuff is just deferred to libraries and language extensions. (Haskell-style Langauge extensions and Python's future imports are a wonderful idea, I think.)

Second, people like to get comfortable in their languages. If the C language designers just said "Hey, er..., you know all these curly b's are unnecessary, let's drop 'em in the next standard," people wouldn't care for it. More features + more power + backwards compatibility can only carry you so far before it becomes downright unwieldy.

I don't think people learn very well that they should just forget everything they know every 5 years and start on mastering something completely new. The problem is not in the language being too complex (like you said,) but in our culture and habits. People don't like complexity. That's why we work so hard to make it go away.


Here is an example from Spark Framework (a tiny web framework) written in Java 8.

import static spark.Spark.* ;

public class HelloWorld {

    public static void main(String[] args) {
        get("/hello", (req, res) -> "Hello World");
    }
}

This is more simple as written in previous version and is also consistent with it as it can be written in Java 7 (or earlier) like this.

import static spark.Spark.* ;

public class HelloWorld {

    public static void main(String[] args) {
        get("/hello", new Route() {
	    @Override
	    public Object handle(Request req, Response res) 
                                                throws Exception {
                return "Hello World";
            }
        });
    }
}

You can see how closures in Java actually represent more familiar idea and by omitting unnecessary ceremony do make writing in it more simple.


I rather like closures and streams quite a bit! Please do continue to improve the language, especially generics! Generics as they currently are are just so much more limited than they could be. I hope they end up fixing them and getting things moving forward again with respect to generics!


And how about some support for object literals, please...?


Collection literals have been explored by http://openjdk.java.net/jeps/186, have a look at the mailing list discussions on that.


I appreciate the link, but this information is not terribly encouraging. Steve Yegge somewhat famously pointed out how painful Java's lack of object literals is back in 2006, and some mailing list discussion is all the progress that the Java community has made toward that feature in the 8 years since. http://steve-yegge.blogspot.com/2006/09/bloggers-block-4-rub...


Simplicity is about having orthogonal features that compose and work well together.

Not about having "fewer" features.

Especially when Java is infantile in the small number of features it has...




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: