Live data from Hacker News

Java for Everything

teamten.com

271–280 of 344 posts

Re: Java for Everything

#271
post #42

Earlier quoted context omitted.

> On Android you already have java :) Java 6! Java 7 is only fully available for 4.4 upwards, and only the language, with cherry updates for the library. Meanwhile one needs to resort to Xtend and Scala, if I want to enjoy a bit of Java 8 on Android, across versions. Or use hacks like retrolambda. On Windows Phone vs iOS, it depends on your target market. On countries like mine (Portugal) you will surely see more WP…

I am using java 1.5 features only :) Actually i never understood this spike about language features. For me the focus is always on the problem what i am trying to solve (VoIP in this case) and never the language. Actually any language would do for me in which i can apply some encapsulation for better code management (think of java classes). The rest doesn't matter :) I was started with C and then C++, but for me C++…

>i never understood this spike about language features

You should really read about the Blub Paradox. Imagine writing all your coded in assembly. It would suck because assembly is an inferior language To those you mention. Now imagine working in a language that is higher level than what you've (yet) been exposed To.

Re: Java for Everything

#272
post #46

You have to admit that for coders, the joy of writing helps a lot for job satisfaction. I write both Java and Python (for very different applications) and I just always feel like Java makes it hard to write anything elegant almost on purpose. The proliferation of huge frameworks and FactoryFactories clearly doesn't help. I think you can underestimate the value in actually enjoying writing - I'm just more motivated ev…

The problem is that one guys "Joy Of Writing" rapidly becomes the next guy's "Torture Of Reading", and with enough of a time-interval those two can be the same person.

I feel Python is good in this regard compared to other interpreted languages. There's a lot of emphasis on "Pythonic" style which you tend to pick up as you learn, so people are discouraged from excess magic (Explicit is better than implicit) and the syntax at the very least lends itself to sane formatting (especially with PEP8). Personally I've rarely had any true WTF moments reading either my own code or code from (reputable) OSS projects.

Re: Java for Everything

#273
post #206

You have to admit that for coders, the joy of writing helps a lot for job satisfaction. I write both Java and Python (for very different applications) and I just always feel like Java makes it hard to write anything elegant almost on purpose. The proliferation of huge frameworks and FactoryFactories clearly doesn't help. I think you can underestimate the value in actually enjoying writing - I'm just more motivated ev…

With dependency injection you dont need factories.IoC containers will make write you way less code.And they scale better.

You might not need factories, but they get foisted on you anyway. But the proliferation of "programming patterns" in java I think is symptomatic of a basic user-unfriendliness in the language.

Off the top of my head I can think of three Patterns just for creating objects (Factories, DI, Builders) - the fact that these are even required, that object creation isn't self evident, suggests there's something wrong in the language design

Re: Java for Everything

#274
post #173

Earlier quoted context omitted.

My opinionated viewpoint, if you want to learn this stuff for a job: Install eclipse. Get a non-JavaEE version - probably "eclipse for java developers". It's flaky software and you will have to babysit it sometimes, but it's still the best choice. Use maven, then you don't need a sysadmin to maintain your libraries. You just add libraries as dependencies (you can even use a search wizard in Eclipse) and it Just Works…

I'm confused. Is there something else in another language with better solutions for IDE, dependency management, dependency injection, etc.? Honestly, you just listed some of the best reasons to use Java.

> I'm confused. Is there something else in another language with better solutions for IDE, dependency management, dependency injection, etc.?

Other languages are less dependent on a heavy IDE; I can write Python or even Scala in vim (+ repl in another tab) reasonably comfortably, and while vim has its warts it's a lot less fragile than eclipse.

Spring is IMO not worth the complexity compared to explicitly constructing things, but if you really want to do that there are ways to do it in Scala (e.g. just using implicits, reader monad) that don't require annotations or XML and don't have anything like the number of quirks (e.g. autoproxying, about 10 magic lifecycle methods, configuration-dependent behaviour on duplicate beans) that Spring does.

Likewise Hibernate is nice but it has some irritating misbehaviour (e.g. passing empty lists can cause it to make SQL syntax errors) that isn't present in ActiveRecord or even modern JVM alternatives.

I didn't expect my comment to be so negative when I started writing it, but as I started to try and explain the basics I realized how many arbitrary workarounds a very basic Java app needs. A lot of this is 10 years of accumulated cruft rather than fundamental problems, but at the sharp end new users still have to deal with it.

Re: Java for Everything

#275
post #256
post #169

Earlier quoted context omitted.

So what? For most problems there are fast, well-designed libraries available with idiomatic python interfaces; why would you care about the implementation details?

Because the whole point of the OP is being able to use the same language for the whole stack.

You are. Sure you call libraries that aren't written in Python, but that seems just as irrelevant as the fact that the JVM is written in C.

Re: Java for Everything

#276
post #89

Verbosity matters for reading and maintenance far more than it does for writing. IDEs can make the writing faster, but they can't make the code as easy to comprehend as it would be in a more expressive language. And remember that lines of code is the only proven risk factor for bugs. Most sites are not Twitter. They're not Stack Overflow. They're not even Nanowrimo. I've watched a company spend two years, dozens of d…

> they can't make the code as easy to comprehend as it would be in a more expressive language. It's a little hard to make a general statement using an vague term like "expressiveness". Static typing can actually make things clearer . That's a kind of expressiveness. You can know with complete certainty what type of data the code works with, just by looking at it. No need to rely on a certain set of unit tests living…

Type safety is valuable, but you can have equivalent or better type safety in a much less verbose language than Java. e.g. I use Scala - it's not quite as concise as Python, but it's pretty close, and the language is powerful enough that I can express more possible effects directly in the type system (Does this method make an async call? Does it access the database? Does it log audit events?) without the code becoming unreadably verbose.

Re: Java for Everything

#277

First of all, I want to say that if you like Java, and know it well, and believe it to be the right tool for your particular application, that you should absolutely use it. > That Java is the right language for all jobs. (Emphasis his.) > The advantages of C and C++ [...] don’t apply to my work. So, choose the right tool for the right job. As for the examples given: > At one company I wrote a simulator that allowed m…

This is the correct response to this article. He makes a big deal out of saying he doesn't need to "choose the right tool" anymore. But then later, he feels compelled to qualify that Java is the right tool for him, which sort of invalidates his former point.

In other words, I viewed this article as a large waste of time. Nothing has been added to what is already conventional wisdom.

Re: Java for Everything

#278
post #29

Earlier quoted context omitted.

On mobile devices the issue is Oracle dropping the ball and leaving to third parties (RoboVM, CodenameOne,...) the work of providing JVM implementations. This on iOS, still no story on Windows Phone, which actually happens to be over iOS on some European countries.

On Android you already have java :) The big question is iOS for which there is no mature tool yet. hopefully j2objc will be enough. Windows phone ...i think that we will wait to see a higher market share before to dig into it

We are working hard on making RoboVM as mature as possible. There's already plenty of applications on the App Store using RoboVM. Happy to talk if you need more info for decision making. Ping us at hello@robovm.com.

Re: Java for Everything

#279

Earlier quoted context omitted.

Keep in mind that JAX-WS with JAX-B beats other rival libraries in other languages. If your requirement is to be a client that consumes SOAP web service given wsdl, I'd take Java any given day. The wsimport and wsdl tool that JDK provides beat any libraries. Also, JAX-B annotation can serialize and deserialize to JSON given the right provider. That's JSON, XML with POJO with the price of one. Good example of Java eco…

False. If you use a language that's homoiconic (any Lisp), you don't need to serialize anything. The source code of the language is already in its serialzed form. You can't beat the speed of not having to do something in the first place. As an aside, no sane person would write a SOAP webservice today.

SOAP certainly sucks, but regarding your comment on using lisp as the transfer protocol is a bad idea. Data transfer protocols must be verifiable - you should basically be able to write a piece of code that parses the data input and verifies that it will not do something bad if deserialized. Given that as far as I know, Lisp is turing-complete, this task is impossible. Therefore, Lisp, while being a nice programming language, is a very bad wire protocol.

Re: Java for Everything

#280
post #127

Earlier quoted context omitted.

Thanks for that. Question though. The first book you listed (which got excellent amazon reviews as well) was published in 2008. Typically I've been biased into thinking that a book had to be somewhat recent. Obviously this isn't the case here though. (Do you agree with that in some situations btw?). I would have never purchased this book if you hadn't pointed it out so thanks it's in my cart.

Effective Java is a solid choice, and a lot of the advice is still relevant six years later :) Also, JCIP is a go-to if you want to get more than a passing handle on concurrency in Java.

Agreed, the java books I listed still provide more value to my core Java than more recent books. I do the majority of my Java work now in the Play framework, when I use a new framework or library blogs and stackoverflow are my go to resources, for a deeper understanding of the library then those books are the way forward.
Post reply on HN