Ask Slashdot: Tips For Designing a Modern Web Application? 409
New submitter sdoca writes "I am a Java developer and for the past number of years I have mainly been working on server side code. I have an idea for a webpage/application that I would like to develop. For the general public, it will be a site where they can view upcoming events, filter them by type, date etc. and view details of events they're interested in. There will also be an admin section to the app where organizations who want to post their events can log in and set them up. In the long term, writing a view-only version as an Apple and/or Android app is on the radar, but I want to focus on the generic web app for now. I'm not sure what languages/frameworks to look at using for the webpage portion of my project. Many (many!) years ago, I wrote some applets. After that I did some work in WebObjects and after that I tinkered with Wicket. I have no experience with PHP and would like to stay in my Java comfort zone as much as possible, but want to use the right tool. I'm concerned about browser compatibility issues. Chrome didn't exist when I last did web page development. I'm looking for good resources (books, internet) that will guide me through the potential issues and your recommendations for a web development framework."
There's quite a few options out there, but... (Score:5, Insightful)
If you're familiar with Java but not web development, it sounds like Grails [wikipedia.org] might be a good place to start.
Re:There's quite a few options out there, but... (Score:5, Informative)
I'll throw in a vote for Grails. It is a convention over configuration app framework that has you code your domain objects and then it generates CRUD pages for you.
The documentation is pretty good. There's lots of tags for the web page side.
It lives on top of Spring, Hibernate, & JQuery so it has some solid frameworks at its core.
It uses Groovy as its language rather than Java, but Groovy is 100% compatible with Java and is mostly syntactic shortcuts & convenience tricks on top of Java (like no need for semicolons). So it is very easy to learn if you're a Java guy; you can slowly start using more idiomatic Groovy while still writing very Java-esque code.
If Groovy scares you, try Roo (http://www.springsource.org/spring-roo). It's a pure Java based app framework also from Spring that uses the Spring libraries.
Now, having said all that. If you plan to deploy to iOS or Android, you may want to consider RhoMobile (http://rhomobile.com). It is a Ruby-on-Rails environment that runs on top of the native OS. So developing a RoR app for the client-server PC side and then porting to RhoMobile should be very easy. I don't know of a solution on the Java side that will take a Java servlet based app and move it over to the mobile OSes conveniently.
Re:There's quite a few options out there, but... (Score:5, Informative)
If you're familiar with Java but not web development,...
+
In the long term, writing a view-only version as an Apple and/or Android app is on the radar
+
I have no experience with PHP and would like to stay in my Java comfort zone as much as possible, but want to use the right tool.
In my opinion, give GWT [google.com] a try. Why should make it exciting for you: the entirely dev cycle (this includes debug) is Java based - including the code in the "views" that will be shown in the browser (even if this code will be transpiled [wikipedia.org] to javascript - a very compact one for the functionality it implements).
Using GWT, the "presentation logic" is totally separated by the lower layers (in both "architectural" and "exploitation" senses): i.e. your business logic will implement only "services" type of functions, the "presentation logic" - in browser - will be in charge to render the data the way you see fit - no more server-side resources to be consumed by layouting the page, applying "data model basic consistency validation", etc - (oh, how I hated JSP at their time). Let the "client CPU" do a bit of this effort - if your application will be highly used, a bit from every client-side that takes some care about itself will get you some serious server-side savings.
As I write, I'm digging into a piece of GWT [google.com] that promises to take care of the integration with JPA entities, e.g. bringing Hibernate into the picture without the need of heaps of "plumbing code".
Would anyone else recommend GWT? (Score:4, Interesting)
Re:Would anyone else recommend GWT? (Score:4, Informative)
Re: (Score:2)
Re: (Score:3)
That's a fairly broad statement, "GWT doesn't hold up well". I'm curious to see why you think this is the case - my (extensive) experience has been the opposite - GWT scales well and you can do stuff with it that is painful with other technologies (eg. works across just about every browser - even with braindead IE6's limitations; you can also development very modular and re-usable components with GWT). So yeah, I'm interested to hear what general-purpose solution you think is better than GWT and why.
Most of my experience with GWT was with pre-2.0. We had issues when trying to bring in stand-alone pages in addition to the web app we had. It was difficult to integrate existing non-GWT pages with GWT.
Re: (Score:2)
GWT is decent if you are building a web application that will be doing one thing. If you are looking for a more broadscale application, then GWT doesn't hold up well.
Huh? The fact that you can write code to run in browser (and use the client CPU/RAM) and let the server run only the "services" to get/build/process the data should point in the opposite direction - how did you reach the conclusion that "doesn't scale well"?
Re:Would anyone else recommend GWT? (Score:5, Interesting)
GWT is good if you want to create a RIA [wikipedia.org], when the presentation logic is so complex developing it in javascript is a nightmare, but without having to use Flash or silverlight. If the presentation is simple enough however, I would stick to HTML5 + jQuery. In fact the "simple enough" bar in that last statement is gradually pushed forward.
As a rule of thumb I'd say if you have a lot of moving parts on the page and you are basically creating a desktop application inside the browser ala Google docs, then consider GWT. Otherwise it will do more harm than good.
Re: (Score:2)
Re: (Score:2)
GWT is good if you want to create a RIA [wikipedia.org], when the presentation logic is so complex developing it in javascript is a nightmare, but without having to use Flash or silverlight. If the presentation is simple enough however, I would stick to HTML5 + jQuery. In fact the "simple enough" bar in that last statement is gradually pushed forward.
As a rule of thumb I'd say if you have a lot of moving parts on the page and you are basically creating a desktop application inside the browser ala Google docs, then consider GWT. Otherwise it will do more harm than good.
Haven't played with jQuery, but even so:
1 GWT is able to handle simple cases. Nothing wrong with leaning another library, except the time you spend on the leaning curve to get productive (getting to know jQuery and, possible, setting your mind on "thinking in Javascript").
2. Browser compatibility - still a nightmare. GWT seems to transpile to something that will run across the main browsers without getting your mind overheated
3. the fact that you write your client code in a single programming language, b
Re:Would anyone else recommend GWT? (Score:5, Insightful)
GWT is great if you want interactivity. Also fits in well since you are a Java programmer. I've also recently discovered vaadin (http://vaadin.com) which extends GWT and provides much nicer themes than the default. Best of all, all the tools you need for GWT/vaadin development are free (both zero cost and source is available); Java, Tomcat, Eclipse or Netbeans, GWT + GWT plugin (for debugging in your browser), vaadin and the all-important community documentation/forums (that is, you don't have to pay for a subscription like MSDN). Best of all vaadin/GWT handles almost all of the browser variation for you (although there are differences in CSS for advanced styling).
Since you are already a Java programmer I would say you'd be mad to go past GWT (which you also develop for, and can debug in Java). Other solutions are ok for static page-oriented viewing but for a complex dynamic site it is hard for a competent Java programmer to be more productive than with GWT (except for the smaller sites with not a lot going on). How do I know, well I use GWT daily - including building complex sites for managing medical information for our national-level health ministry.
Re: (Score:3)
There's two parts (Score:3, Informative)
For the client side, you want to use at least JQuery (& SASS & CoffeeScript), and learn about non-intrusive scripting. You may also want to investigate other libraries that layer on top of JQuery.
For the server side, the choice is less clear. I happen to like Rails--it was the first web app framework that felt even remotely "right" to me, but since then there's been a lot of development and a lot of cross-pollination of good ideas across languages/frameworks, such that there's now a number of choices that rate as "pretty damn good" in my opinion.
Re: (Score:3)
Re: (Score:2)
Re:There's two parts (Score:5, Insightful)
CoffeeScript... That way, when your console tells you you've a JS error on line X, you need to check the code output by CS, and locate whatever code you wrote that could have generated the relevant lines, all the while coping with the fact that CS doesn't cover 100% of JS, and introduces its own set of bugs and quirks on top of those in JS. Good luck with that in the long term.
Re: (Score:2)
Re: (Score:3)
"Once you start integrating with devices and complex webservices then Rails is not as good a fit as something like Java."
Not so. In regard to devices, Rhodes [osnews.com] is a cross-platform app development environment entirely built around Ruby and Rails. In fact, as far as I know, it is the only cross-platform mobile development system that has gained any popularity.
And as for web services, I have no idea where that assertion came from. That was really a rather odd statement to make. It is no more difficult to integrate with web services using Ruby and Rails than with any other language or framework. I should know; I do it all the ti
Ignore PHP (Score:3, Insightful)
its the worst thing you could ever attempt to learn
Re:Ignore PHP (Score:4, Insightful)
Because it's crap. See sig for details.
And It works so "well" for Facebook that they essentially had to re-implement it as a PHP-to-C++ translator just to get decent perf out of it.
Re: (Score:3)
My preference would probably be ASP.NET MVC, but this is mainly because I'm more intimately familiar with C# than most other options, not because it is necessary the best choice. Really, there are too many good choices to list them all - Python and Ruby both have a slew of frameworks for all tastes, and Scala is also very enticing. Groovy is pretty decent, as well.
Re: (Score:3)
Personally I'd use ASP.NET MVC or something like Java and Spring if you don't want to go the Microsoft route.
I know others mentioned things like Grails which sit on top of things like Spring, but honestly my experience has always been that if you add yet another layer of abstraction, you're just creating more places for things to go wrong, and putting something else in your way when you start creating something that goes slightly beyond non-trivial such that you'll end up having to put forth ugly hacks to w
Re: (Score:3)
And Facebook isn't using the same PHP the OP will be using, either. Facebook developed its own compilers and other tools that allow its applications to scale in ways that stock PHP applications cannot.
Re: (Score:3)
You mean how awful it is that (integer) is a synonym for (int)? There are some points that we've known about for a long time, mixed in with a whole lot of fluff and irrelevance. It's true it is more painfully evolved rather than well developed, however I'm not particularly impressed with that article.
Phillip.
Play framework (Java) (Score:5, Informative)
I just started playing around with the Play framework (Java/Scala) I'm loving it, and I'm coming from *gasp WebObjects, and .Net. I can't speak too much about its features but it's really simple to get up and running connected to a database and serving content, as well as creating REST api. Deployment is a single command.
This is what I'm using for a tutorial: https://github.com/jamesward/play2torial/blob/master/JAVA.md
Re: (Score:3)
Re: (Score:2)
This really is what you want exactly. A lot of development frameworks have a code->redeploy->view cycle for every change. Play on the other hand dynamically compiles everything when in development mode so it's just code->refresh. It also lays everything out in nice MVC pattern so you're really just filling in the blanks as you code.
CherryPy (Score:2, Interesting)
@WilliamBaughman GWT is nice, but it's different than most web frameworks. It's Java code compiled into Javascript. The times I've used it I've come away thinking it has some great features, but it's a little heavy for my taste. Haven't used it in about 3 years though.
here is the most important tip... (Score:2, Informative)
If it does not load perfectly every time, you failed.
for example? Any of the Gawker Media websites, some times you have to reload t hem 3 times to get the fricking hyperlinks to work.
any usability bug is an epic fail.
Re:here is the most important tip... (Score:5, Insightful)
Any of the Gawker Media websites, some times you have to reload t hem 3 times to get the fricking hyperlinks to work.
A little tangent....
Gawker's websites suck in other ways that relate to usuability too. I use noscript religiously, there is nothing about the gawker websites that need javascript, but all you get is a nearly blank page if you don't enable javascript. UNLESS you change your brower's user agent to something Gawker doesn't recognize as supporting javascript (I change mine to an old version of googlebot). Then they send you pages that work perfectly well without javascript.
So clearly they can do non-javascript pages, but if they recognize your browser they won't give them to you and even worse, they won't even explain what's going on, it just silently fails with a blank page. They can't even be bothered to tell you to enable javascript, which is really just pathetic.
Re: (Score:3)
I use noscript religiously, there is nothing about the gawker websites that need javascript, but all you get is a nearly blank page if you don't enable javascript.
Best argument for noscript I've ever read.
An even more important tip (Score:4, Insightful)
Comment removed (Score:4, Informative)
Re:CMS and done. (Score:5, Funny)
Re: (Score:2)
heya,
Sorry, this is just a niggle, but Java != Javascript!
Argh, I don't know where this meme came about, but the only thing similar between them is the "Java" part - and that was just Sun/Netscape trying to cash in on the Java hype back then.
Syntactically, sure, you can argue they're similar (and even then, only a a very basic level) - but then so are all the C-class languages.
If he really wanted to stick to his Java roots on the UI side, he could use something like GWT (Google Web Toolkit).
Cheers,
Victor
Java Server Side (Score:2)
Re: (Score:2)
Do what you do best.
Use Java for the server coding and Dart for the client coding. JSP is an obvious choice if you haven't already considered it. Dart is going to feel very familiar but compiles to JavaScript so you can build in an enviornment you are already comfortable in and still avoid the pitfalls of client side Java.
Personally, I'd like to see you do your project to also work as a plug-in for Vosao. While I am not a fan of Java, it's still what I'm using for my CMS on Google AppEngine because it's goo
Spring, Scala/Akka/Play (Score:4, Interesting)
I have two suggestions that are close to staying with Java:
(1) Check out Spring (http://www.springsource.org/); Spring has a bunch of goodies that make developing web apps easier, and the guys from spring (Adrian Colyer, Richard MacDougall) are thinking really hard about scalable web services. This is a foundation that will let you write in Java but still be prepared for the future.
(2) Even better, don't go with Java, but leverage some of what you learned and pick up Scala. See http://www.scala-lang.org/ [scala-lang.org], or pick up Martin Odersky's book. Think of Scala as what Java would be if someone who appreciated terse, expressive syntax and great convention redesigned Java. Odersky wrote a reference JVM implementation while at Sun, and Scala compiles into Java bytecode and can directly use Scala libraries. (My first Scala project, for example, I used unboundid's LDAP libs directly in my Scala code.) Odersky along with some other luminaries (Viktor Klang, Paul Phillips, etc) have formed Typesafe, and are producing Scala the language + Akka (an actor framework) + Play (a web framework). Outside of play, many people are huge fans of Lift, and it does have some magic that no other framework has.
Remember how you said "modern" web application? Well, Scala supports functional programming, and you can fix functional and imperative code in the same application, which means you can support massively scalable sites by writing clean, idempotent code where needed.
If all this sounds bad, then I'd recommend Django+Python, as it is, imo, the best way for a relative web novice to produce decent code, and the amount you can do with a few hours reading docs and then digging in is shocking.
check what's available (Score:3)
Regarding programming languages, your decision may be conditioned to the deployment options. Do you want to run it on your own infrastructure, or do you want to put it on a shared host/cloud provider? For shared hosts, PHP or Python may be a good option.
Other aspect to consider is the widget toolkit. Do you have experience with one (or several) that may be more suited to a given language? As an example, GWT is Java-oriented, Dojo integrates well with Zend Framework (PHP), and (AFAIK) both ExtJS and DHTMLX are more language-agnostic. I actually use a lot DHTMLX and their scheduler component may be a good fit for what you're trying to do. Also, (at least) both DHTMLX and ExtJS have a design tool, so you can build your interface without the need for programming or any server-side code.
Finally, do you have other specific requirements, such as scalability, SGBD to use, multi-language support, big persistent data, complex objects, etc? That may also influence the choice of both the language and the framework. Remember, PHP applications are (mostly) stateless, and at every request your application starts from scratch. You can use cache and other tricks, but it will take you only so far - and if you are used to Java, you may take some time to adapt to these limitations.
My personal choice would be PHP with Zend Framework (v1.x), but I don't really like Java and don't have that much experience with other fancy web-oriented languages. Zend Framework is quite complete and probably will give you all the funcionality you may need for your application.
Re: (Score:2)
It is amazing how the world hasn't collapsed yet (given the amount of PHP products and the amount of PHP code deployed) by looking at that list. If PHP programmers can work around all those defects and limitations and create applications that work, I wouldn't call them hacks. They must be wizards, right? Or maybe they just try not to think of it as Java and have a coding style that will avoid most of the defects mentioned. Maybe.
Need some client side? (Score:5, Informative)
In other words, assume that Java ISN'T supported on the clientside.
Re: (Score:2)
Thought about sticking to a mobile app? (Score:3)
Depending your project's specifics, consider whether you actually need the web application. If it turns out that you don't, go straight for an Android app (since you know Java). After it's released, toss in a "dumb" (aka no admin area) web site -- it should amount to a couple of new (outsourced) views for whichever framework you picked to create your json or XML API.
I suggest this because writing complicated/interactive web views is a true mess for the uninitiated. The devil is in the plethora of browser-specific quirks, and you probably want to avoid running into them if you can get away with it.
If you really must, that said, there are lots of MVC frameworks for web development, including several in Java. Each language has its more popular ones; picking yours is, imho, mostly a matter of taste...
http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks [wikipedia.org]
For javascript, don't miss jQuery and qUnit.
Keep It Simple, Stupid (Score:3)
Java programmer here (Score:2)
Really like static compile time type checking which means a lot of client side programming pisses me off.
I really like Apache Click. For someone who is really happy working in Java it's a good tool.
Re: (Score:3)
Look at Spring Roo. (Score:2)
Specifically, look into the Spring Framework and Spring Roo.
Here's where you start: http://www.springsource.org/get-started [springsource.org]
Spring Roo is a shell that does code generation and scaffolding for Java web applications. You're basically 5 minutes from a basic CRUD app with a couple of entities (the typical Rails hello-world-I-made-a-blog stuff). It puts together a really nice stack based on Spring MVC, Maven, JPA and your choice of ORM and view technology. It makes heavy use of AspectJ to keep its boilerplate out
Re: (Score:2)
It's not that we're missing out. It's that some of us have put up with statically typed languages for 15 years, and have had enough of that crap.
If you don't like dynamic languages, fine, but implying that folks who choose to embrace FP and dynamic languages are "hobbyists" serves no purpose other than to expose your lack of depth as a developer.
Read this [martinfowler.com] and take a long hard look at yourself.
RoR / Python on Heroku (Score:4, Informative)
For reference, I come from a LAMP + CodeIgniter background. I've done some Java stuff for university and at IBM, but nothing on the web side.
If you're coming from a Java background, I'd suggest a Python + Django (heavier framework) / Flask (lighter framework), or Ruby on Rails on top of Heroku. PHP is cheap for hosting, expensive for developing. What's more important to you?
You can Google the differences between Python / Ruby. They're roughly the same, with Python requiring you to be more explicit while Ruby tends to do a little more "magic". Also, whitespace code blocks is a deal breaker for some people. I like Python more.
Heroku is free for a single web worker and a small shared database. They're built on top of AWS and charge a premium for the convenience of abstracting away dev ops. It's cheaper to use AWS directly or using a VPS, but at a time cost. How much time do you really want to spend doing dev ops rather than working on your core product?
I would worry about the web app first, then expose an API for use with mobile apps when it comes to it.
Web app development is drastically different from enterprise code. It's about constant iteration and deployment, scaling if necessary. Breaking out of your Java comfort zone will also help you grow as a programmer. You're going to have to learn HAML / LESS / JavaScript anyway for the front end.
Java, Struts and Velocity (Score:2)
Get a Tomcat server up and running and deploy your app there. Use Struts/Servlets for you Java structure and navigation, and Velocity to populate the templates. This is Tier 3 development (Keep the Logic, DataAccessObjects, and Templates separate). Velocity takes all of one day to learn and will save you a ton of time in the long run so you can focus on the HTML and the JAVA
http://velocity.apache.org/engine/releases/velocity-1.5/user-guide.html [apache.org]
Do NOT go the PHP route. As someone that works for a Fortune 500
Re: (Score:2)
Stick to your comfort zone, but build on it (Score:3)
Modern web applications use ajax. You need to pick a javascript library. Depending on your needs the right answer might be JQuery, Dojo, YUI, Prototype, etc.
If SQL Database:
You need to pick an ORM. Most people work with them now. The popular Java solution is hibernate. I'm a big fan of Apache Cayenne. You also need to pick a database. MySQL (or fork) or PostgreSQL are good choices.
else if NoSQL
pick a NoSQL database, but avoid CouchDB. Hadoop, mongo, cassandra... there's loads of them.
You need to pick a servlet container: ...
Tomcat, Jetty,
You need to pick a Java web framework:
There are hundreds of choices. Spring is the hot thing. There are many unpopular choices that are good like Wicket, Click, etc. It really depends on what you're building and how it can integrate with your ORM or NoSQL database. Click + Cayenne work well together. Wicket + Cayenne do as well. Spring works better with hibernate, etc.
For JSON, SimpleJSON is a good choice.
You also need to decide how you're hosting it. If you think you're going to do cloud computing, plan for it at the beginning of the project. Different providers offer NoSQL and SQL database options you can just use. It may simplify things. You also need to program significantly differently for a cloud environment to keep costs down. More requests mean more money with some. Lowering CPU load or minimizing database queries might matter too.
There isn't one right answer now. Young people use Python, PHP or Ruby. I see a lot of interest in Python. I'm not a big fan, but it's not a terrible language either.
If you think this could take off, sticking to popular software will aid in finding developers later. At work, we have a lot of problems because of our archaic stack of Mod Perl + (Ingres, PostgreSQL, MySQL, BDB and Lucene) + Apache HTTPD + HTML::Mason + DBIx::Class + legacy C apps running on Linux VMs. We're starting to throw in more java projects now. When I say legacy C, I mean pre ANSI C. This stuff was written in the 80s. No one has even heard of Ingres.
I have oddball tastes in Java like Cayenne and Click and I've made successful projects with them, but it won't help you on a resume and it won't be easy to get people that already know the technologies.
As for browsers, don't worry to much. If your site works in Safari or Chrome and Firefox, most people can see it. If you throw in IE9, you've got most things covered. Safari and Chrome both use the WebKit rendering engine, but have different JavaScript engines so you will want to test on both, but they do usually render similarly. Bonus points for old IE or Opera. Most browsers are trying to be standards compliant. If you want to target Opera, avoid Dojo javascript library.
Java is great for websites (Score:5, Insightful)
Almost all the sites I've built are written in Java. Stick with Java. I've written sites in PHP and I've also had to work on updates to some PHP sites. If you're already familiar with Java dealing with PHP will feel like a joke. PHP is great when you don't want to write your own software since there are so many publicly available stuff out there in PHP. Don't worry, you won't find a lack of Java libraries that will do anything you want to do.
Don't bother trying to learn a new language because you'll just slow yourself down trying to learn the semantics of the language instead of the details of the new libraries you'll be using. I know java gets a bad wrap in terms of performance but I've always found that Java kicks PHP's ass in terms of performance in the tests I've done.
The main issue with java is that when you're using a servlet container like Tomcat, the process runs constantly and takes up memory. It's not that much but it's hard to find Java hosting because the memory issues makes it hard for a webhost to put thousands of websites on the same server.
Your best bet is going to be to find a cheap VPN when you get started but check the big webhosts to. I remember LunarPages used to offer JSP support in the past.
There are a bunch of different frameworks. Stick to ones that are popular because you'd rather have some limited functionality now rather than an unsupported framework in the future. Which has happened to me.
I believe right now that's Spring [springsource.org] but Struts is still pretty popular too.
I've found NetBeans [netbeans.org] to be a great IDE and it supports Spring.
Re: (Score:3)
As someone who develops with PHP for a living, I'm going to go ahead and say: Stick with what you know. It doesn't matter what the back end of your system is written in - as long as it is written well. If you know Java, then use Java. There's lots of Java sites out there and, if it wasn't for the .jsp extension on the pages, I wouldn't ever know the difference.
First, dont ask in slashdot. (Score:4, Funny)
Most importantly, stop listening to strangers like me.
Facebook, Google+ (Score:4, Informative)
For the general public, it will be a site where they can view upcoming events, filter them by type, date etc. and view details of events they're interested in. There will also be an admin section to the app where organizations who want to post their events can log in and set them up.
Doesn't Facebook, Google, Microsoft, Yahoo, and RSS feeds already have this down? You may want to consider using API's that hook into existing infrastructure rather than reinventing the wheel.
Stick with Java (Score:3)
Don't bother learning PHP it'll just slow you down learning the semantics of a new language and if you're used to dealing with Java PHP will feel like a joke. Java gets a bad wrap but I've found it to be faster than PHP in my tests.
I build most of my sites in Java using my own MVC framework. I've done some sites in PHP and have had to modify other PHP sites as well as looked into other languages. I still like Java the best and you can find a library to do almost anything you want. The only reason I'd pick something like PHP these days is if I don't want to build a site myself and want to use something prebuilt like wordpress or Joomla.
The only downside is that your servlet container (ie tomcat) is persistent and will take up a bit of memory. Not a huge amount but it makes it difficult to find cheap webhosting because providers can't throw thousands of websites on a server like they can with plain HTML and PHP. Try and find a good cheap VPS it's more secure and you won't have to worry about your site getting defaced because some other idiot didn't update their PHP software. That's happened to me.
Don't go with new frameworks. Go with popular ones that have been around for a while. I've been bitten in the ass when I built a website for a client and the framework I used was no longer around.
Spring [springsource.org] is a good choice. I like to use NetBeans [netbeans.org] as my IDE. I've found it to work the best for me.
Don't write a mobile app (Score:3, Interesting)
There's nothing I hate more than going to a mobile web site, getting a nagging popup telling me to download their app, and then finding out that the app gives me less functionality than the web site.
Just build a good mobile website. Modern mobile web browsers have become quite capable and there are fewer and fewer advantages to an app. And I really don't want to download an app for every webpage I frequent, that's what bookmarks are for.
Stick with Java (Score:3)
First, I'd like to say whoever thinks there's no serious web development in Java simply doesn't know what they're talking about. Probably the same kind of person who believes Java is incredibly slow. This isn't 1998. Things have changed a lot.
Second, I actually came from a PHP background. I think PHP gets a bad rap because it's so easy to learn, so there's TONS of "developers" out there who never took the time to learn how to properly design and develop software with it. But it can be done. If you go this route, look into an MVC framework. Zend has some really cool stuff.
Finally, I would personally recommend sticking with Java. Like many here probably, I make my living with Java and so I'm most definitely biased. I work on a "real time" Java team at a major corporation, and we deal with anything that is real time and deals with Java. This obviously includes web development, which is my personal area of expertise. If you name it, we've developed with it. I've used many different frameworks, both server and client side.
For the server side, I think the best Java framework hands down is Spring. Its MVC module is a dream, and the framework itself is very well designed. The API is well documented. There's loads of resources too. It's really a developer's framework; made by developer for developers. The Spring guys really know what they're doing. For the view, I'd say stick with JSP. The newer versions have a lot of powerful features over their earlier incarnations, and you keep full control over the HTML. Learning how to debug JSF/RichFaces/ICEfaces/etc is a pain in the butt, especially if you're still learning web development with Java. Other good alternatives for view would be lightweight templating frameworks, like Freemarker or Velocity (which Spring has good integration with).
For client side, you need to brush up on HTML and DOM. You need to make yourself familiar with a good JavaScript framework, my personal favorite is jQuery. Learn how to keep your markup (HTML), your functionality (JavaScript), and your styling (CSS) logically separated. I hate to see these things embedded into one another like a nasty hodgepodge of bad software design.
Even more important (Score:4, Insightful)
Forget PHP. The language has seen very little progress lately. But even that wouldn't matter, as PHP is slow and horrible. Very inconsistent as well, as the it's little more than glue between some libraries.
Re: (Score:2, Funny)
Ghaaa! GHAAA!! I eat your face for saying "forget PHP".
PHP is superior.. I say this because you can do damn near anything in PHP. I can generate dynamic SVG in PHP, I can post dynamic encrypted AJAX-script in PHP, I can communicate with my server's serical port in PHP, I eat your face in PHP!!!
Nothing you can do in any language is superior to any other except for SIMPLICITY! The more human-readable the code is, the more PHP ZOMBIES EAT YOUR FACE OFF!!!
Re: (Score:3)
Yeah, you can do a lot of weird things, too.
$a = array('7.1'); // true
var_dump(in_array('7.10', $a));
http://www.phpwtf.org/ [phpwtf.org]
Re: (Score:3)
Oh and I do work with PHP, and I hate the ambiguity of the code.
Re: (Score:2)
You can do that with any language that writes to standard output. Jeezus, I've never heard anyone try to describe PHP as unique.
Re: (Score:2)
Go tell that to Python.
Re: (Score:2)
Re: (Score:3)
Re:Even more important (Score:5, Insightful)
TL;DR version is that PHP is crap. For a lengthy treatment of the subject, see my sig.
Re:Even more important (Score:4, Interesting)
If you didn't get so carried away by a rant of your own, you might have noticed that the linked article is not written by me. I do happen to agree with most of its points, however, and certainly with the overall conclusion.
Re: (Score:3)
But I can't imagine doing anything substantial with it.
Right. It would be unimaginable if sites like Facebook or Wikipedia were based on it.
Re: (Score:2, Flamebait)
ANYTHING is better than PHP. Anything. Even CGI scripts in Perl.
And Java is fine for web development. In particular, Wicket + JRebel + IDEA can allow one to write code waaaay faster than stupid PHP coders.
Also, I might recommend Scala and Typesafe stack: http://typesafe.com/stack [typesafe.com] - it's quite nice and powerful.
Re: (Score:3)
Re:Most important (Score:5, Insightful)
Re:Most important (Score:5, Insightful)
Python, or my personal preference Ruby, are vastly superior choices. Django and Rails are intentionally -- and more to the point, well -- designed to be friendly web frameworks, built on top of their respective languages.
I don't even call PHP a "language". It is just a hodgepodge of inconsistent utility functions bundled together. PHP was originally designed with the Web in mind, and only later added pretensions of being a general-purpose language, with Object Orientation kind of bolted on even later as an afterthought.
Because Python and Ruby are far more internally consistent than PHP (Ruby even more than Python, in my opinion), they are also easier to learn. However, learning the language and also the framework entails some serious work. That is just the nature of the beast... there is no getting around it. You need to know the language, the framework, HTML, CSS, and JavaScript.
Nobody said serious web development was easy.
Re: (Score:3)
most of the sites for which I develop have been on hosted servers. And most of those support Rails these days, but relatively few actively support Python and its frameworks.
I haven't noticed this. The only thing that Ruby has over Python is that it has one framework, Rails, that predominates. With Python there is Django, TurboGears, Zope, and a bunch of others. However I've never found a hosting company that offers Rails but not Python.
Re: (Score:3, Informative)
Maybe it was JavaScript after all?
At the USENIX annual conference last month, Gmail engineer Adam de Boor surprised the audience by noting that the company's Gmail service was written entirely in JavaScript, and that all of its code, around 443,000 lines worth, was written by hand.
http://www.infoworld.com/d/developer-world/google-executive-frustrated-java-c-complexity-375
Re: (Score:3)
Re:Most important (Score:5, Interesting)
Google is not a PHP/Python shop. The four development languages are C++, Java, Python, and Go.
Gmail is indeed written in Java.
Re: (Score:3, Informative)
Re:Most important (Score:5, Informative)
You're talking at cross purposes here. Obviously the front-end UI of any modern Web application is going to be written using a lot of JavaScript. Java, Python, and PHP -- and many other languages -- are primarily for the back-end code. Gmail is certainly not accessing its database or implementing IMAP and SMTP in JavaScript.
Re: (Score:3, Funny)
Re: (Score:2)
Re: (Score:3, Insightful)
You're talking about desktop GUI development - the submitter is asking about Java for web development. That's quite different. How many GUI apps do you use regularly that are written in Python, Ruby, or even Tcl/Tk?
Re: (Score:2)
Re:Nothing wrong with PHP. Don't be a language big (Score:4, Insightful)
PHP is garbage. Bad design all over the place. And I'm talking both about the language as well as the standard mess it calls a "library". It is the new BASIC.. stay away it'll damage your brain. For details see:
http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/ [veekun.com]
There are better alternatives if you want to go the dynamic route: Ruby on Rails and I hear Python / Django is great too.
There's nothing wrong with Java as long as you know how to use it. But its always good to learn a new language. ASP.Net is also nice if you don't want to go dynamic.
The hardest part about moving away from Java is losing all the cool static analysis tools that are incorporated in Eclipse as well as tools such as FindBugs. But our experience with RoR (in spite of it missing some needed feature many Java frameworks have).
In summary: learn anything but PHP.. it truly is garbage that must die.
Re: (Score:2)
Re: (Score:3)
"But its always good to learn a new language. ASP.Net is also nice if you don't want to go dynamic."
Microsoft implemented the DLR (Dynamic Language Runtime) in .NET 4 that allows you to have dynamic objects. The best part is you can even do your own dynamic implementation quite trivially (it's just a case of implementing certain interfaces, inheriting certain objects). This means you have the best of both worlds, you can go dynamic where it makes sense, whilst stick to the benefits of type safety and better
Re: (Score:2)
Re:Nothing wrong with PHP. Don't be a language big (Score:4, Insightful)
Parent was me, forgot to log in
Re: (Score:3)
It is easier to switch to C# from Java than PHP, which is an ugly hack on top of ugly hacks. Classes, namespaces, type safety, all these are tacked on poorly to PHP, and native in Java or C#.
Just use ASP.NET if you want to use something familiar to Java.
Re:Use a Framework! (Score:5, Insightful)
Frameworks are good only if all of the following are true:
1)You want to do exactly what the framework was set up to do. (in other words, everything about your app is cookie cutter)
2)You aren't a very good programmer
3)You already know the framework
4)You don't want to do something wild and crazy, like write an sql query (the framework way tends to use 3 objects which define interfaces and require you to jump through hoops, all so it will automatically grab the data and unbox it for you in the format it assumes you want it in, rather than the format you actually want it in).
5)You absolutely don't want to use any advanced database functionality whatsoever, since most frameworks these days assume that they can create and alter tables at will.
If those first two things aren't true, you're going to spend an order of magnitude more time working around the framework's limitations than you will save by using it. If 2 and 3 aren't true, you'll spend more time learning how to use the framework than you'd save by using it.
Frameworks are good for getting low to moderately skilled developers to pump out cookie cutter type apps quickly (so long as those apps don't need to worry about little things like scale and performance). They're absolutely horrible if you want to do anything novel, you need performance, or you actually know sql and just want to write a simple god damn query.
Re:Use a Framework! (Score:4, Informative)
Re: (Score:2)
Re:Use a Framework! (Score:4, Insightful)
Re: (Score:2)
I agree with you and I frequently use Railo on AWS/EC2 images. I really don't know why people are so judgmental on ColdFusion. Many of them never tried it. It's fast, mature, easy to deploy and plays well with others (java, .net, etc). I first used ColdFusion in 1995. I was bundled FREE with Oreilly 'website pro' web server software back in the days when they were making software.
Re: (Score:2)
I think people are judgemental because it's Adobe. I'm surprised it doesn't bug every third web site visitor to call the sys-admin and ask them to run Adobe Update, and have 4 security vulns a day.
Re: (Score:3)
Re: (Score:2)
Re: (Score:3)
(I'm going to make my reply here as it's about midway on the page and I haven't seen anyone make this very obvious point.)
You can teach just about anyone to write usable Python, PHP, or Ruby. Fast. You can teach people with high school diplomas how to code in these languages especially if you have a framework in place.
Java not so much.
If you want to get started fast and have access to potential talent, go with the more accessible skill set. If you want to do it *just* right (and have, imo, a needlessly comp