I've been hacking Rails since 2004, and I've made the switch to Java (dropwizard+mustache) for basic web development this year (sometimes with a meteor-like micro-framework I rolled myself). Benefits: - Higher quality code. Java is easier to refactor than Ruby, which makes up for the lower language power. - Performance! - Actual concurrency! - Faster server spinup and incremental changes. Rails with 20 gems in develo…
Is Rails that slow? There's absolutely nothing on my machine slower to start up that the jvm.
Why isn't Java used for modern web application development?
121–130 of 188 posts
Re: Why isn't Java used for modern web application development?
#122Earlier quoted context omitted.
Your Java IDE also lets you move methods and fields, extract interfaces from concrete classes, push members up or down, find all references to a member (reliably), view inheritance relationships, and much more. And it can do all of those safely, warning you if you'll shadow another name. I wish I had that stuff in a Ruby IDE. I've used Eclipse for a long time, but not for JEE projects, and I don't see any "stop the w…
> Your Java IDE also lets you move methods and fields, extract interfaces from concrete classes, push members up or down, find all references to a member (reliably), view inheritance relationships, and much more. And it can do all of those safely, warning you if you'll shadow another name. I wish I had that stuff in a Ruby IDE. Some of it isn't applicable to Ruby, and some of it has to be done manually. True that you…
In my experience, if Eclipse "stops the world", Java is collecting garbage. Java 6 and 7 have become much better at doing incremental collection more often (maybe parallel is the default now?) and the result is a more responsive UI. To me, Eclipse itself feels snappier over time (each release from 3.3 to 3.7 has felt better on similar hardware).
Another thing I've noticed is that Eclipse is significantly faster cleaning/building large workspaces on Linux compared to Windows on the same hardware. I assume this is a result of Linux's aggressive filesystem caching.
Re: Why isn't Java used for modern web application development?
#123I've been hacking Rails since 2004, and I've made the switch to Java (dropwizard+mustache) for basic web development this year (sometimes with a meteor-like micro-framework I rolled myself). Benefits: - Higher quality code. Java is easier to refactor than Ruby, which makes up for the lower language power. - Performance! - Actual concurrency! - Faster server spinup and incremental changes. Rails with 20 gems in develo…
Now in Java/Dropwizard the tendency is to map from SQL rows to objects, then from objects to JSON. Which is a PITA, even more when your design/database changes too much. (The upside is that when you get some object, the data IS there).
Re: Why isn't Java used for modern web application development?
#124Earlier quoted context omitted.
So basically, it's due to lazy programmers who moan if they have to type or think too hard. Also very very much fashion lead by hipsters who must be using the newest coolest untested thing on the planet.
Laziness, Impatience and Hubris There's no advantage to the need to over-architect. It's purely a bi-product of Java (or static languages in general). Because you can figure out how to properly write a Java program doesn't make you clever, sorry. C/C++ programmers moaned about Java and garbage collectors the same way Java programmers are moaning about dynamic language.
The real reason to use languages like C and C++ is performance. The reason for dynamic languages is rapid prototyping. Java is somewhere in the middle but not really ideal except for where you want to compile your software to run on an imaginary CPU which can be emulated everywhere :-)
Re: Why isn't Java used for modern web application development?
#125Earlier quoted context omitted.
The last part of your comment is just language bias. symbols and hashes are fundamental to ruby. Why would I use string concatenation like my parent, when the language support string interpolation. It's as unclear to you as generics or annotations might be to someone who didn't know Java. Surely you see that? I think you are being pedantic about characters vs code. But, for what it's worth, I disagree. You are having…
I grew up reading assembly code listings. Being able to read code is a really really important skill IMHO. Something like Java is very very easy to read. It's mainly keyword based, rather than special character based. I'd much rather read a 1,000 line Java program, than a 100 line program. The other point I'd make is that Java is probably about as verbose as english is. But we all manage, using English. We don't moan…
You've made this argument in multiple posts now, so I'm just going to point out here that people doing science and engineering use formal, mathematical notations precisely because they do offer more precise and concise ways of expressing the necessary technical concepts.
There are plenty of reasons to criticise some of those notations with hindsight, but "not being English" is not among them.
Re: Why isn't Java used for modern web application development?
#126Earlier quoted context omitted.
The last part of your comment is just language bias. symbols and hashes are fundamental to ruby. Why would I use string concatenation like my parent, when the language support string interpolation. It's as unclear to you as generics or annotations might be to someone who didn't know Java. Surely you see that? I think you are being pedantic about characters vs code. But, for what it's worth, I disagree. You are having…
I grew up reading assembly code listings. Being able to read code is a really really important skill IMHO. Something like Java is very very easy to read. It's mainly keyword based, rather than special character based. I'd much rather read a 1,000 line Java program, than a 100 line program. The other point I'd make is that Java is probably about as verbose as english is. But we all manage, using English. We don't moan…
Why is Java considered inefficient and English not? Maybe because we don't need to create a new class for every concept in English. Yours is a pretty poor analogy; English vocabulary is extensive but it is not inherently verbose.
Anyway I am only writing not to say you are wrong, but rather, since other people are arguing with you reasonably and you are dismissing them without consideration, your argumentation is wrong.
Re: Why isn't Java used for modern web application development?
#127Earlier quoted context omitted.
The OP asked why Java isn't used for the web. One of the more popular Java web frameworks heavily relies on XML. It has nothing to do with Java, but it has everything to do with what the OP asked about.
Write your own framework. It's actually not rocket science. You can have a pretty good Java web server going in about 200 lines of code. Just write a simple HTTP server in Java, and have it work as you want it to. Without XML...
No, you can't.
Your "simple HTTP server" proposal is roughly on a par with suggesting that a web developer should design his own security protocols. The idea is simple enough, but there is a lot of subtlety involved in covering all the edges cases properly, and a lot of very smart people have spent a lot of time building, testing and maintaining good tools for these jobs. Why would you reinvent the wheel, with a flat edge across part of it, a single spoke connecting to the axel, and in only one size that won't be the one that fits under the arch next week anyway?
Re: Why isn't Java used for modern web application development?
#128Earlier quoted context omitted.
I'm not sure if you are being sarcastic, but you do realize that's a lot of code for something so simple, right? get '/hello/:name' do content_type :json {:content => "Hello, #{params[:name]}"}.to_json end
I'm not sure if you are being sarcastic, but you do realize that your version is entirely static while the other one is ready for future evolutions? By changing a single line, the java version can also produce XML or text response. By changing two lines, it can also respond to POST requests. And that's just the top of the iceberg. Oh, and in the ends, it's way faster than Node, Ruby, Python and most of the dynamic la…
If you think this is a feature, you might actually like Sinatra/Ruby :)
Re: Why isn't Java used for modern web application development?
#129Earlier quoted context omitted.
You're stuck in 2007. People doing modern java use: @Path("/hello") @Produces(MediaType.APPLICATION_JSON) class HelloController { class Greeting { public Greeting(String name) { this.content = "Hello, " + name; } public final String content; } @GET public Greeting greet(@PathParam("name") String name) { return new Greeting(name); } } > curl http://localhost:8080/hello?name=me {"content": "Hello, me"}
I'm not sure if you are being sarcastic, but you do realize that's a lot of code for something so simple, right? get '/hello/:name' do content_type :json {:content => "Hello, #{params[:name]}"}.to_json end
@GET
public Map greet(@PathParam("name") String name) {
return singletonMap( "content", "Hello, " + name );
}
I like both of these systems, and Java is undeniably the more verbose language, but this framework really isn't an egregious example of that.Re: Why isn't Java used for modern web application development?
#130Earlier quoted context omitted.
Laziness, Impatience and Hubris There's no advantage to the need to over-architect. It's purely a bi-product of Java (or static languages in general). Because you can figure out how to properly write a Java program doesn't make you clever, sorry. C/C++ programmers moaned about Java and garbage collectors the same way Java programmers are moaning about dynamic language.
Static languages have some advantages. It's not quite the same thing (Perl being dynamic and all) but I have gone towards Moose in Perl which gives some of the things I see as advantages of static languages (such as the ability to engineer in constraints declaratively, assuming those are enforced by the language. SQL is great this way.) The real reason to use languages like C and C++ is performance. The reason for dy…
As for performance, it really is amazing how fast node.js is. It's like a slow static language rather than a fast dynamic language (by that I mean, the gap between it and Java is smaller than the gab between it and Python). I don't know why that is, but I hope every dynamic language has that potential and that someone manages to unlock it.