Ask Slashdot: Tips For Designing a Modern Web Application?
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."
It will save you a ton of time. Some people here would argue that you should build from scratch, but ignore them.
There are a lot of good frameworks out there. Here is a list: http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks
If you're familiar with Java but not web development, it sounds like Grails might be a good place to start.
How can I believe you when you tell me what I don't want to hear?
Okay, okay, stop laughing. Take a look at Railo. It's open source, cold fusion, and runs on Java.
It's been a long time since I've used the Google Widget Toolkit, but it was an interesting shim between Java and WebApps. Would someone with more recent experience than mine please chime in and say whether it would be useful to the original poster?
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.
No! Django is newer, so RoR developers are living on borrowed time.
its the worst thing you could ever attempt to learn
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
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.
I'm long time Java developer myself and I find Python to be a natural transition. We've been using CherryPy at work and it's a pleasure to use. Clean, concise and simple. And it has a number of templating languages to use as well.
@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.
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.
Do not look at laser with remaining good eye.
Just use a CMS and call it good. I remember the days before very customizable templating where you hand-roled all that web site crap yourself. There are plenty of CMSs out there (TomatoCMS, Wordpress, Joomla, LightCMS, ezPublish, etc) that will do exactly what you want in about 20 minutes of your time. There's also lots of customizing and add-on's you can get for the more popular CMS's that I mentioned, too. And to keep to your Java roots, you can do all the client side stuff you want in JQuery or equivalent.
That's my $0.02.
staying in your "Java comfort zone" is just silly. PHP, ASP, JSP ... all follow a similar construct. It's called "application for web in language ___".
Honestly, if you've already learned Java you've got 90% of the knowledge you need for PHP. All you need to know is . = + and variables are prefixed with $. The function names are different, but so what? they're much simpler than this.that.something.else.ghaaa
Java is not server-centric the way PHP is server-centric. You're basically saying "I want to learn how to drive, but only ONE model/make of car".
Learn PHP, it's worth it. Your soft, sensitive, tender Java belly will be just fine.
Java for the web, you mean you don't already know, JSP? You could just write java server pages, or add in the java standard templete library. Its not difficult, but might not be MVC enough for large scale development, So add Apache Wicket or Spring MVC or possibly playframework.
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/, 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.
What you describe sounds a lot like many different existing applications. You may benefit from checking out what is already out there (opensource) and see if it is a good fit (or a good starting point) instead of building your own. Also, you may get some new ideas for your own design, so you won't waste your time.
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.
Yep, that'd be great advice. After we shoot all living PHP developers and go back in time to change PHP to be something decent.
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 - it's quite nice and powerful.
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?
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/
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.
To be honest you're gong to have to know some HTML/CSS at some point. It's considered impolite these days to insist (or expect) that the client side understands Java.
In other words, assume that Java ISN'T supported on the clientside.
... if it's design you're after. Or is programming you want to ask about? The title of you submission mentions "design", but your extended explanation focuses on the programming rather than the design aspect. Maybe you should clarify. I'm not at all familiar with web programming. But my biases are against apps that have too many funny looking icons, menu items, and buttons.
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
For javascript, don't miss jQuery and qUnit.
Honestly, not such a fan of either Java or PHP... I'd probably suggest Python/Django, NodeJS/Express or ASP.Net MVC as more modern frameworks that are faster to get up and running with.
Michael J. Ryan - tracker1.info
Keep simple. I are suspect to suggest something, but I think the combo pure Java (no fancy frameworks) + Apache Tomcat + JSP is flexible enought to many web projects. You can use simple JSP, HTML with some JSP "tags", or the entire page created with a Java Class if you wish, and you can do more complex things when you need
Religion: The greatest weapon of mass destruction of all time
Comment removed based on user account deletion
I completely agree and don't understand the hate that php gets. PHP is a language for web dethronement. You should be fine going from Java to PHP due to PHP being mostly based on Java. I would have modded the parent up, but didn't see the point since it was posted as AC, so decided to post in support instead.
Python with CherryPy and Jinja2 is my preferred backend system. All of these tools can be picked up in trivial amounts of time and allow for excellent organization and maintainability of code. I'd strongly suggest staying away from PHP.
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.
Specifically, look into the Spring Framework and Spring Roo.
Here's where you start: http://www.springsource.org/get-started
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 of your actual code, so if you decide to stop using Roo in the future, you can - there's no hard dependency on it, it just generates code.. If you decide to do something fancy like use GWT for your UI, Roo can help with that as well.
Quick Roo demo: http://youtu.be/K78vL72XDqw
Spring is a *huge* set of frameworks based around an excellent IoC container. Roo makes getting started simple, and lets you see how everything is supposed to fit together, which is usually the hardest part in the Java world. Just keep in mind that Spring is not web-focused - it has modules for web stuff, MVC, templating, etc., but also a ton of other stuff you probably don't need.
Recommend you grab the Spring Tool Suite from http://www.springsource.org/springsource-tool-suite-download (no need to reg, just agree to terms). It's just Eclipse done up nicely with all the extensions you'll need, Roo, and Maven all ready to go. Don't waste time trying to set up vanilla Eclipse.
One more thing: Ignore all the Java hate. All the PHP/Ruby/Python hobbyists are missing out on the joys of proper typing and top-notch tooling. Duck typing doesn't just *sound* dumb.
Good luck.
What do you mean you cannot build a 'modern' webapp using Java? It's done all the time. If memory serves, Gmail is in Java. I also disagree with PHP being the obvious choice. It's a lot like JavaScript: it's everywhere, so people use it. It doesn't change the fact that it's a piece of rubbish. Ruby and Python are much better suited towards modern web development. PHP is glorified template system that is extremely inconsistent and overall ass backwards. The whole notion of mapping a URI to a file is so 1990's.
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.
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
Do NOT go the PHP route. As someone that works for a Fortune 500 company and who has been in the business for 12 years, you don't want to get mixed up in the mess that is PHP debugging and updating. With PHP you will have to learn a new language that doesn't extend very well, is a pain in the ass to debug, and you'll have a tendency to intertwine your application logic with your template, which will make it an absolute bitch when you come around a year later and want to change the look and feel of your site.
Parent was me, forgot to log in
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.
MidnightBSD: The BSD for Everyone
Regardless of what back end language you pick, a good front end helps a lot. I have found the twitter bootstrap package to be very helpful..
You can find it at: http://twitter.github.com/bootstrap/
They have a nice dynamic setup you can use that allows your page to collapse down to be easily usable by phone browsers, tablets, etc... It also gives you a good display framework to start from to ensure consistancy of your user interface.. and since the display is css based, you can tweak it how you want.
ariven.com
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 but Struts is still pretty popular too.
I've found NetBeans to be a great IDE and it supports Spring.
Most importantly, stop listening to strangers like me.
sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
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.
I work as a Java developer and we're building websites on an SOA architecture with restful backends. In this regard we see the web app as "just another client".
We use spring MVC for the browser-facing server app, and Jersey for the backend (I use the terms loosely here because this backend is still public-facing since it serves the mobile apps as well, so it is in itself a standalone secure web app).
We use velocity or freemarker for the web app pages.
I would warm-heartedly recommend this setup, it's hard to go wrong with it. That said, it's only one valid approach.
Google is not a PHP/Python shop. The four development languages are C++, Java, Python, and Go.
Gmail is indeed written in Java.
Google Web Toolkit.
I find it funny that you think PHP is garbage (granted, most of the nitpicks are true, but nobody is forcing you to use it), but somewhat mention Eclipse as a good thing. From my (limited) experience, Eclipse is a poor excuse of an IDE that can't even handle gracefuly a PHP application such as Magento (a somewhat big PHP codebase, but small if compared to an "enterprise" Java project).
Sorry, meant to reply to the above post. Gmail is not written with the Google Web Toolkit, but other Google applications (which can be considered "modern") are.
Lol. ASP.NET Is so last century (just like JSP solutions in Java). It is easy to spot these sites designed to be mostly page-oriented and just a bit of a yawn to use. GWT is much much better (plus portable to lots of different server O/S for your big, or little, server farms). The Microsoft research to reproduce GWT, called Project Volta, is stillborn. This is a shame because Volta would have given the .NET dudes some of the goodness of GWT (although still platform-limited, as ever with MS).
lol. Hopefully you are aware that Oracle was defeated on claims of copyright and patent infringement. Just pointing it out in case you weren't aware (or if anyone takes you seriously). Java is *FREEEEEEEEEEEE*!!!
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 is a good choice. I like to use NetBeans as my IDE. I've found it to work the best for me.
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.
For a site about things like basic rights, Slashdot users sure do like to censor "dissent".
I've been able to build some surprisingly sophisticated and full-featured web applications using Python wrapped inside CherryPy and sending the output through Django. Really amazing how much you can do with this, with the added benefit of portability if you ever want or need to move it across platforms.
If portability isn't an issue, by using Python's ctypes you can call almost any back-end Linux, Windows or Mac OS X library for the ability to do almost anything you want.
Did you know that gullible is not in the dictionary?
(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 complicated code base) you can go with Java, C++, or PERL.
blog
What's the point of abandoning Java that he already knows for PHP he does not? PHP is not any better - in fact, by most metrics, it's worse.
I second countach74.
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.
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.
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.
Truckin like the Doo-Dah man...
You're right on the list of four languages. But Gmail (at least the frontend) is written in hand-coded Javascript. The whole point of the Closure javascript-to-javascript compiler was to optimize and obfuscate hand-coded Javascript for Gmail.
You extremely forgot javascript. They do TONS in javascript. Including gmail.
I'm not a big fan of complex frameworks, myself... It's too much "magic" for my tastes. Have you experimented with CherryPy? I find it absolutely fantastic. It's not a web framework, but HTTP framework.
Hi,
Well, you're going to need a presentation layer, which may or may not be obvious to you but HTML5 and JavaScript. You'll want to learn JavaScript but shortcut the process with jQuery and jQuery UI. And of course CSS3. So now you've got a pretty frontend, look and feel, behaviors, etc.
For the backend why not stick with Java? You know it already. If you're thinking PHP then that's fine too but stay away from the frameworks and shortcuts for PHP because they always end up becoming a burden down the road for upgrades, ongoing maintenance, and expansion.
I've had great luck with LAMP stack and with today's cloud bits and strong hosting providers, getting the infrastructure is easier than ever.
And if you're looking for books, try my JavaScript Step by Step book for JavaScript related (it includes jQuery too). O'Reilly has some good HTML5 material too.
Steve
"... it has a quick learning curve and really does provides ample flexibility and power."
Not even close. Due to the gross inconsistencies that plague PHP throughout, its learning curve is terrible. Yes, you can get a "Hello World" app running quickly. But you can get a Rails "Hello World" application up and running just as quickly, with even less knowledge of the language.
And due to those same inconsistencies, learning PHP entails much more memorizing of a boatload of functions than other languages do, each of them with a bizarre list of parameters that are all different and even in different orders. Python and Ruby, on the other hand, are far more consistent in the way they operate and how methods are built.
If I wanted something that was easy to learn, PHP is just about the last choice I would make.
Web development takes several languages:
* Yes, or NoSQL, but I'm not sure I would recommend it.
After working on 40 web applications over 7 years, I have found that it's best to push things to the edges, and do as much as you can in the top layer (CSS, HTML, and JavaScript) or bottom (SQL). The middle layer, where you must decide between Java, Python, Perl, Python, Scala, or several other server-side languages, I try to keep as thin as I possibly can --- more like a glue (or duct tape?) between the client and database.
It takes the most learning to do it this way. You must know JavaScript, HTML, and CSS well (jQuery helps). And you must also know advanced features of your database (I recommend SQLite or PostgreSQL). But it typically leads to lightweight, efficient apps.
I wish I had mod points for this. Ruby has a lot more complexity (and in ways, more power because of it) than Python, but with both Ruby and Python, one can get the basics very quickly (especially true for Python, IMO). Shortly after learning basic syntax with Python, I was creating decent-sized blocks of code and executing them without error. It just works--even when you think, "Hmm, can I do this?"
Now compare that with PHP where bug reporting is in my opinion, not that helpful and bugs are easy to make. Development in PHP takes far longer than it should because the language just plain sucks.
I admit that it took a while to get my head wrapped around what that "magic" was doing behind the scenes, which is really necessary if you are serious about developing with it.
But I have, and now, given the graphics, I can get a basic site up and running very quickly, the majority of the time being spent on the layouts: HTML and CSS.
I have only one objection to Python, but it is a serious objection: 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.
Ahh... I run my own AWS instances and host things that way.
FORGET java, forget everything you know about JAVA development.
Go with PHP, and CodeIgniter or similar framework which does not force you to their patterns (ZFW used to be like this...)
and keep it simple - keep everything as simple as possible.
And "PHP Templating" is *NOT* templating, it is spaghetti some ate yesterday and came up today.
I second that.
Java is really nice to have a 1 million line code complex business intelligence CRM and enterrpise app that takes a year to develop and is scalable with real engineering and architecture. But for a simple website? Come on!
Php has got a really bad wrap like its the Visual Basic of web development. But basic has its purpose for simple client server apps that need to be made quickly with up to medium complexity. Php with the right framework is great in that a good week you can have something ready that would take a month in Java.
Also what about liability? Will your ISP carrier it forever? How do you know Oracle wont sue for copyright violation for not buying an ORacle RDMS license? Their lawyers have proven to take this extreme view of copyright as a symbol with the same name in the same structure sequence identical to actual copyright infringement. I do not agree with that view and neither did the judge but I do not trust Oracle and this guy can not afford to defend himself.
Php is run inside the natively compiled web server software engine so it is faster than interpreted languages, though not as fast as .NET and Java.
It is a shame because I learned real object oriented programing with Java. It is amazing what mismanagement of an asset can do to a language.
http://saveie6.com/
I hope you're right. However, Larry Ellison won't see it your way. He will see it more in terms of (legally speaking), "Oh, it's on now, bitches."
So we'll have to wait for the appeals process to run its course. I wouldn't be surprised if Ellison is at least as good at prolonging the inevitable as, say, Darl McBride.
Because it takes 3x the effort and 4x the amount of code with its silly patterns to get anything done. Php is like the VB. Its great to get things done quick if you do not need Enterprise Application Support with its own framework not to mention not all ISPs even support it all.
Oracle has done so much damage to Java.
http://saveie6.com/
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.
Breakfast served all day!
Php is like the VB. Its great to get things done quick if you do not need Enterprise Application Support with its own framework not to mention not all ISPs even support it all.
PHP is not the only language that lets you do things quick - there's also Python and Ruby - except with the latter two, things done quick will much more likely be done better, as well.
You mention being comfortable in java, but you also say (essentially) that you don't know a thing about client side coding. You mention WebObjects, which is rare, and I imagine most folks don't have a clue what that is. But you don't mention MVC, which seems odd to me.
You're going to write a new app using 2-4 new frameworks. As far as I'm concerned, frameworks are more work to learn than a new language.
As someone who enjoyed WO in the Obj-C days and suffered through it in the Java days, here's my advice:
Go with Ruby on Rails. Ruby is a fun language. Rails is a reasonable framework. On the client you could do a lot worse than jQuery, twitter bootstrap, and maybe Ember.js or backbone for the fancy stuff. I think that starting out with ember/backbone will give you a leg up when you make the move to non-web mobile platforms. Oh, and I do recommend coffeescript - it feels a lot saner to an OO developer than raw javascript.
Is there anything better for making a fairly simple HTML/appserver/DB Web app than Struts2?
No "AJAX", but you can add interactive embedded widgets to the page after you have the Struts2 app basically working. Or is there a way to develop full AJAX backed by Struts2 now? Or maybe that's all too complex. I think it's too complex, but I'm not sure what to use instead.
--
make install -not war
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
ffs, let the user decide whether they want to see the mobile app or the full site, or a discrete application. Don't put too much weight on what browser they are using and decide for them what they want, fascist-style. Try not to ask them, every single time... make the cookie remember their decision, but also give them the option to change their mind later if they wish. The best apps are utilitarian, not flashy pretty crap. Keep it simple. And don't succumb to feature creep... don't keep adding features just because you can. Pick a function, and stick to it, and make a new app for your new features that have nothing to do with the original intent of your app.
The Admin and the Engineer
GMail, and much of Google's stuff is written with GWT, which is a platform for developing the client-side of web applications that compiles Java code into JS. You can't really make a modern web app with Java and run it as java (you know, through a JRE, unless someone makes a JRE in the browser, and lol @ that), but you can cross-compile. GWT is like Coffeescript on steroids with a framework behind it as well. These meta-compilation schemes are becoming more and more popular. Look at Facebook, they write their website in PHP and compile it to C++ for efficiency with Hiphop. Google's Traceur compiles code from ES5+ down to ES3 so you can write code with advanced ES5 features on modern browsers that still only have ES3 support.
It is still pretty common to write Java back-ends (primarily on Tomcat and a few other major players), but that's becoming less and less common in newer more modern web apps. I have no citation for this outside of my own observations, and I surely haven't seen everything so I might just be horribly wrong.
You didn't say if you wanted to stick with open-source entirely, so I'm suggesting a 50/50 deal :)
ExtJS is a fantastic front-end development tool. Yes, you'll have to learn Javascript, but (a) that'll be pretty easy given your Java background because syntactically they're very similar and (b) that will remove all the cross-browser concerns... although it WILL require Javascript on the client, but frankly, while some people do run with it off and browsers on feature phones and such sometimes don't have it, Javascript is fairly close to assumed these days in web development. A lot of people talk about non-intrusive JS and progressive enhancement, which is all fine and good but I for one think the time for that has passed. ExtJS is a commercial product, however, there IS an option to use it in a JPL'd application. If that's okay for your application then you can get it for free.
DWR on the server-side, a great OSS project, is a Java-based solution that makes your server code SO incredibly clean and simple to write... you wind up with nothing but POJOs, and you don't (typically) deal with session or state of any kind. Best of all, it's a PERFECT match with ExtJS because what you wind up writing is really a service-oriented facade that the client makes use of, rather than coding the navigation logic of your webapp on the server, as is typical in Java web app development with most frameworks. It makes things incredibly simple and easy, cutting out so much complexity you'll wonder why you haven't been doing this all along.
If a pion (n-) collides with a proton in the woods & noone is there to hear it, does lamdba decay into the source pa
If i was starting new today i'd be learning with meteor (http://meteor.com)
I bet GP doesn't even know what "static analysis" is.. hence the lack of knowledge about Eclipse.
Am I the only old fart with lousy eyes mis-read this and thought it was about bandwidth limitations?
Since the original poster wanted advise about web apps (and not mere flamewars re: Java vs PHP) here goes an attempt at some advice on creating a "modern" web app:
1. Get familiar with CSS3 and other enhancements to make your app mobile friendly. .. think Sesame Street.com. Of course this much depends on your audience.
2. Get a modern looking design. Usually this means pure colors
3. Start learning HTML5
4. Don't write raw JS. Use jQuery or some other JS framework (Dojo, ExtJS/Sencha, GWT, etc..) to keep your JS compatible accross browsers.
5. Consider CSS frameworks like Blueprint
6. The Rails tutorial has some good tips on modern sites. Including using RESTful URLs instead of *.jsp, *.asp, *.php file extensions (who cares what language you're using.. why should that be exposed to the user)
7. Gather detailed stats on your site visitors (info is gold these days)
8. Simplify your login/registration process. Consider using OpenID, or OAuth for site access
9. Use a third party library/module for authentication/authorization if a good one is available for your platform.. don't re-invent the wheel
10. Use a third party library/module for credit card processing (I like Shopify's ActiveMerchant)
I'm sure others have good tips as well. A lot of this is really language/platform agnostic.
Right... and my comment towards Java for web programming was directed at back end programming, because that's the only *real* choice one has as far as language is concerned. Yes, I realize one can compile other languages in JS, but in the end you're still dealing with JS. And I agree with you completely about Java back-ends losing popularity; perhaps it's because of all the negative opinions of Java? I know I for one stay away from it because of its proprietary nature.
I would say that before you go jumping into any particular framework you spend a bit of time up front to learn the low-level details of how web apps actually work(something a lot of devs seem to skip). Learn exactly how HTTP post and get operations work, learn about how sessions and related to that cookies work, learn about SSL and security, learn about how various push technologies(such as web sockets and...sigh....comet) work. Also learn about data interchanges(mainly JSON) work.
Doing this up front will not only help you develop a better website, it will also make it MUCH simpler for you to develop and maintain your mobile apps, esp. if you really want to go beyond bolting a few buttons to a web view
Monstar L
I admit, I was not a fan of the white space deal at first... in fact, I'm still not sure I "like" it. Because of the white space issue, it becomes a little more important to use a decent text editor so one can move entire blocks around easily (indent entire chunks all at once), which for me rules out using my go-to editor: vim. Actually, there's probably a way to indent a block of code all at once in vim, but I don't know how to do it.
The bug reporting in PHP isn't my primary grief about the language, actually. It's that everything is different for no apparent reason and there's little organization to the whole thing. I have enough trouble keeping my own projects sanely organized. Perhaps I gravitate towards Python because it encourages me to program cleanly and maintainably--I recognize that my dislike for PHP my largely be because I am not an extremely experienced programmer. However, from what I've read around the web, the vast majority of programmers who have given Python a real chance have moved away from PHP. Anecdotal evidence? Absolutely. :)
and Comic Sans, or if you are feeling sophisticated use Papyrus.
"You'll get nothing, and you'll like it!"
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 and take a long hard look at yourself.
I inject a little (apparently very well targeted) teasing into a thread full of uninformed anti-Java ragefacing, and you're judging *me*?
My implication served my purpose just fine (hi there!), and may or may not reflect my actual feelings on dynamic languages.
It's that some of us have put up with statically typed languages for 15 years, and have had enough of that crap.
I've had enough of this crap.
Let's be friends! Nay, will you be my pair programming partner? Imagine the insights and perspectives we could share! Imagine the paradigms we could shift, the behavior-driven mocking we could exchange while rebasing our git trees and eating Mongos. Yes, Mongos!
WILL YOU ACCEPT MY PULL REQUEST?
So hot.
OP replying here. I actually stated I wanted to use the right tool. I didn't say I wouldn't learn PHP or any other language, just that I would prefer to stay in my comfort zone (in my case Java). Part of that reasoning is because the end goal is a working website, not adding another technology to my resume. I've come across a number of people who jump from one language/framework to another with each new project they embark on. They end up being a mediocre jack of all trades and master of none.
What it sounds like that if you are comfortable building in Java the JSP framework would be a natural choice for you. Using JSP with a database to get the parameters and plugging them into the webpage would be an obvious choice and would make it easier to create an android app with it. A good book for designing and building android applications is Reto Meier series of books about android development. You could design the front end in something like dreamweaver and use the parameters to design the app with eclipse. These developments programs have excellent query halping hints with the programming and an application can be developed easily. For the apple end you could use a server or an LAMP setup and run the web page after DNS on your own server. A good book to use for designing is Bennett and Farmer's Object Orientated System analysis and design Second to fourth edition as it is important to design a web application fro the start so that you can scale it well. To tend to it run it on one or more servers and load balance it so that you have minimal downtime. Good luck with it.
+1 Scala + Play = awesomeness!
Rapid development and iteration, combined with high performance.
Thanks for all of you who took the time to comment. It's very much appreciated. For those whose comments refer to the word "modern" in the title, this wasn't my word choice. My submission title did not include that word (nor "tips"); the editors chose that title.
I have had great experiences using the "Java EE" toolkit (basically just a combination of servlet and JPA technologies) and Spring MVC (Spring's front-end Web framework) to build nice clean modern Web sites and applications.
The great thing about this combination is nothing is too different from the stuff you've done before if you've done any medium- to large-scale Java programming before. Multiple vendors, commercial and FOSS, implement the specifications. JPA is one of the better ORMs I've seen (second only to CLSQL and probably more comprehensive, anyway). Most everything is done with simple annotations. And Spring is very well-mannered; you can take as much or as little as you like. Once I had to hook a Web front-end up to an application with a custom authentication system... it was cake to implement the Spring interfaces and suddenly my application was a fully acceptable auth provider for its own Web interface.
I have started a write-up on this at http://quadium.net/~vsync/tech/java-servers/ and my goal was to consolidate and smooth some of the information I had to scrounge over the years about the process. There is a lot of Java information out there but lots is outdated and much seems to assume familiarity or use of this or that IDE, and at least online I haven't found many comprehensive sources. That said, sadly once you get past the first bits of my write-up it gets to be more and more of an outline. But your perspective as someone familiar with Java but wanting to get into this aspect of it would be greatly appreciated.
If you're interested I believe a while ago someone on Reddit gave me some links to some Spring MVC tutorials that seemed decent as well. I can try to dig them up if you'd like.
TO BUY A NEW CAR WOULD MAKE YOU SEXUALLY ATTRACTIVE.
That's actually some other weird language that nobody uses. But it compiles to javascript.
If you mod me down the terrorists will have won
This. If your client doesn't want to move to aws just mention free micro tier for 1 year for new customers. I steer my web clients that way and nobody has ever complained.
If you mod me down the terrorists will have won
I'm thinking my next application will use Go for the API, and Ember.js for a fully decoupled client. The client needs to rely 100% on the public API not any special backend magic. Python & Ruby are both good solutions, and have lots of useful libraries; but both have some performance issues, and I'm getting less & less enamored of dynamic typing. Go gives me all the stuff I liked about Python, plus the typesafety and speed I was craving. Ember.. well, I dunno, it looks cool. Javascript is gross tho.
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.
I dont care what language(s) and toolkit(s) you use on your backend. But when you get ready to send code to my web browser, send HTML.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Friends don't let friends enable ecmascript.
The big change in modern web development is the shift to the clientside for dynamic html. JQuery is now so powerfull, and modern browser now so good at processing javascript, that stuff like applets, silverlight, flash, are undesirable cludge that you can live without. Also a lot of the serverside conditional html generation is also redundant. You should use just pretty much static html pages serverside, but change it dynamically on the clientside with JQuery.
So do you need the serverside code at all? of course you do, but it should be feeding the client with JSON (or similar) instead of html. For this 'feed client with info' serverside code the traditional web framewords still work fairly well even though their role has changed. there is nothing wrong with using java here if thats what you are comfortable with (i normally use either python wsgi or asp.net).
Usually the most sensible design for a modern website is a (sort of) MVC structure where JQuery is the controller, the 'views' are static html, and interfacing with the data model is the serverside framework.
Oh and DOJO is a perfectly workable alternative if you hate JQuery for some reason.
Check out https://vaadin.com/home, if you want your app to behave like a desktop app. It uses GWT for the front end, but it handles the session states and communication for you, so it feels familiar Java desktop apps. Take a look at what they have for components http://demo.vaadin.com/sampler If you are like me who hates web containers (JBoss, Tomcat). I have an example of embedded web server, where you just give it a port and run like a normal server Java program. http://code.google.com/a/eclipselabs.org/p/vaadin-push-example/
Something that does something should look like it doesn't do anything. The only way to discover this should be by right clicking or by putting the cursor over it and leaving it entirely motionless for at least two minutes. The information displayed should never be the same, in both content or form, via the two methods. It must be displayed as far away from the action initiating item as possible. Why not try a ticker tape along the bottom[1] for one and adding a watermark to an unrelated image for the other?
Likewise, things that do something should look like they don't do anything. As a corollary, every single pixel on the page should do something. Empty spaces and bodies of text are particularly important. Some people click on these to give the browser focus for scrolling, so it's vital that they do something extremely slow. Forcing a reload of the entire page is ideal. Failing that, preload the fullsize versions of any thumbnails present, just in case.
And you can never ever have too many flaming skulls and rotating logos.
[1] Clearly, if the action element is in the bottom half, the ticker tape should go at the top. Or the side (in which case it should be in Japanese[2]).
[2] Unless. of course, it's a Japanese web site. In that case use morse code.
Confucius say, "Find worm in apple - bad. Find half a worm - worse."
I would like to add that Javascript can be used to write back-end code also: http://nodejs.org/
I've got to throw in a plug for the Spiffy UI framework. It's a set of build utilities, security libraries, REST integration and a whole lot more on top of GWT. It scales up well for large teams and large projects and let's you build awesome web applications in a strongly typed environment. http://www.spiffyui.org/
If you already have a good grounding in Java, it would make sense to use another JVM language. I hear really great things about both Scala and Clojure, and there are web development frameworks for both.
I'd really recommend taking a look at Vaadin. It's a server-side Java and Ajax web application development framework that lets you forget most of the web stuff. The Ajax and HTML rendering are all hidden and it's closer to desktop application development than traditional web development. The client-side is based on GWT, so if you want to make new components, you can do it with Java. In addition to the built-in components, there are some 250+ add-ons, so you can most likely find what you are looking for from those.
Then please explain to me why JavaScript is amazing, because I certainly do not agree. In fact, I think it's apparent that Google does not agree with you this, either or they likely would not have invested so much in Dart.
"Because it is so easy to get started with it and actually get something working relatively quickly, do consider PHP, it has a quick learning curve and really does provides ample flexibility and power."
None of this is true, the speed of getting something up and running with PHP is a false economy, because you'll inevitably lose hours down the run chasing bugs that result from poor language and library design, and trying to get it to do things it's just not built to handle.
It doesn't provide anywhere near enough flexibility and power for anything that goes beyond the most basic of websites, for example, it has no real multi-threading support which is an absolute necessity for anything non-trivial and you have to use horrible flawed and hackish workarounds like curl. The end result is that you might as well have just used something like ASP.NET MVC, or Spring, or RoR in the first place, because even if they did take a bit longer to get hello world running, the fact they have far better IDEs and tools backing them, coupled with far better designed languages for writing them in, better libraries supporting them - and important, fundamentally important features like proper multi-threading support from the outset, and that they perform better to boot, means that any time saved getting your hello world app going at the start is long lost in the long run.
PHP is fine for the most trivial sites, where you don't need anything fancy, and aren't fussed about performance, security, maintainability and that sort of thing, but for anything else? It's just not the right choice at all.
"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 performance where it matters. It's really a pretty cool piece of technology.
I won't lie, I don't use PHP because I think the language is so pretty, but because PHP and MySQL are what runs just about everywhere. But it still cracks me up that RoR and Python of all things are considered an alternative in their current state, that's apples and oranges to me.
Ruby on Rails is way too much hand holding for my taste (why first spend time breaking out of that, when you can simply start coding instead). And yeah, Python. With the obligatory indendation for no reason *AT ALL*. Just great.
Let's face it: someone needs to find a way to let people code in straight C on shared webhosts in a safe way. I'm not good at it at all, but I always like the rawness of it... what I don't fucking want is *more* frameworks stacked on interpreters stacked on compilers! I'd rather code something crummy from bare scratch, that has fantastic new bugs and an original idea or two, and enjoy doing it, than just fill out the configuration file of framework X and call it a day.
When it comes to good, maintanable code, I submit that any language *I* work in would fail to deliver those results, while *others* are surely able to produce perfectly pretty things, yes, even in PHP. Because at the end of the day it's *your* object, variable and function names, and *your* wiring of them, and the end result is either a sparkling city with helpful signs and flying cars zipping by, or a murky puddle screaming in agony. Getting the former result takes a clear vision, maybe experience, maybe something else I'm lacking -- but it has fuck all to do with the language you're choosing. Maybe a little, but it's not the bigger part, even I as quite the noob know that.
Having said all that, I love everything I just read here: http://en.wikipedia.org/wiki/Ruby_(programming_language)
So I'm gonna learn Ruby now, but never touch Ruby on Rails, hah ^^
Stick with what you're good at! There's no reason to look at something like PHP if you are skilled in another, arguably more useful language.
Oracle shenanigans aside, Java is a good platform for web development. PHP may be quicker to put something up, but it has a bunch of rough edges to it (like multibyte character strings, really poor consistency for database drivers) that I wish I didn't have to deal with.
I went to eat some animal crackers and the box said, "Do not eat if seal is broken." I opened the box and sure enough..
There is no earthly reason any of this requires writing code. This isn't 1999, people.
Your mistake was in assuming that Eclipse - an IDE designed for competent developers - would cater to PHP - a language that no competent developer would ever use.
Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
PHP is not mostly based on Java, so you can add that to the list of things you don't understand.
... and make sure that you add the Slashdot mod system and its purpose to your list as well.
Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
ASP.Net is also nice if you don't want to go dynamic.
Reflection is alive and well in .NET. How is .NET unable to be dynamic?
So, parsing textfiles isn't really parsing textfiles, and Java source has special magic that only Eclipse can see (since every other multi-language IDE seems to have no problem with it)?
And your post wouldn't be completely hilarious if - apparently - the Eclipse website resorts to PHP! With urls similar to http://www.eclipse.org/projects/listofprojects.php, it's not like they don't know PHP exists.
Yes, because throwing up buzzwords is what programming is all about.
says it all.
Says it? http://www.eclipse.org/projects/listofprojects.php. Well, aparently even Eclipse resorts to PHP.
fail. i've done many many web projects in php (don't blame me!) in eclipse with no problem whatsoever. eclipse is a resource hungry beast, but it is manageable and sports features no other ide has.
You didn't specify if your projects were multi-million line PHP projects, or just some wordpress modules. Scale does matter. And manageable is not the same as usable. And resource hungry beast is, to put it simple, an euphemism. And I couldn't care less for extra features I don't use. The mentality of "one size fits all" is very Java-like, people that can't conceive any kind of application without OO concepts, but usually fail to understand basic programming concepts. Maybe that's not your case, but the comment someone made on your comment is the poster for it.
Spring has a bunch of good technologies, well worth using if you are in the Java world. IMO it is better at the back-end stuff than managing a Web front end (Spring MVC is pretty widely used but it's probably not the best MVC framework out there). Also, Spring by itself is not a RAD environment. Spring Roo does claim to be such a thing and might be worth a look.
When you basically make crap up as you go, the IDEs are always going to struggle.
This is hilarious! So I'm a poor programmer because your IDE can't keep up with my code? So, are you saying that if I try to create a project and add eg. the FreeBSD kernel source, my IDE won't grind into a halt? Just with PHP?
And NetBeans, and every other IDE that works well with big PHP projects is wrong, because Eclipse can't be a big pile of poo?
I don't believe in RAD. By the time anyone has developed a toolkit that can easily do something, it's not cool enough to do it anymore :)
RAD frameworks also tend to get bloated trying to do everything for everybody in my experience. At least when it comes to CRUD applications. I find myself more productive and have an easier time developing a site like that to do what I want by just using a good persistance (DAO, JDO, Hibernate, etc) framework or methodology that makes it easy to communicate with the DB.
Other stuff that i find useful are tools that build the classes you need to interact with various webservices.
1 design the forms so that somebody with a Small Screen can still use them (don't do cute things with iframes so that the scroll bar gets cut off/disabled)
2 test your ap in low bandwidth setups (does your ap go wonky if the connection snaps mid session??)
3 be as simple as possible in your interface (small adbar on top and 2 rails down the sides are a MAX)
4 most folks can't watch a 3 ring circus so please don't make one
5 make your login/signup thing part of the main page not some sort of popup
6 KISS is not just something you do to your SO its a very good design principle
Any person using FTFY or editing my postings agrees to a US$50.00 charge
"It's that everything is different for no apparent reason and there's little organization to the whole thing."
This is exactly the reason I call PHP "a collection of utility functions" rather than a language. Very often -- routinely, even -- there will be two functions that do very similar things but that take different parameters or takes the parameters in a different order, or both, and return results differently.
And don't even get me started on PHP's "object oriented" parts.
This may all be the result of how PHP evolved over time, but the results are as you say: an incoherent jumble of "stuff".
"Let's face it: someone needs to find a way to let people code in straight C on shared webhosts in a safe way."
I would never do that myself, or subject other people to it, either.
Regardless, the fact is that Rails is an "opinionated" framework. They do not deny it at all. And also admittedly, there is a learning curve to using it comfortably. But one of the benefits of that hand-holding is "convention over configuration", which is an awesome idea that has since been borrowed by other frameworks: by default, you already know where everything you need is, and where new things should go. The result is an application that any other decent Rails user can sit down in front of and figure out in a short time.
Contrast that to PHP, where every application is structured according to the programmer's whim, and sometimes trying to figure out somebody else's idea of "organization" can be a long-term brain twister.
But having said that: you don't have to do everything their way. Once you know the framework, you can bypass as much of the "hand-holding" as you want, and do things your own way.
It's a good, flexible framework that uses a good language. Not perfect, but good. I would not even attempt to use PHP to do many of the things I do almost every day in Rails. The very thought is a nightmare. Yes, PHP is capable of doing those things. At great cost in time and sanity.
Web development is a whole new ballgame, keep that in mind.
Since you are a non-webdev guy I strongly suggest you go with the most popular webdev toolkits in existance. Zend, Symfony or Flow3 for the webframework (each in PHP, of course) and jQuery or ExtJS for Ajax client stuff.
With Zend + jQuery and jQuery UI you're on the super safe side, it's safe to say that they are todays most widespread combination. OO PHP won't be any problem for you, since you're used to Java. PHP is going to be very easy for you ... in a way modern PHP and Java are quite simular. Keep in mind though, that PHP has dynamic typing and tons of web-specific built in functions which let you things with one function call which would take 30 lines in Java.
Symfony and Flow3 are also very neat Frameworks, you should look into those. Which you choose isn't that important, PHP is way ahead in delivering in this area compared to Java - you'll feel like a whole new world.
One more thing: What you want to do is a non-trivial web application that takes a lot of work, no matter the technology. You definitely should start out with an architecture model and some abstracts like usecases that leave the technology decisions for later. Maybe you'll feel like doing the whole thing in Java/Wicket and jQuery or something along the way. As far as I know, Wicket is the Java toolkit that comes closest to all the Python, PHP and Ruby stuff out there and has the least XML situp crap to go with it.
My 2 cents.
We suffer more in our imagination than in reality. - Seneca
Maybe it's just my personal opinion, but I can't stand using AWS. Relatively speaking, it's a pain in the ass (and slow) to maintain compared to updating my Rails sites using Git. And if you want it to be efficient for an international site, you pretty much have to use S3 for your static content and then CloudFront, which costs extra and adds another level of Pain In The Ass.
And I almost forgot to mention: I got a call last year from someone wanting me to save their Rails site because they had gotten an email from Amazon saying that the server it was on was suffering from a hardware failure, and they would be taking it down in 3 days so they should grab everything off of it while they can.
Unfortunately, they received the email a day after those 3 days had already expired. Other than an old backup, their site was a total loss, and the database (also hosted by Amazon) was gone. So all their data from the time of the backup (which had been too long, admittedly) was lost.
And without a service contract, Amazon was exactly zero help. Yes, it was their server, and yes, the hardware problem was their responsibility, but no, they would not lift a single finger to assist without a service contract.
Also, if you recall, just about all of AWS went down for a period last year. As did Microsoft's cloud service, and Yahoo, and in fact just about all the "big solutions" that I can recall. Every single one of them had far more downtime last year than any of my sites.
Checkout Perl or Python ; a good book is "Perl 5 by example" and start from there ..
--- I am known for the ones who want to find me on the net. Is that a privacy risk or a privilege? One might wonder..
"And NetBeans, and every other IDE that works well with big PHP projects is wrong, because Eclipse can't be a big pile of poo?"
I've been working on a large PHP project in NetBeans for about 18 months now, and by works well I'm assuming you mean "Is only a tiny bit better than just using a text editor with syntax highlighting like Notepad++" ?
Honestly, if PHP and NetBeans is working well then I think it shows the low standards PHP developers have and expect. Compared to something like XCode, JDeveloper, and Visual Studio it's still piss poor. It's not NetBeans fault though, it's simply doing the best it can with a bad language.
If it's going to be a true app providing more functionality than content, I would strongly recommend against the old school server-side html generation approach. Instead, use a front-end webserver to serve static files and bootstrap a Javascript app. The Javascript app can then fetch data from the server using RESTful webservices and update the UI. I have extensive experience building enterprise web apps under my belt and have tried many different strategies. This is by far the best approach, as it is quicker to develop, easier to test, easier to consume your business logic with diverse clients (i.e mobile devices, desktop, Flash), and easier to expose a public api to your customers. Depending on your needs ExtJs, Dojo, and Backbone.js are all capable front-end frameworks. ExtJS and Dojo are nice, because they are monolithic libraries that already have most of what you need, including MVC modularization, UI components, and a production deployment path. Backbone.js is nice because it gives you the bare bones tools to make an app without anything you don't need, but you will have to either add many things yourself or pull in multiple libraries, which can become a maintenance and licensing problem later on down the road. JQuery is also functional, but a large app will quickly turn to spaghetti code if you do not also include some type of MVC framework for modularizing your code. If you use the Javascript front-end approach, there will be some tricky things you'll need to think about, such as how the back button should work (and in your specific example: timezones). It's extremely important to find quality Javascript devs, who have already experienced similar problems and know how to deal with them. Finding good Javascript devs in the current market is much more challenging than finding decent back-end devs, regardless of what back-end technology you choose. I prefer Python for the backend with Ruby as a close second, but IMO it doesn't really matter what stack you pick for the backend. I would try to stay away from PHP, just because of technical issues, and the fact that it annoys me as a dev. Python, Ruby, Java, Groovy, .Net, and node.js are all mature, capable technologies that you will be able to find decent devs to hack on. The reality is that besides the addition of NoSQL databases and asynchronous programming models used for 'real-time' features, backend MVC development frameworks haven't changed all that much in the past 5-10 years. They all work pretty much the same way: you'll have url routers, controller classes, html templates, a model layer, possibly an ORM, and a DB api. Whichever backend you choose, one of the most important things to think about is how you want to host it. If you're going to be using AWS, Heroku, Rackspace, vps, etc,. Stacks have distinct advantages and disadvantages on certain cloud providers.
For databases I would choose Postgresql for a relational database. Well supported, great documentation, awesome feature set, open source, and easy to find devs for. For NoSQL databases, I really like MongoDB. Your project sounds like it would work well with either type of database, but remember that you don't have to be stuck with just one type of database. There are plenty of projects that use both relational and NoSQL databases for different services under the same roof.
Second time I've seen that link in this same article. I am absolutely sick of seeing it - there's a *few* errors in it. For example:
The latter doesn't need a fix because it always worked. Honestly, how hard is it to test that foo()->method() works?
Strict-equals on objects compares the references; but regular equals compares the contents of the objects. Two objects compare equal if the contain exactly the same fields and values. Seems pretty reasonable to me.
This is a good thing; JavaScript gets this wrong.
Variables that don't exist issue a notice. You can deal with that just like any other error.
Actually there is also the $GLOBALS array for this. I'll agree that's not much a solution. Globals should just not be used; if you want to use static class variables, it's a much better choice with a sane syntax.
I'm not sure if I understand this but all objects are passed-by-reference in PHP (since 5) and PHP references act appropriately when used as function parameters, etc.
An attempt to use the reference will result in a notice but isset() and empty() operate it on it correctly.
You can declare constants in classes and namespaces with the const keyword.
You can cast scalars to single element arrays and objects to arrays with the same structure. Both are actually very useful.
PHP is interpreted -- namespaces and autoloaders are PHP's module system.
This is a good thing.
Empty is equivalent to the not operator but will also work on undefined variables -- that's why it requires a variable.
Useful inside of templates where matching { } is much more difficult.
Sometimes you don't care if a function succeeds; like with the unlink() function which will raise an error if the file you're trying to delete doesn't exist.
I guess you don't realize how Open Source works. You did know that the person/people who did the website isn't/aren't the same person/people that implement the PHP support for the IDE, right? If the PHP support is sub par, then that is a strong indication that the PHP programmers involved in the development of said support are sub par. Naturally, this is what one would expect since any competent developer is going to eschew PHP in the first place.
Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
I play minecraft. on linux.
I don't therefore I'm not.
It seems to me that what the OP really should use is a mature framework e.g. Drupal rather than rolling your own regardless of language choice.
BUT since this thread has evolved into a language choice I'm going to respond to that. I'm also going to come right out and say that this post will be very unpopular on Slashdot. [Hopefully I won't get sunk by too many mods saying -1 "opposite of my fanaticism." ] ColdFusion has a pretty narrow applicability, but it's ideal for the OP.
Con: ColdFusion per se is not free in source or beer. (allthough there are ports) BUT shared hosting is only infinitesimally more expensive, so this is an issue only if you'relocked into a certain host or you are goign to have aan armada of servers. [The local dev version IS free.]
Con: ColdFusion is not very popular. There's still a LOT more usage than most people seem to perceive, but it's obviously not up there with e.g. PHP. [Commercially ColdFusion missed its window. In ~1998 database driven web applications were relatively novel and it was awesome. In 2001 it was comparatively unstable at higher traffic values. In 2002 they threw out the underlying server product and now it's an interpreter plugin that runs on any J2EE server you want it to.]
Pro: CF is a mature, modern flexible, powerful, rapid development toolchain for making websites. Especially as a novice in web apps it's going to support you. It'll let you worry about your app and not the minutia and has automatic capabilities for all sorts of things. It does the right thing by default but lets you override if it you need to. [Aside: These advantages are rather similar to what's advertised for RoR which IS free... If anyone can tell me some awesome thing RoR does for a website that CF doesn't beyond the two "cons" I've listed above I'd really like to know -- so far no one has been able to give me a good one. I'm excluding outdated concerns e.g. that the 1999 version of CF wasn't OOP.]
Pro: CFML is a pretty ideal language for generating HTML because as a markup language the flow of your HTML remains obvious and readable. [PHP eventually adopted the ability to use a similar paradigm.]
I've heard some people say that CF is what Java Server Pages should've been.
Pro: CF IS Java. (server) You're running on a Java server and the things you already know about running that remain true.
Pro: CF IS Java. (language) Even moreso, you can literally inline Java code into CF code (much like old school ASM into C). In my time writing CF I've done this literally twice:
a. to use Java's sleep() [Note: I do not recommend using "sleep" when generating a webpage, but it was an exceptional circumstance.]
b. to use Java's image manipulation libraries from CF templates.
I'm not saying CF is ideal for all circumstances. Merely being non-free rules it out of a lot! But it really is -- at least in my opinion -- "how to build a web app on a Java server" and that has a lot of suitability as a platform for the OP.
Looking for freelance Actionscript (Flash/Flex) or ColdFusion work and/or freelance developers. Email me, put Slashdot
I guess you don't realize how Open Source works.
So, I guess I don't know. Is that relevant? So PHP is fine if it's free and/or opensource? Because I've read here a ton of comments of how Java is "superior" in every way, but the Eclipse Foundation website has parts made in PHP? There is no doubt that Eclipse is heavily Java-oriented, so does that mean that they don't even eat their own dogfood?
Naturally, this is what one would expect since any competent developer is going to eschew PHP in the first place.
Oh, you mean a "Java" programmer? We have different ideas of competence. Yes, PHP as a programming language is a big pile of poo, but at least isn't encapsulated poo. People I'd consider "good programmers" usually barf at the idea of both Java and PHP. Programming isn't about APIs and ABIs and what language abstracts better what you are trying to think - programming is about implementing algorithms in restrained environments using instructions that may or may not be machine-oriented. I'd bet you 50% of the Java programmers you know cannot implement simple algorithms they use everyday in a pseudo-language (heaps, garbage collecting, lists, tuples, etc), or explain easily how the OO inheritance works internally. Go ahead, try it and then tell me if I'm wrong.
I actually use NuShpere's PHPEdit (give it a try if you use Windows), but if you think NetBeans is bad, try Eclipse and then tell me about it :D
The latest versions of VS are more close to Eclipse than to NetBeans. That's one of the motives I use SharpDevelop for C# development, instead of VS 2011.
Yet PHP is chosen by the largest web applications time and time over again, it simply scales, it's easy to utilize due to brilliant documentation and community.
And mapping a URI to a file is not necessary with PHP. You've probably never used PHP for anything actually good.
Ruby on web applications is basicly a rigid framework (RoR). Try to make Python to scale as efficiently.
PHP is specifically designed, and built for web applications. You can't say the same for any of the other choices.
I've actually built some large, extremely high performance, very scaleable projects on PHP, and almost always the bottleneck turns out to be on the database side due to sheer volume of data and features customers have insisted upon requiring more database servers than frontend.
Pulsed Media Seedboxes
PHP with some actual software architecture engineering can do some pretty amazing things, in a nicely efficient manner.
Altho, 98% of PHP "programmers" shouldn't even try to do anything serious without a rigid framework forcing some kind of inefficient, bloated architecture, but forcing the "programmer" to even a partially sane standards and architecture. The last 2% can wrap their own and forget the inefficiency and bloat, and spend less time doing that from scratch than learning all the kinks of the bloated inefficient rigid framework.
Pulsed Media Seedboxes
Don't forget. If you're a Java EE guy, you probably know all, you need to. Get the backend running, check with simple text or raw HTML output and then polish the web appearance. I don't know which of the varios CSS/HTML frameworks will integrate best with JSP, but look for one that lets you easily create calendar fields and forms with pulldowns. I remember a useful date selector being a lot more complicated than I'd expected.
Oh, the beautiful gloss of greality!
* implement an MVC pattern but use a servlet, really, don't fall into the struts / faces / sitemesh / tiles / spring ui / crap, it will backfire at you, use a simple templating engine (i.e. freemarker) .war deployable, divide the app by functionality, i.e. signing, validation etc on one .war web app, browsing / searching cacheable content at another, backend crud app at another .war, etc, use shared libraries to keep your entities model and .war consumer apps in sync
* don't use spring unless you plan to make your code available to everyone and plan to have multiple implementations of the integration tier (data tier), otherwise spring is useless spaghetti XML configuration and if you aren't careful enough you'll be coupling tiers anyway without noticing it, spring is not a silver bullet
* if you have to use sql use jdbc and/or persist your objects without mapping collections (don't use hibernate / jpa or use it carefully without mapping collections), just don't use SQL for everything, think ahead but not too far ahead. look for a nosql solution if you can.
* don't store info at the http session, if you absolutely have to make sure it is serializable
* make http content cacheable always, if you have a crud backend or a dynamic page based on user data use a separated folder for it, it is easier to manage an http reverse proxy to cache that way.
* use a cdn for static content (images, scripts, use versioning for scripts so you can have some level of control of what's in the user's browser cache)
* use sticky sessions just to optimize cache but be ready to failover/load balance, make your services stateless
* use a SOA architecture, doesn't matter if you are going to implement it using web services (i.e. soap, rest, other) or a home made socket/bin protocol make sure tiers are decoupled and that they can be reused, you'll probably want to expose a public API at some point
* don't build everything on a single
* log traffic at the balancer(s)
have fun!
Railo is great. After spending the last few months working on a web-based application with a PHP front end and a Java backend, I really miss working with Railo (or ColdFusion).
Ideally, I'd write the front-end code in CFML, and the business logic with a combination of CFML (with the excellent and unubtrusive FW/1 framework) and Java for the heavy lifting where appropriate. For extra points, package it all up and deploy it on Railo/Tomcat/Amazon Elastic Beanstalk.
www.clarke.ca
... and the libraries which support it, given your requirements: http://en.wikipedia.org/wiki/CalDAV
Aside from rendering things properly, do NOT rely on hover events for functionality ... to bring up menus, for example. Otherwise, the same things as always ... don't hardcode screen resolutions, don't rely on javascript for form validation, etc.
it's good to learn a language with a low barrier to entry. but what that means is you can get a jump on the advanced stuff like security and design patterns -- don't neglect this. too many php coders shame me because they never bothered to learn any best practices. php is horrible only in the hands of a horrible coder.
insensitive clod overlords obligatory xkcd car analogy russian reversals whoosh pedant fanbois ftfy in 3...2...1..PROFIT
No. Your not getting the point. In the Open Source paradigm solutions get implemented by people who are "scratching an itch", so the PHP support is going to be implemented by PHP programmers. Therefore, the fact that the PHP support is of poor quality is a direct indication that the PHP programmers are of poor quality.
Indeed, we do ;-)
No. Programming is about recognizing that both are important, but consistency and simplicity are king.
I believe you are right. You would bet me that ;-) Of course, you haven't followed your own point along its own logical path, which leads to the point that far more than 50% of PHP programmers could not do so.
Finally, you also accidentally make a point when you keep using the term programmer rather than software engineer. Software Engineers don't design PHP into their systems unless they are incompetent. Web Programmers often do (thus you see it on websites) but Software Engieneers doing Web Design wouldn't touch it with a 10 foot pole.
Language Design is done by Engineers, not programmers. PHP is a horribly designed language. In fact, I'm being gratuitous when I use the term design at all in that context.
Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
No. Your not getting the point. In the Open Source paradigm solutions get implemented by people who are "scratching an itch", so the PHP support is going to be implemented by PHP programmers. Therefore, the fact that the PHP support is of poor quality is a direct indication that the PHP programmers are of poor quality.
Go see your original message. Fact is that Eclipse *does* use PHP, and I'm not talking about the mentioned PHP support. But, then again, while I'm not familiarized with Eclipse internals, I really doubt that the parsing of sourcefiles is made by an external component - the common approach is to implement a generic parser with a set of pluggable dictionaries, so it doesn't really matter if its parsing Java or PHP.
Of course, you haven't followed your own point along its own logical path, which leads to the point that far more than 50% of PHP programmers could not do so.
I see a difference between someone who can write code and a "programmer". I'd expect a good PHP programmer to be as good as a good Java programmer, and equally rare :)
Finally, you also accidentally make a point when you keep using the term programmer rather than software engineer.
It's not innocent. I wouldn't go that far as associating PHP with incompetent engineering, there are cases where it is a good fit - or a requirement. And software engineers don't do "web design". But I find the expression "software engineer" rather silly, as often is used instead of "application lifecycle manager". Very few software products are actually engineered (as in planned in detail in every aspect from start to finish before conception).
Language Design is done by Engineers, not programmers.
More often than not, is done by mathematicians, physicists and the occasional CS major, not engineers.
PHP is a horribly designed language. In fact, I'm being gratuitous when I use the term design at all in that context.
I don't think you'll ever find a PHP programmer/code monkey that disagrees with that. A bit like FTP is a horribly designed protocol, etc. - it exists, many people use it, it gets work done.
This is the same Dart that compiles down to JavaScript, yes? If anything they've invested so heavily into Dart because it rounds off some of those nasty little corners and edge cases folk are always bitching about W.R.T. JavaScript. So Google could re-write Gmail entirely in Dart and it would end up being compiled into JavaScript, taking it's fair place amongst the rest of "web 2.0." Does that make Google a "non-JavaScript shop"? Possibly, but in the end it's JavaScript, all the way down.
The lay of the land at this time is JavaScript as the WWW/HTML scripting language, no matter how you want to dress it up. Is is perfect? Nope. Are there initiatives out there to work around the perceived issues with the language? Yep. So until the Python Gods smile upon web browsers everywhere and release us from our JavaScript bondage, we'll just keep working around the problems laid upon us by our forebears. As for JavaScript... it ain't going anywhere fast.
Celebrity worship is a poor substitute for Deity worship and costs more to boot.