Live data from Hacker News

Java 7 is now available

oracle.com

211–218 of 218 posts

Re: Java 7 is now available

#211

Earlier quoted context omitted.

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 c…

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 shou…

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.

Re: Java 7 is now available

#212
Having created several "enterprise" systems in Java, I'm now looking into Mono, because there are some aspects of Java that I'm simply tired of having to deal with again and again. So far it looks very interesting and it works really well on Linux and OS X. Anyone here got experience with using Mono (and possibly Fluent NHibernate, WCF, ASP.NET MVC, etc) in the "enterprise" environment?

Re: Java 7 is now available

#213

Earlier quoted context omitted.

That's just foolish. I write Java daily for a very large web company, and I downvoted him. Because his claim is nonsensical. I downvoted you too, because your claim is trollish and wrong. I have been writing Java since I was 13. I am 23 now. I have been paid for code written in C#, Java, JavaScript, PHP, F#, and Python. My personal projects are written in Scala, C#, C++, and JavaScript. I emphatically do not use Ruby…

> I have been writing Java since I was 13. I am 23 now. I have been paid for code written in C#, Java, JavaScript, PHP, F#, and Python. Woah! You're 23? I bow down to your knowledge and wisdom ;) (I started programming before you were born). > I am quite certain that I would be vastly more productive if the language wasn't consistently getting in my way Again, then you're doing something seriously wrong. If you're sp…

[deleted]

Re: Java 7 is now available

#214

Earlier quoted context omitted.

> And if you can't read code well, go practice some more. Actually, let's not. To paraphrase a minor celebrity of programming, life is too long to be good at reading every variation of boilerplate. Java is essentially hostile to small functions and parametrization, as having any semblance of inner or anonymous functions will require you to define a class at least, or an interface somewhere else, scattering your code…

> To paraphrase a minor celebrity of programming, life is too long to be good at reading every variation of boilerplate. Learning to read code is just like learning to read English. You can guess most of the words meaning once you know some of them. Personally, I think being able to read code is the best skill you can have as a programmer. Just as a good musician is able to listen to music properly. (I mean 'listen'…

> Learning to read code is just like learning to read English. You can guess most of the words meaning once you know some of them. Personally, I think being able to read code is the best skill you can have as a programmer. Just as a good musician is able to listen to music properly. (I mean 'listen' as in analyze, understand, notate and copy).

Yes, that's very true, but it's also a red herring. Not all code is worth to read, nor is it worth to write. Certainly not either the copy+pasted mess that would result of not using first-class functions, or all the _noise_ introduced by their half assed expression using classes.

> The other point IMHO is that scattering your code with anonymous functions points to bad design and is as bad as scattering "GOTO" everywhere in BASIC code. It leads to spaghetti code which is an unmaintainable mess.

Spaghetti? Really? As in flow of control? You _really_ don't know what you are talking about. Sure, it does enable some trickery, like Continuation Passing Style, but if you are arguing that such a technique is a 'con' for the existence of what amounts to just both functions and lexical scope, you are grasping straws.

On the other hand, you have simple abstractions that are enabled by first-class functions, like map or the folds, and you won't have to hear of silliness like the 'Command Pattern' or the 'Strategy Pattern' to work around the restrictions that make them necessary. And the subsequent explosion in code, to be found later shoved in other classes and packages. They make dispatch tables easy, they give you a simple way to make asynchronous code, they allow wrappers for guarded code, they...

Do yourself a favour and take a good look to the first two chapters of SICP (http://mitpress.mit.edu/sicp/), most of their charm is displayed there.

Re: Java 7 is now available

#215
post #206

Earlier quoted context omitted.

Oh sweet jesus finally collection literals. Why did it take more than 10 years to decide to bring in something so convenient? One reason I sometimes find Java repulsive is the fact that it takes so much redundant code to do something so simple. Why do they hold back on such syntactic sugar?

Oh god. Please no, collection literals are the worst idea ever. Making up special rules for some special classes in a language? What the fuck!?

You must be terrified at the presence of numerals and quotation marks in programming languages.

Here's the doc on Collection Literals, BTW.

https://docs.google.com/Doc?id=ddv8ts74_4cbnn5mhj

Collection Literals are actually better than string literals, because they only enforce an interface, not an implemenation.

Re: Java 7 is now available

#216
post #51
post #16

You can now finally use a string in a switch statement, hurray (it's the little things that make me happy)! http://download.oracle.com/javase/7/docs/technotes/guides/la...

God, I seriously hope string-switching doesn't catch on. In a prev job, I saw this block of code - ------- public int getDaysInMonth( String month ) { if( month.equalsIgnoreCase("january")) return 31; else if( month.equalsIgnoreCase("february")) return 28; else if( month.equalsIgnoreCase("march")) return 31; else if( month.equalsIgnoreCase("april")) return 30; ... } ------- My eyes bled. I said folks, just map the mo…

This one is easier to understand imho: 30+(1&(5546>>M)) (also except for M=2)

Re: Java 7 is now available

#217
post #51

Earlier quoted context omitted.

God, I seriously hope string-switching doesn't catch on. In a prev job, I saw this block of code - ------- public int getDaysInMonth( String month ) { if( month.equalsIgnoreCase("january")) return 31; else if( month.equalsIgnoreCase("february")) return 28; else if( month.equalsIgnoreCase("march")) return 31; else if( month.equalsIgnoreCase("april")) return 30; ... } ------- My eyes bled. I said folks, just map the mo…

This one is easier to understand imho: 30+(1&(5546>>M)) (also except for M=2)

Well done! Could you elaborate on how you came up with 5546 ? Perhaps there's a simpler technique than the one I describe below. btw, this was the technique that I learnt in school -

1. You have 12 months. Ignore February. Then you have 11.

2. The remaining 11 map to either 30 days or 31 days . ie. 30+0, or 30+1.

3. So the object is to write a many-to-one function that maps some members of the set to 0, rest to 1. Add 30 and you get the right answer ie. number of days in that month.

4. So you want to map {1,3,5,7,8,10,12} to 1, and {4,6,9,11} to 0.

5. Write down a 13 bit number. If you rightshift x times and AND it with unity, you get 1.

6. So then, x belongs to {1,3,5,7,8,10,12}.

7. That means the bit in each of those locations must be on. The rest of the bits must be off. That gives you the number 1010110101010, which is simply 5546 in decimal.

8. So that's ((5546>>M)&1)+30, except for M==2.

Re: Java 7 is now available

#218
post #55

Earlier quoted context omitted.

I don't think I would say it's floundered. I came back to Java last year after 10 years of C++, and was really pleasantly surprised: Programming in Java now is a nice experience. I would say it has matured, not floundered.

You must be coming from a different C++ background. I had to program in Java for a couple years after 10 years of C++/Qt and was unpleasantly surprised. Java manages to be slower and more verbose/less powerful than C++.

I went from a games programming (C++) career, to Android, to enterprise Java. I admit that enterprise Java can be pretty hideous, but I think in most cases the bloat/slowness isn't caused by the language there. As far as Android is concerned, I co-wrote and optimised a skinning animation system in Java. The bottleneck ended up being things like fill-rates and GPU calculations, not Java.
Post reply on HN