Live data from Hacker News

Hate Java? You’re fighting the wrong battle.

javacodegeeks.com

171–180 of 186 posts

Re: Hate Java? You’re fighting the wrong battle.

#171
post #125
post #5

#Using Java for serious jobs is like trying to take the skin off a rice pudding wearing boxing gloves. -- Tel Hudson #Of all the great programmers I can think of, I know of only one who would voluntarily program in Java. And of all the great programmers I can think of who don't work for Sun, on Java, I know of zero. -- Paul Graham #Java is the most distressing thing to happen to computing since MS-DOS. -- Alan Kay #J…

That's a lot of quotes, mostly by people I've never heard of (PG, Kay, Greenspun and Yegge excepted). I'm not saying there's no truth to them, but they're mostly fluff and little content. Some notes: I don't know why PG can't, but I can certainly name a dozen great programmers who mostly work in Java. Greenspun recommends that instead of Java, you use (wait for it...) .NET. The Dick Wall comment I have no issue with…

>mostly by people I've never heard of

well they make sense :)

Re: Hate Java? You’re fighting the wrong battle.

#172

Earlier quoted context omitted.

If Java is 7, then clojure is your 9, and it runs on JVM.

The nines and tens are the path, not the destination. It's foolish to argue that any one language represents perfection, or even close.

If we're talking about the path, then clojure is 11 probsbly, being kind of the thing with which the universe is crafted.

Re: Hate Java? You’re fighting the wrong battle.

#173

Earlier quoted context omitted.

I'd rather we consider what's being said rather than who is saying it.

The truth of a statement can be determined by two things: 1. If the person is an authority or expert on the topic being discussed. In this case, the person has credibility and it is smart to give them a level of trust. 2. If the person is providing a reference to some objective, public evidence that can be independently evaluated to determine if the statements are valuable. The post in question did not provide either…

> With the general public, all it takes to be influential is good writing. e.g. Jesus Christ is popular

Huh. What did Jesus write again?

Re: Hate Java? You’re fighting the wrong battle.

#174

Earlier quoted context omitted.

"This is what switching out of the Java paradigm, into Ocaml or Haskell, is like." If you try to do real, production programs in Haskell or Ocaml, you find that they have a lot of problems too. I've written some reasonably cool stuff in Haskell (like one of the top tutorials that people use to learn it). My teammate got his Ph.D under Simon Peyton Jones and did his doctoral thesis in Haskell. We were talking one day…

I would use Ocaml before Haskell as a production language, actually. It's hard to reason about space performance in a lazy language, as I'm sure you can imagine. Ocaml is an elegant, simple language that is in many ways like a "functional C". You can also write very fast, robust code in it. Haskell is where the next generation of cool language concepts is coming from (like Lisp in the 1960s-80s) but I'd prefer Ocaml…

Ocaml has its own performance gotchas (especially on 32 bit machines) although they are much easier to work around once you know them. For example, if you allocate a string larger than 16MB on a 32 bit machine ocaml will segfault. If you don't know this little fact that can be a really hard bug to track down.

I also had issues with the garbage collector traversing arrays of native types which is a complete waste of time, especially when said array is 7GB and immutable.

I don't want to give the wrong impression - ocaml is a fantastic language. It just has some poorly documented rough corners which can bite beginners.

Re: Hate Java? You’re fighting the wrong battle.

#175
post #174

Earlier quoted context omitted.

I would use Ocaml before Haskell as a production language, actually. It's hard to reason about space performance in a lazy language, as I'm sure you can imagine. Ocaml is an elegant, simple language that is in many ways like a "functional C". You can also write very fast, robust code in it. Haskell is where the next generation of cool language concepts is coming from (like Lisp in the 1960s-80s) but I'd prefer Ocaml…

Ocaml has its own performance gotchas (especially on 32 bit machines) although they are much easier to work around once you know them. For example, if you allocate a string larger than 16MB on a 32 bit machine ocaml will segfault. If you don't know this little fact that can be a really hard bug to track down. I also had issues with the garbage collector traversing arrays of native types which is a complete waste of t…

These are interesting observations. I'd love to hear more about them.

Ocaml's problem, from what I've seen, is that INRIA wants to run a tight ship regarding the design of the language. This makes sense, but it also means a lot of real-world use cases get ignored. For example, my understanding is that priming Ocaml for multicore use would require substantial rewrites that aren't a high priority, given INRIA's desire to maintain it as a "research language".

The 2^22 - 3 array limit (and the corresponding 2^24 - 12 string limit) on a 32-bit machine (it's 2^54 - 3 on a 64-bit system) are examples of this: the language designers simply didn't anticipate that people would be using the language for purposes that require such enormous arrays or strings. These use cases are tremendously important for real-world production use but not terribly interesting from a research perspective.

Re: Hate Java? You’re fighting the wrong battle.

#176
post #118

Earlier quoted context omitted.

It's more of an antecedent-consequent relationship than redirection, in my opinion. Anyway, while your examples are instructive (I hadn't even heard of the latter three), they get right to the heart of my complaint: I simply don't worry about how to write individual web applications (though I wish some people would think about it a bit more... cough - quora - cough). My immediate response to something like coffeescri…

Actually, yeah, Coffeescript is actually bootstrapped using Jison (a javascript implementation of Bison), and implemented in Coffeescript! :) I should note that i think what's being done with Sproutcore now is pretty awesome. People like Yehuda Katz have done a good job of turning Sproutcore into a tech that has a solid conceptual foundation, and is aiming for ease of use for developing non-trivial javascript apps. S…

Yeah- You've definitely convinced me that I need to take a closer look at coffeescript. But I'd only be really interested if it could take something approaching OWLlink Functional syntax and generate code in any popular language, with my main concern being the ease of controlling exactly what is generated. Not because I think OWL Functional is 'better' than JS; I just think flexibility is an important criteria for judging the quality of tools along these lines.

I suppose I do worry about a few detail-ish things: the future of the disco/ddfs project now that Nokia is on the ropes... how to more closely integrate CLIPS rules with redis... if it is ok to let webmachine sit between nginx and an osgi process, or if I need to back-burner erlang for a while...

Don't get me wrong, I've written plenty of JS and expect to write plenty more, with or without node. But I'm also curious if I could ship a native component for chrome that dynamically loads a Xen vm that contains a 'heavy' application, with the UI written in whatever, that renders through an HTML5 canvas (check out the gnome3 html5 demo). I don't worry about it happening though: that's going to take care of itself. I just hope there are no patents or licenses to buy that would prevent me from shipping apps that way.

Re: Hate Java? You’re fighting the wrong battle.

#177

Earlier quoted context omitted.

You really don't think Python is reaching the point where a manager type would be comfortable with it? It's mature, it has tons of libraries, it's used in all kinds of successful projects. I really don't know. It just doesn't seem anything like a high-risk choice to me.

No Python vendor will wine-and-dine the pointy-haired-manager, nor pay a trip to a conference. Oracle will.

Good point.

Re: Hate Java? You’re fighting the wrong battle.

#178
post #116

Earlier quoted context omitted.

I'm reminded of the first time I tried out Ruby on Rails. I had done some PHP, Perl, C, and Java programming before that. I had worked on some medium sized projects, but in general anything larger than a few dozen files got so complicated it was hard to keep track of. Then I saw what a really good OO design was like. I learned what real separation of concerns and encapsulation could do. It was an epiphany that the pr…

What does "I had done some...Java" mean? You used servlets to write a web app? With our without JSPs? When? That elham are sfo many frameworks out there that comparing RoR to (generic) Java seems nonsensical to me. Have you played with Stripes? Simple, efficient, fast, extensible--blows Struts out of the water, and is up and running in under five minutes.

That was my exposure, Struts, and poorly designed struts too. I think 90% of the code was in static methods. I deferred to the people with 10 years of seniority over me at the time.

Re: Hate Java? You’re fighting the wrong battle.

#179
post #134

Earlier quoted context omitted.

I've been playing around with Haskell recently (actually have been for years, off and on) and have been thinking about doing a real production system in it in the near future. What is going to be so hellish? Space leaks? That doesn't seem like the worst thing in the world to me. Lots of scripting languages tend to bloat over time and the usual answer is to kill and restart the process every now and then. Even Apache…

If you're comparing to Python (which is stable but hella slow) or Ruby (which tends to be both unstable and slow), GHC stacks up pretty well. By "production systems", I was mostly referring to the sort of things that are normally written in Java or C++ - Google-scale server farms, or financial transaction systems. You really want predictable execution behavior in those systems. You want to be able to look at a graph…

I see -- that all makes perfect sense. Thank you!

However, you're still suggesting that Haskell is only good for prototyping, not for "real apps", which understandably for you are Google-scale apps. There is a very long distance between what Google does and what I need to do, today, and premature scaling is the death of many projects. But let's be ambitious and pretend that one day I will want to operate at that scale. Assuming C++ is out of the running, is there really no alternative to Java?

I've been working on apps in PHP (Flickr, now Wikipedia) and while I admire the language, in the same way I admire how weeds can colonize an area efficiently, I am not going to choose that for a personal project. I agree with your assessments of Python and Ruby, and I'm not sufficiently enamored of any framework in those languages to make it worth the trouble. I can sling Perl as well as anybody (even in a style approaching functional) and it can be very efficient, but it's hard to find collaborators these days.

This seems to leave Erlang, Haskell, Scala, or maybe Node.js + JavaScript.

Scala seems like what an enterprise would choose for its foray into functional programming, and indeed that seems to be the hopes of its creators. While it's a "safe" choice, for Java shops maybe, I fear the massive shear forces between Java's way of thinking and Scala's attempt to paper over all that with functional thinking. Not to mention the complexity of that language. Still, it seems to work for Twitter, FourSquare, et al.

There's nothing wrong with Erlang, and it has its adherents in industry, but the syntax annoys me.

I'm already an expert in JS, and a codebase of a single language has its benefits. The intense competition in the browser to make JS an application language seems to have already vaulted JS performance over other scripting languages and new libraries are being written every day. Still, it just feels odd to write directly to a database or file in JavaScript. And I've gotten myself tangled up in JS' asynchrony a bit too much recently. Maybe that's an irrational prejudice.

I guess this is why I've been looking on Haskell; in part because it offers some hope of really writing a lot less code and having that code be so well-typed, automatically, that it practically writes its own tests (see QuickCheck) or doesn't even need them. It seems like there ought to be some way to get the best of that without needing to shoot yourself in the foot because you suddenly want to log some action and you didn't define some code twenty layers above it as monadic.

Re: Hate Java? You’re fighting the wrong battle.

#180

Earlier quoted context omitted.

I'm reminded of the first time I tried out Ruby on Rails. I had done some PHP, Perl, C, and Java programming before that. I had worked on some medium sized projects, but in general anything larger than a few dozen files got so complicated it was hard to keep track of. Then I saw what a really good OO design was like. I learned what real separation of concerns and encapsulation could do. It was an epiphany that the pr…

I don't understand that because Java is more object-oriented than Ruby, not less. Most people seem to think that Ruby got popular because it was LESS Object-oriented than C++, Java and .NET.

It was not that Ruby was more OO than Java, it was that Ruby on Rails had a better design than the spaghetti-code Java (poorly designed Struts apps) I had been exposed to.
Post reply on HN