Java isn't slow

First of all... Java is not slow. There's a bad misconception in the world that Java is slow because of the previous experiences with Java Applets and prior versions of the JRE. Java, now, is rather speedy, although, I still wouldn't recommend using the Java applets in their current state. Java, in my opinion, is more for the server side platform than for client side code, although there are several really nice Java applications such as Azureus.

As for the code, at most you may get an IndexOutOfBoundsException; and unless you rolled your own application server (I'm assuming this code is in a Java Servlet), the most that you would get is a 500 error with a stack trace; not a server crash and Denial Of Service.

This is also just extremely bad code. If they wanted to find out the request "method", the would could use several ways:

// if you only have access to the HttpServletRequest object
if ("GET".equals(request.getMethod())) {
} else if ("HEAD".equals(request.getMethod()) {
}

If you're inside your own servlet, just implement the doGet() and doHead() methods that the abstract HttpServlet superclass provides.

As a side note, at least this this movie shows code, unlike the movie "Hackers". "Hackers" shows a virus that looks like pacman eating the contents on the screen.

Another favorite is Jurassic park, when the girl was trying to turn the power grid back on and exclaimed "This is a Unix system ... I know this!" even though it looked like a 3D flight simulator.

Reply

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
plus zero equals three
Solve this math question and enter the solution with digits. E.g. for "two plus four = ?" enter "6".

Powered by Drupal - Modified by Danger4k