Java the SUV of programming tools

Discussion in 'OT Technology' started by Astro, Sep 23, 2003.

  1. Astro

    Astro Code Monkey

    Joined:
    Mar 18, 2000
    Messages:
    2,047
    Likes Received:
    0
    Location:
    Cleveland Ohio
    Philip Greenspun's weblog at Harvard was featured on Slashdot. Its an interesting look at his Software Engineering for Internet Applications class and how 1/3rd are developing with C#/ASP.NET, 1/3rd with PHP, and the other 1/3rd with JSP/Java. He is basing his comment on the fact his class is building some tough apps and only the Java folks are getting stuck.

    The SUV comment comes from the fact the SUV is suppossed to be industrial strength and can go anywhere. Java is thought of this as well. But the SUV usually ends up going to the 7-11 down the street and is never really used to its full potential. Check out his weblog:

    http://blogs.law.harvard.edu/philg/2003/09/20#a1762

    Then check out the comments folks have left - in particular, watch for Philip's comments.

    The project in question is based off this book Philip has written (along with a few others):

    http://philip.greenspun.com/internet-application-workbook/

    Before going off in this thread on PHP, C#, .NET, or Java is better than the other, take a look at the comments. Sit and think for a minute or two, and then post your thoughts here.

    What I find interesting is this has been my gut feeling when I've been playing with Java. It works. It gets the job done and pays the bills, but it doesn't feel graceful and I feel I have to expend more energy to build something. And for what? So I can build super-sized apps? (which I'm not) So other developers can support it later? (why not properly write the app the first time?) Things to ponder...
     
  2. CompiledMonkey

    CompiledMonkey New Member

    Joined:
    Oct 26, 2001
    Messages:
    8,528
    Likes Received:
    0
    Location:
    Richmond, VA
    I think it comes back to the fact that there is a correct tool for every job. If his students sat down and learned to use JSP/Servlets and even Struts the correct way, they would have a very solid application which is maintainable, scales, and follows the MVC architecture. I'm not saying it would be easier or even better than using another language/technology, but it would get the job done.

    This "power" he talks about has nothing to do with the Java programming language in itself. The power of server side Java comes from the application server. It's the application server that allows for fail over and clustering. That's something most people don't realize until they actually work on a large scale server side Java application.

    But as I said before, if his students are having problems it's probably because they don't know how to use the tools correctly.
     
  3. Astro

    Astro Code Monkey

    Joined:
    Mar 18, 2000
    Messages:
    2,047
    Likes Received:
    0
    Location:
    Cleveland Ohio
    You must have missed the comment that stated they have had 1 semester of Java before his class, and have already produced 10k lines of Java code. The Java environment they develop on is tested before the students go into the labs. And within the first week the students have a sort of "shake down" assignment which makes sure they can use the tools they will need for this final project.

    Basically, he's saying they have the tools. In fact, he's also saying the C#/.NET and PHP students HAVE NOT had formal training and are surviving and doing well in the class.
     
  4. D1G1T4L

    D1G1T4L Active Member

    Joined:
    May 4, 2001
    Messages:
    16,489
    Likes Received:
    0
    Location:
    Bay Area
    i dont know, sounds like a java hater to me

    why would his students not have any formal training for C# and PHP yet they do well and his other students have java training and do poorly? that's kind of weird if you ask me
     
  5. CompiledMonkey

    CompiledMonkey New Member

    Joined:
    Oct 26, 2001
    Messages:
    8,528
    Likes Received:
    0
    Location:
    Richmond, VA
    I read the entire article and the comments posted. It's great they produced 10k lines of Java code, but he didn't say it was using the J2EE APIs. For all we know, and which is hinted in his comments, they're just using JSPs (no Servlets nor programming model like Struts). That is sad regardless of the University, but esp MIT. We also aren't told what sort of environment they're using. I'm not sure if you've used any of the more popular application servers such as WebLogic, but it's nothing as simple as Apache. That alone is a huge learning curve.

    ASP.NET and PHP are just easier to work with, I agree. ASP.NET has a much tighter integration of tools. The .NET framework coupled with VS.NET can dumb down anything relating to software engineering. PHP has amazing support for MySQL and it's much easier to do complex things. As stated in the comments, the database interaction is easily the most important part of this project. Which is something both of these languages/technologies excel at.

    It's no surprise to me people are having an easier time using PHP and ASP.NET. I would think it's obvious the students are going to struggle more with Java/J2EE, it's just plain harder to use.
     
  6. aphoric

    aphoric Even if god did exist, it would be necessary to ab

    Joined:
    Aug 29, 2003
    Messages:
    918
    Likes Received:
    0
    Location:
    Leaving Afghanistan
    that is why you don't learn Java first, you start with a core OOP language, like C++, or even C. You cannot go straight into Java and have the insight and software engineering skills that it takes to build a robust, well-performing app. I am not sure you can really compare PHP and the like with Java, yes they can do some of the same things, but they are not based in the same realm.
     
  7. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,923
    Likes Received:
    11
    Location:
    Los Angeles
    Yeeep. I say the learning curve would be C, C++, then Java, and PHP isn't a programming language. Even if you have a Basic knoweldge of C, you can become a decent PHP developer. It's not hard at all.
     
  8. Astro

    Astro Code Monkey

    Joined:
    Mar 18, 2000
    Messages:
    2,047
    Likes Received:
    0
    Location:
    Cleveland Ohio
    I started out with formal training in C for the first semester (with a mix of C++ commands like cout/cin). Then the next semester we were down in it with OOP.

    As for the comparisons, yes they are very very much in the same realm. Is web development goal and finished product not the same? Sure, the under-the-hood mechanics of how one uses PHP, Java, or ASP to get the job done is different, but will the customer using your shopping cart really care if you used PHP, ASP, or Java? Are they clever enough to tell the difference?
     
  9. D1G1T4L

    D1G1T4L Active Member

    Joined:
    May 4, 2001
    Messages:
    16,489
    Likes Received:
    0
    Location:
    Bay Area

    :werd:
     
  10. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,923
    Likes Received:
    11
    Location:
    Los Angeles
    Hehe, good point. I don't think they would care. I wouldn't, as long as it works, right? :p Chances are they probably wouldn't be able to tell the difference either.
     
  11. Astro

    Astro Code Monkey

    Joined:
    Mar 18, 2000
    Messages:
    2,047
    Likes Received:
    0
    Location:
    Cleveland Ohio
    I'm being technical. You are correct. Its not a programming language but a scripting language. Very much like what ASP is to an IIS server, but more portable and server friendly.
     
  12. Astro

    Astro Code Monkey

    Joined:
    Mar 18, 2000
    Messages:
    2,047
    Likes Received:
    0
    Location:
    Cleveland Ohio
    From the reading, it appears the project's goal is to use the tool of the student's choice. So 1/3rd of the students felt some flavor of Java was the way to go. Sure, I understand the Java environment can play a roll with how difficult the coding will be, but at the same time, the prof didn't tell them they HAD to do it in Java. My interpretation was it was much like picking your writing utensil. You could pick a pencil, pen, crayon, or chalk. As long as you got the job done, it didn't matter what you use (as you've probably learned, pen doesn't work well for math homework, but profs won't stop you from using them). This is an over simplified example. The idea here is it doesn't matter the flavor or environment of the Java technology used. Its understood the student picked whatever they were comfortable with and ran with it.
     
  13. CompiledMonkey

    CompiledMonkey New Member

    Joined:
    Oct 26, 2001
    Messages:
    8,528
    Likes Received:
    0
    Location:
    Richmond, VA
    You're exactly right Astro. My point is that the students picked something they aren't ready for.
     
  14. Astro

    Astro Code Monkey

    Joined:
    Mar 18, 2000
    Messages:
    2,047
    Likes Received:
    0
    Location:
    Cleveland Ohio
    Blanketly saying they aren't ready for Java seems silly (not sure if that was what you were going after). I was suggesting they may not have been ready for a particular flavor of Java. Its kind of a silly point to argue. I think the bigger concern is how much Java do you need. Apparently 10k lines of Java code is not enough.

    Is Java a good fit for developing web tools? It works and its industrial strength, but do you need all that power? Its an interesting arguement...
     
  15. crotchfruit

    crotchfruit Guest

    i didn't read the article, so please don't kill me if this is off topic.

    i don't know if this is true now, but in all the CS courses i took, a majority of the people weren't there because they enjoyed it, but because CS was the "cool money maker."

    so you basically have a bunch of people who are going to try hard to get good grades, but that don't necessarily have the innate mental ability to really *program*.

    you know what i'm talking about.. when you're writing your projects, you just have this weird awareness of everything that you're doing, like all the pieces fit together. i think some people just have a better ability to program that others.

    so when you get into huge, scaling multi-server, J2EE web service yadda yadda, you really have to *want to understand* what you're doing. it's not enough to read a text book - unless the pieces actually click in your head, you're never going to really get it.

    so basically, out of all the people who may try to learn this, only a minority are really going to understand it. the others will just go through the motions trying to get their good grades so they can get their 100K jobs, but struggling through the class the whole time.
     
  16. CompiledMonkey

    CompiledMonkey New Member

    Joined:
    Oct 26, 2001
    Messages:
    8,528
    Likes Received:
    0
    Location:
    Richmond, VA
    Like I said before, there is a tool for every job. Do you need all of that power? It depends on the project, but for their project, probably not.

    I'm saying they aren't ready for the type of Java they've taken on. J2EE and the basic Java APIs are very different beasts. When you add the complexity of a powerful application server like WebLogic, you're just asking for problems.
     
  17. D1G1T4L

    D1G1T4L Active Member

    Joined:
    May 4, 2001
    Messages:
    16,489
    Likes Received:
    0
    Location:
    Bay Area
    the real question is do you really need so much complexity in java if you can just use php? or is php not good enough for big projects that J2EE can handle?
     
  18. CompiledMonkey

    CompiledMonkey New Member

    Joined:
    Oct 26, 2001
    Messages:
    8,528
    Likes Received:
    0
    Location:
    Richmond, VA
    I haven't worked with PHP enough (and on that large of a scale) to say either way. :dunno:
     
    Last edited: Sep 24, 2003
  19. D1G1T4L

    D1G1T4L Active Member

    Joined:
    May 4, 2001
    Messages:
    16,489
    Likes Received:
    0
    Location:
    Bay Area
  20. aphoric

    aphoric Even if god did exist, it would be necessary to ab

    Joined:
    Aug 29, 2003
    Messages:
    918
    Likes Received:
    0
    Location:
    Leaving Afghanistan
    My SLOC is bigger than yours... Yeah, we know how we count SLOC, high when our internet dicks feel small, and low when we are talking to some geek at work.
     
  21. Astro

    Astro Code Monkey

    Joined:
    Mar 18, 2000
    Messages:
    2,047
    Likes Received:
    0
    Location:
    Cleveland Ohio
    Usually weeder classes do a good job about removing those who are there to make a buck and those who have the mental ability or sheer will power to go on through. I'm not sure how MIT's course numbers work, but it would appear these students have made it through a couple coding classes - it sounds like there could definitely be some folks not cut out for CS still in the class.

    If this was the case, then PHP and the C#/ASP student population would be having problems as well (based on the idea of probability). And from the sounds of it, C# has its own learning curve and C# is NOT taught at MIT, yet a number of the students migrated to it (maybe they've picked it up on the side). This would also imply they have a basic understanding of how web apps are to be built (same goes for the PHP crew).

    I'm not sure how SLOC came up, but here's some numbers I took down today just out of curiousity.

    Everything running off the same box and the same MySQL database (on the same box)
    2 web apps
    PHP version done first
    2nd one converted to Java servlets and implemented the dispatcher+controller+template recipe (actually the PHP implementation uses this recipe as well so the port was pretty easy, but PHP's wasn't as strict and defined).

    PHP:
    7 PHP files total used (including library files).
    3561 lines of code written with what I would consider as minimal documentation

    Same PHP app converted to Java:
    17 total Java files. Three of which were libraries I found on the 'net to handle printf() (is there a built in print() like method available to Java that I missed? If not, then I'm calling Java out as having poor string support - I will freely argue this point for I have a lot of ammo to why it sucks), email, and multipart forms (what a pain in the ass to implement in Java - the lack of string support could be the very cause of this being so painful).

    5420 lines I wrote
    4308 were from the 3 libraries. The printf() library alone had 3000 lines of code (and its not an authentic implementation of printf() but more of a watered down version with limited abilities). It looks like 1/3rd of the code was documentation (which is a very good thing).
    Grand total: 9728 lines

    Granted, I'm not an expert at Java or servlets. Its very possible there's 5 other ways I could have implemented the dispatcher+controller+template recipe and have done it in less code.

    So my conclusion is when I'm at work, I love Java (gotta pay the bills). But when I'm at home, I'm going to be using something else for the web development. I don't want to come off as bashing Java. But its interesting to look at its weaknesses and compare it with what else is available - especially when one has two exact web apps with one in PHP and the other in Java...

    In case you were wondering, the web app in question performs roughly the same when it comes to dishing out pages. Both are equally as fast. I've got timers implemented on the queries because I knew database performance had to be optimized at the start. Just with executing a query and doing nothing else, PHP is typically a hundredth or two faster than the Java version. But in the end, the end user won't notice this speed difference...
     
  22. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,923
    Likes Received:
    11
    Location:
    Los Angeles
    :bigthumb: Good post
     
  23. CompiledMonkey

    CompiledMonkey New Member

    Joined:
    Oct 26, 2001
    Messages:
    8,528
    Likes Received:
    0
    Location:
    Richmond, VA
    Do you mean printf() from C? If so, it's System.out.println() in Java.

    About your application, it was probably best written in PHP. If this was a very large scale application distributed across a couple of quad CPU servers, Java would have probably been the better choice.
     
  24. D1G1T4L

    D1G1T4L Active Member

    Joined:
    May 4, 2001
    Messages:
    16,489
    Likes Received:
    0
    Location:
    Bay Area
    well i mean if php is so good why do so many companies use jsp/servlet instead ?

    i feel like i want to learn php since it's simplier and easier to learn, but at same time jsp/servlets is what going to get me $$$
     
  25. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,923
    Likes Received:
    11
    Location:
    Los Angeles
    I could answer the first part. PHP supports RAD. It's fast development, and a business could get their webpage up in running so much faster as opposed to using something like JSP. That is why so many people use it, and is considered "good" to many people. It's powerful, and you could do what you want with it.

    As for companies using JSP, I dunno... I still see more ASP and PHP populated business pages over JSP. So, I couldn't answer that one for you.
     

Share This Page