views:

434

answers:

11

I've been an java programmer forever. Now I want to go web.

What mental leaps should I be expecting?

+21  A: 

HTTP is stateless. Get used to it.

tvanfosson
I couldn't have put it any more concisely
Neil Aitken
Put another way, your variables are not persistent [unless you make them that way with sessions].
Mark Tomlin
+17  A: 

Not only is HTTP Stateless, UI Design is far more difficult.

Users aren't all on the same browser, and each browser has its own rendering quarks. Familiarize yourself with them and you'll get a leg up.

Justin Niessner
Quarks: http://en.wikipedia.org/wiki/Quark :P
notJim
I don't think we have browsers working on quantum computers yet.
Eli Grey
I don't know. Any time I test in IE6, I feel like I'm going back in time...
Justin Niessner
+4  A: 

There are subtle yet excruciatingly painful differences in the way the major browsers handle edge cases in javascript and CSS.

theycallmemorty
Luckily a lot of the JS edge cases can be mitigated with a framework these days. CSS will always be painful though
Neil Aitken
+1  A: 

One of the hurdles you'll have to overcome is the request/response stream of HTTP. It's not difficult, you just have to learn to take it into account.

Blacktiger
+5  A: 

It's a different paradigm.
You need to spend lots of time validating your input.
Don't ever trust your user.

HTTP is Stateless.

If you are going to do front-end web development then you need to make sure your interface works fine on all browsers.

ikkebr
"You need to spend lots of time validating your input. Don't ever trust your user."These are not specific to web development.
theycallmemorty
indeed. that should have been "never trust JavaScript to validate your input"
ikkebr
A: 

If you're switching to PHP:

- PHP doesn't have and know anything about states. 
- PHP function arguments are not consistent. Some functions do it the same way and in the same order, others completely fuck up. This is getting better.
- The language is sometimes confusing. E.g. instanceof accepts a Class name or a Variable.
  This is valid:

      $var = 'Field';
      if($object instanceof $var)
      { 

  This is valid:

      if($object instanceof Field)
      { 

  This is invalid:

      if($object instanceof 'Field')
      { 


- Most of the documentation is quite good though.
TheGrandWazoo
I think you indented that a little too much.
Eli Grey
A: 

one of the bigger challenges as mentioned is UI design, and getting your designs to render properly with the whole gamut of browsers and their versions. for example the IE6 box model vs. IE7/8.

the point mentioned about not trusting your user shouldn't be taken lightly as well. on the web, if it can be hacked, it's only a matter of time until it is. it is always important to validate your user input server side (even if you've validated it client-side as this can be bypassed by a malicious user), and make sure you never pass a variable from the query string into the database without ensuring that it's safe and not an injection attempt.

also consider the scalability of your applications. on the desktop, unless you're writing a server or client/server app, you've got one user at any given time. when you're working on the web you could be dealing with multiple (tens, hundreds, even thousands of) concurrent users. ensuring that you're using memory wisely and that your DB queries are efficient becomes all the more critical.

JustinW
A: 

Security; cross site scripting, HttpOnly cookies, etc. There's a lot there.

Web frameworks; take a look at Spring, for example. There's a lot there.

ORM tools; Hibernate, for example. There's a lot there.

HTML, JavaScript, AJAX, CSS; for none of this being too complex, there's an awful lot there. Take a look at JQuery. JSP, custom JSP tags, JSTL.

If you haven't run into it already, Apache Commons saves you a lot of code.

Dean J
+1  A: 

There are few things :

You need to

familiarize yourself with javascript.

keep different browser in mind if you are dealing with websites, with in house web application mostly you restrict your user to one browser but its good to have support to all browsers.

You are moving from java to web app .. ASP.NET is a good choice.

Understanding of CSS is necessary.

Jquery .. first thing you need to get, you will love it

Session .. cookies very important ... because http is stateless. you need to store information in sessions.

connection strings ...

There are a lot more hope to write some more latter

Fawad Niazi
ASP.NET? why not stick with the java+java script? wouldn't that be easier for me coming from java?and yea, I've been spending a week trying to avoid CSS. I guess I must start looking at it soon. thanks!
michelle
just checked out JQuery! i do love it!
michelle
Yeah you can stick to java + javascript .. I myself stared with java and then web dev with jsp ... what i personally find is that you need to do a lot of plumbing code for a java web app to run it will take a bit of your time to figure out wats going on.. plus you can use C# which is similar to java
Fawad Niazi
Main thing i find about microsoft it there documentation MSDN ... it helps a lot .. i might say its an online teacher ... :)
Fawad Niazi
A: 

Get comfortable with the end-to-end stack, without frameworks, before you start getting into some of the big frameworks like JSF, Rails, Django, etc. This way you'll have a better fundamental understanding of how things work in case you run into snags.

If you plan on using a different language than Java for back-end stuff, learn the new language first before you learn any web-specific things. There are lots of cool new things to get used to with the various dynamic langs (Ruby's blocks, for example).

JasonWyatt
+1  A: 

You'd do great as a GWT programmer, I would assume. Google Web Toolkit. Have a look at it. Thanks.

Satya
iteresting you mention it. I also thought the same so I've started using it. I've been batteling with it for two weeks now. I've got a lot to learn and there are not enough examples on line and definatly not enough users since I can't get quick answers in forums.
michelle
would be pleased to help, in case you need it.. Its gaining lots of popularity and wouldn't be long before you'll get ample support.
Satya