Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>> You are basically saying that people cannot write good code in Java.

Wrong. I would not say that, because I do it. I am saying that it is vastly more difficult than it needs to be to write good code in Java because it is insufficiently expressive.

I will say that I am suspicious of the ability to write good code of people to whom Java is not a poor development choice, because I suspect brain damage, but a decent programmer can write fine Java. It just sucks to do it.

.

>> You are generalizing and that makes you sound like and troll even though I know that is not your intention.

I am doing no such thing. You are misunderstanding me, but it's pretty clear from the upvotes that you're the only one.

.

>> I personally have never really had an issue with Java so I don't really understand the hate.

It is likely because you think in Blub. Read pg's article regarding Blub, Beating the Averages:

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

He makes the contention that Lisp is at the apex of the pyramid of software development tools. I disagree, for a number of reasons, but the contention of the article is correct at its core: once you have the perspective of a decent set of other tools, you realize that regardless of your tools of choice, Blub languages rank very low on the scale of expressivity--and thus, in power and ease-of-use. (And everyone should learn Lisp, anyway. Even if they don't write code in it. I think in Lisp when writing Java, and aside from Java's miserable boilerplate, my Lisp-in-Java is better than your average Java programmer's Java-in-Java.)

And I would submit that Java is one of the most Blub languages in common use. You have no basis for understanding why others would have an issue, because you are looking up the continuum without insight into what is above.

.

>> Yes, there are sucky frameworks out there but you do know that you don't have to use them?

Meaningless statement. At my current employer, we are forced to use a legacy servlet infrastructure, but my own Java (and Scala) code uses Play! and other frameworks and libraries that at least attempt, if not always successfully, to drag Java reluctantly into some semblance of modernity.

Writing Java still sucks.

.

>> Either I'm writing really simple code that Java never gets in the way, Java is not really a problem, or I'm a super programmer.

Or you are insufficiently experienced with better tools to be able to reliably determine whether it is done better elsewhere. One who does not know any better may be happy with Blub, but one who has used better is not. This seems eminently straightforward.

.

>> And I write similar code in Objective-C, C++/C, JavaScript and even had to write a lot of code in VBA.

I'm beginning to see your problem. With the exception of JavaScript, you do work in Blub. And I'd bet that you write Blub in JavaScript, too, instead of JavaScript in JavaScript.

.

>> Every language has its own nuances, you just find the best way to work with them, ignore the junk, and adapt. Which is why I really don't get where all this hate is coming from.

Nonsense and worse words. The best way to "adapt to Java" is to download a Scala compiler. Spend a few weeks using the JVM with something modern like Scala or Clojure and you will get where the antipathy towards Java comes from.

Java commits the ultimate sin a programming language can commit: it wastes my time. It is a language designed by committee that does nothing excellently. Its successors on its own platform do not commit the same sin and I am more productive for it--they are better for it.

.

>> You never hear this for C++ and it can also be a pain in the ass

This is blatantly untrue, in my own experience. I can rant on about C++ quite successfully and at great length, because C++ has its own share of problems. Where it differs is in much, much greater expressivity--that C++ is capable of supporting Boost is a perfect example of this expressivity. It is by no means perfect, but it is certainly a smaller problem than Java.

And unlike Java 7, C++0x actually fixes (most of--templated lambdas are unavailable for what I consider fairly stupid reasons) the problems that. Oracle decided to push anything useful out until Java 8, and I'm skeptical it'll actually keep the promise of "next year."

.

>> Is almost like it is cool to hate on Java.

You lack the breadth of experience to make this claim.



Well, lets agree to disagree. Maybe I am a dum*bass and too dumb to realize it. Ho well.. C'est la vie


"Agree to disagree" is a polite way of saying "you're wrong."

Are you incapable of substantiating your position?


Yes, you are right. I'm politely telling you that I respect your opinion but I disagree.

>>Are you incapable of substantiating your position?

The thing is that a lot of the arguments we are making are just our own opinions and hence anecdotal. Really what we need here is scientific research measuring what difference does the programming language make when working on coding projects

A couple of examples that I've worked on are the following:

A Java to Objective-C transcoder

C to Java transcoder

Physics Engine

Collision Engine

Symbolic Math Engine

Game Engine (includes the Physics Engine and Collision Engine along with the rendering and animation code)

And some things I'm currently working on:

Java to C++ transcoder

Java to JavaScript transcoder

What I've noticed is that the coding takes very little time, the figuring out part, the design, architecture, debugging, that takes most of the time.

I'm not really sure whether one of the most modern languages would really make much of a difference if at all. I believe it won't really make much of a difference. Coding is the easy part.

Use the language that makes you comfortable, definitely.

Now, tools are a different story. I would hate to have to code in a simple text editor. IDEs make my life extremely easy and actually make me a faster coder. I love the Eclipse IDE. XCode would be my second choice and Visual Studio 3rd.


Upvoted for "coding takes very little time" ! Most often, you are making 100s of small but significant decisions of algorithms, runtimes, libraries, memory footprints etc that the actual coding part ends up being the less significant aspect.

Also, I really admire the polite but confident way you responded to eropple's borderline trolling. Good show !


> You lack the breadth of experience to make this claim.

Wake up. You're 23. You're a kid. You've just started programming and think you know everything. You don't.


I'm well aware that I don't know everything--but, with what little respect is due a troll like yourself, apparently I know more than you. :-) After all, I'm not the one saying "you don't need that" because I don't understand it; on the contrary--I am saying that these tools greatly empower a programmer to write better code. Because they do. You can certainly write "good" Java, but it will not be in the same ballpark as "good" Scala or "good" C# or "good" any-other-remotely-modern-language. The effort expended to write "good" Java is much greater, and as such it is a worse tool.

As for your ad hominem: I've been doing this at some level for ten years, thanks. I've been getting paid to do this stuff for about six. I didn't "just" start programming. I work in a fairly high-level, demanding environment with plenty of hard problems and a lot of code smell that can be directly attributed to poor Java expressivity.

That you can only fall back on "you're a kid" as a way to attack claims says much, much more about you than I.

You are describing to a T the sort of Blub programmer that is referred to in the Graham article I linked upthread, but I won't bother advising you to read it--you won't recognize yourself. Have a nice day. :)


You'll look back at these comments you're making in 10 years and be embarrassed. Hopefully by then you will have learnt a bit more about being a productive programmer.

The language doesn't matter. Repeat after me...

A good programmer can make good stuff in ANY language. A bad programmer can only make good stuff in their favorite language.

You should stand up, be confident, and realize that it is the programmer that creates awesome software. Not the language.


I think you're misunderstanding the point here. It is perfectly possible to write awesome software in Java. With the amount of software out there, it would be completely insane for anyone to say that you can't do awesome things in Java.

> You should stand up, be confident, and realize that it is the programmer that creates awesome software. Not the language.

This highlights the misunderstanding. You're right. We should be spending our time making awesome software, not typing letters and building boilerplate code.

Full disclosure: I work with eropple on a fairly regular basis, I favor C#, I write C++ at my day job. I spent a few months doing Java, was able to do what I wanted to with it, but missed a lot of features from more featureful languages.


There is more to awesome software than typing.

(Note this point stands compatible with the entirely orthogonal point about expressiveness and concision of a language.)

For me (at least due to client demands ..) awesome software, in part, posits the requirement of economically maintainable artifact.

PG's writings on Blub languages is imo addressed to a narrow audience of readers as it does not in anyway address maintenance and extensions to systems by non-elite development teams. Even elite teams, if tasked with delivery of products to non-elite consumers, must factor in the economic equation of the cost proposal.

To wit:

Having a bench of solid OCaml/Scala developers is a viable economic proposition for Wall Street and rich hedge funds; starry start-ups; and possibly elite teams in major media; a hacker community project. It is insanely difficult enough to find competent help in Blub-land, much less competent Scala programmers.

And, of course, the majority of software is developed/internally-consumed precisely by shops that must staff from blub-land. And surely you are aware that a big chunk of "programmers" out there are just recent graduates of some web-app vocational CS education.

Software language economy is not simply about lines of code. The economic cost equation of a language is definitely a critical factor if positioned as a general use language.

Java is unsurpassed in terms of the balance it brings to the economic equation: it is effectively powerful enough to allow serious developers to create "awesome" software, and approachable enough for blubland coders to crank out (yes) meh code that gets the (business) job done.

This fact was recognized by all entities chasing development dollars out there, including IBM, Oracle, and in its own cute way, via Google (Android).

Tell me: why isn't Android dev done with Scala or Clojure? My answer: Because Google management is not stupid.


I'm embarrassed for both of you. Will you please stop baiting one another?


I think an example is in order. I'm going to code up a simple event dispatching algorithm in three languages. They'll have the same functionality. I consider myself fluent in all three, and I'll write them in the most consise and style-respecting way I can.

C++:

    #include <vector>
    #include <string>
    #include <iostream>
    typedef void (*hndlr)(std::string);

    class Event {
      private:
        std::vector<hndlr> handlers;
      public:
        void Listen(hndlr handler) {
          handlers.push_back(handler);
        }
        void trigger(string arg) {
          for (std::vector<hndlr>::iterator i = handlers.begin(); 
              i != handlers.end(); i++) {
            (*i)(arg);
          }
        }
    };
    
    void h1(std::string arg) { 
      std::cout << "First handler got " << arg << std::endl;
    }
    void h2(std::string arg) { 
      std::cout << "Second handler got " << arg << std::endl;
    }
    
    void main() {
      Event event;
      event.Listen(h1);
      event.Listen(h2);
      event.Trigger("something happened!");
    }
Lua:

    event = {listeners = {}}

    function event.listen(self, handler) 
      if (type(handler) ~= "function") return end
      table.insert(self.listeners, handler) 
    end
    
    function event.trigger(self, arg) 
      for handler in self.listeners do handler(arg) end
    end
    
    event:listen(function(text) print("First handler got "..text) end)
    event:listen(function(text) print("Second handler got "..text) end)
    event:trigger("something happened!")
    
C#:

    using System;
    public delegate void HandlerDelegate(string arg);

    class Main {
      static event HandlerDelegate Event;
      static void Main() {
        Event += (arg) => { Console.WriteLine("First handler got" + arg); };
        Event += (arg) => { Console.WriteLine("Second handler got" + arg); };
        Event("something happened!");
      }
    }
    
    
Now, go ahead and say that choice of language doesn't matter. You might not need lambdas, or first-class functions, or event handlers, and a good programmer can make the same algorithm "work" in any language. But by choosing a more powerful and expressive language, you can get those algorithms done in a way that's more readable, maintainable, and faster to code, which in the end is what really matters.


Also fun: The only one of these that works when a callback removes itself from the event list in its own callback routine is C#. You get a hanging iterator in C++, and removing items from a table mid-iteration in Lua is undefined (though in practice usually works).

To make this case work properly, the place I work for has a 335 line C++ template class. This is all time that the developer could have spent actually building our product.


The C++ version could be greatly simplified by using boost::bind. It'd still be shorter and clearer than a Java equivalent that had to bung in anonymous classes and other crap to create a proper dispatch.

Your point, however, totally stands.


You don't seem to understand something that I guess I feel is rather basic: I don't have a "favorite" language. I have tools that are expressive and thus more useful because I spend more time in the problem space than I do in the language space. I also have Java.

Objects are a powerful concept because they allow a programmer to more easily map a problem to the available solution space. This is good. Java, however, fails to take the next step to enable even better mapping of a problem by creating a more flexible solution space. The other languages cited in this thread do create that more flexible solution space, and thus make getting a job done more easily and more cleanly a viable possibility.

.

A good programmer can make good stuff in any language. You are correct about this. Where you are wrong is in your inability to understand that a good programmer can make good stuff quicker and more easily in an environment that minimizes the distance between the problem and solution set.

But I rather get the impression that you don't know enough about what exists outside of your "box" to be as authoritative as you'd like to sound. You seem fundamentally uninterested in understanding the benefits that these constructs, and these simplified syntaxes (note: these are two separate points, but you seem to miss them both) provide to a developer. I don't think there's a lot of value in continuing this with you. Unless you bring forward salient points instead of petulant defenses based on fundamental ignorance, I won't reply to you again.


You ignorance is so painful embarrassing, it almost hurts to read your non-sense.




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: