And if you're comparing it to Rails or Django, I honestly don't think you can easily find a 3 or 4 engineer Spring team that could deliver a product as good (or scalable) as Instragram in the 2 years it took them to do it in Django. You just can't iterate as fast.
Why isn't Java used for modern web application development?
61–70 of 188 posts
Re: Why isn't Java used for modern web application development?
#62Disclaimer: This is cribbed from my upcoming "The Well-Grounded Java Developer" --------------------- If you investigate Ola Bini's pyramid where languages fall into static, dynamic and DSL layers you'll see his arguments for what type of programming tasks suite which layers. Java sits firmly in the stable layer, and so do all of its various web frameworks. As expected for a popular and mature language, Java has a la…
- Last I checked i) the hot deployment in Tomcat/Jetty/SBT/etc is pretty solid, especially if we are talking development. ii) Java supports incremental compilation which means you only need to compile what has been changed, especially if we are still taking development phase again. Unless you compile after making changes to 100+ files, I don't see how expensive this step can be.
"Generally speaking, Java-based web frameworks don’t reliably allow you to have a fast turnaround time for your changes. But that isn’t the only concern with Java-based web frameworks. Another factor that slows down rapid web development is the flexibility of the language, and this is where static typing can be a drawback."
- This argument about dynamic typing faster/better than static typing is just BS. Each offers it's own advantages and can be better/faster depending on where/when/how you apply it and how good a developer are you at actually using their power. Your first example of changing number value to have decimal precision can be achieved in static typing languages like Java/C# just as fast and reliably when one uses refactoring. Your second example of changing list of Book objects to a list of BookOrToy objects, could have been avoided all together by coding to interfaces and not concrete objects. If that has failed, refactoring again solves this.
Re: Why isn't Java used for modern web application development?
#63Java is a language that is in a weird space. It doesn't compile to binary like C/C++ and it isn't high-level and interpreted like a Ruby or Python. It's a weird middle-times language. It originally appeared in 1995 and is somewhat pioneering in the web space. But it isn't as clean as C# since C# appeared in 2001 and was able to learn from the mistakes of Java. It's definitely not as clean as Go which appeared in abou…
Re: Why isn't Java used for modern web application development?
#64It's mainly the coolness factor. Oracle's ridiculous Java lawsuits also contributes to that.
I don't think that the Oracle lawsuits have made a single bit of difference to anybody. Oracle isn't the only big fish in the Java space.
Re: Why isn't Java used for modern web application development?
#65[Edit] Statistics: http://w3techs.com/technologies/overview/programming_languag...
Re: Why isn't Java used for modern web application development?
#66> why the hate toward Java for modern web applications? Verbose language. But more importantly, needlessly verbose and badly designed apis. JSP: You have ${fn:size(emails.unread)} unread email(s)! You have no unread emails! Saner templates: You have ${emails.unread ?: 'no'} ${emails.unread?.pluralize('email')} ! http://paulbuchheit.blogspot.in/2007/05/amazingly-bad-apis.h... > But I can't help thinking to myself, "I…
"Saner templates: You have ${emails.unread ?: 'no'} ${emails.unread?.pluralize('email')} !" At the cost of throwing internationalisation out of the window. At least the example you led with is more conducive to localisation.
Right. i18n is the reason you have to import two taglibs and the template doesn't support basic conditionals. /s
JSP is horrendous. There is not a single reason for its existence, and it should be quarantined.
As far as i18n/l10n goes, the example I quoted was from play framework. This is how an internationalized version will look like:
# Messages file
unread_emails=You have %s %s
no_email=You have no email
# Template
#{if (emails.unread) }
&{'unread_emails', emails.unread, emails.unread?.pluralize('email')}
#{/if}
#{else}
&{'no_emails'}
#{/else}
Are you arguing internationalized jsp is somehow better than this? I tried really hard, but I failed to think of a single templating engine that's worse than JSP.Re: Why isn't Java used for modern web application development?
#67Part of the answer is Java itself. It's verbose, static typed, and requires a lot of boilerplate code to do properly. The fact that classes are a compile-time concern, rather than a runtime concern, is just such a drag. You end up with interfaces you don't really need, only so that you can inject them into constructors so that your app is properly decoupled and testable. Part of it is a framework issue. Struts is hor…
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.
Typing is a problem. Thinking too hard? Where does the OP imply he is averse to thinking? Being turned off that "fucking XML files are controllers" is being averse to thinking?
> Also very very much fashion lead by hipsters who must be using the newest coolest untested thing on the planet.
And those untested things would be? Rails is untested? Or Django? Or Flask?
Re: Why isn't Java used for modern web application development?
#68Earlier 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
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 languages.
Re: Why isn't Java used for modern web application development?
#69Earlier quoted context omitted.
"Saner templates: You have ${emails.unread ?: 'no'} ${emails.unread?.pluralize('email')} !" At the cost of throwing internationalisation out of the window. At least the example you led with is more conducive to localisation.
> At the cost of throwing internationalisation out of the window. At least the example you led with is more conducive to localisation. Right. i18n is the reason you have to import two taglibs and the template doesn't support basic conditionals. /s JSP is horrendous. There is not a single reason for its existence, and it should be quarantined. As far as i18n/l10n goes, the example I quoted was from play framework. Thi…
Re: Why isn't Java used for modern web application development?
#70Spring MVC + Spring Data JPA or Mongo + Thymeleaf for templating + coffee-maven-plugin for Coffee to JS transpiling and you're good to go.
I think the first comment on the question is very true:
> "I think you're incorrect: it is still used, it's just lost cool factor."