Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!


Forgot your password?
DEAL: For $25 - Add A Second Phone Number To Your Smartphone for life! Use promo code SLASHDOT25. Also, Slashdot's Facebook page has a chat bot now. Message it for stories and more. Check out the new SourceForge HTML5 Internet speed test! ×

Journal FortKnox's Journal: Java vs Perl 60

I made a comment in CyranoVR's journal (summing up bltzu's comment), and thought it was a lot of my opinion put into a couple sentences:

Programming is 20% design, 10% implementation, 5% testing, 65% maintainence.

Perl makes 10% of it cake.
Java makes 65% of it cake.

Now take your pick ;-)

That being said, Perl is great for small project, and Java is much better suited for major/large projects (where maintanence is much more of an aspect).

I'll use /. as an example. It was written in perl, because it was a little college project, but it grew into this massive project. Now maintanence is a bear (find bugs on Wednesday deliveries!), and (I believe) if it was rewritten in Java, using fancy technologies (struts, hibernate, Xdoclet, etc...) it wouldn't be nearly as difficult to manage.
Feel free to discuss/argue (you know you want to) ;-)
This discussion has been archived. No new comments can be posted.

Java vs Perl

Comments Filter:
  • Machine language rewlz!


    While I agree Perl is best for small, quick and dirty, one-shot throw away programs, I would not choose Java for anything, no matter what the size.
    • Have you ever tried it?
      • machine language or java? :-)

        Actually never written machine language, but I've done a little bit of java. Enough to know that I prefer C or even C++ (and I have more than a few complaints about C++...).

        I'm one of those people who despises garbage collection, for example. And while I appreciate good (informative) variable and function names, tradition in java demands names that are absurd. The whole module structure thing is horrific. And how can you possibly do anything interesting without pointers wi
        • You sound like me 2 years ago. I've seen the light since then.... :)

          Garbage collection is the only way--it has improved tremendously and is so unobtrusive, you forget about it (as you should). You can actually concentrate on better implementation instead of mallocs and deletes.

          What do you really need multiple inheritance for?

          Character arrays are pure evil.

          Buffer overflows are bye-bye.

          Exceptions are powerful if handled correctly. They also remove a lot of shit like:

          if (error) {
          else {
          if (

        • I'll argue for the sake of arguing. I know I cannot convince you, but at least lemmie breakdown your complaints ;-)

          java demands names that are absurd
          There are no real 'demands' on the names. The rules for names are pretty much the same as in C.
          And how can you possibly do anything interesting without pointers
          This is a common misconception. In java, EVERYTHING is a pointer. It just knows when you are refering to the pointer, and when you are refering to the value. You are just passing around refe
          • Multiple inheritence?
            Multiple inheritence (I'm using the definition of 1 class having 2 concrete object parents) is faulty by design. It isn't truely OO, and is just the bastard child of C++.

            here here!

            Actually, exception handling with the hierarchy I've found to be quite elegant. Really allows you to handle exceptions the right way, and ignore checking for things in the middle of business logic.

            Again, exactly. I like to know what I'm catching and deciding whether or not I need to throw it back to the
          • There are no real 'demands' on the names. The rules for names are pretty much the same as in C.

            Syntactically, you're correct.

            Culturally, you're dead wrong. Java culture (ie every Java programmer I've encountered production code from) demands absurdly long and descriptive variable names. In my experience, every Java programmer I've encountered has to contort their mind to get around the brevity of C-style variable names. Thus, since it's likely that at least some portion of the code maintenance will

  • I have books:

    Learn Java In 21 Days purchased in say 1996

    Learning Perl purchased in say 1997

    I can program in Perl, and I still can't program in Java.

    Perl wins.

    Oh and as a (Windows) Sys Admin I hate Java and all it stands for.
    • I'm a (Windows) Sys Admin and I program in Java. I'm trying to pull several different types of systems together (Mainframes, old webapps, OpenSource databases, and windows stuff) into one easy to use webapps, and servlets great for that. There are hundreds of free connectors out there for many different things, and Java was close enough to C++ (which I already knew) that it was easy for me to learn. Ditch the learn in X days Java book, and either take a course at Sun, or get a thick tome that says someth
      • Re:This is easy (Score:2, Informative)

        by FortKnox ( 169099 )
        "Thinking in Java" by Bruce Eckels. Live it, learn it, love it. Its free on the net and is the best learning Java book there is.
      • No, no. Too late. Perl Uber Alles. Besides Java and its spawn bring evil upon my users. ;)

        My brain doesn't work for programming. I'm supposed to be teaching History for chris'sake! I use Perl to get shit done once. It takes a little longer (thie first time) but then it's all easy.

        I actually tried Mastering Java, and Thinking in Java [is-a-geek.org] but it turns out I can't think in Java [is-a-geek.org] at all. I (seriously) have trouble ordering Java at Starbucks.
  • well, seeing as though i earn my keep by designing/engineering large complex enterprise-ish systems using java (and doing it rather well, thank you) I would always turn to java.

    i've been messing with java, well since the 1.0 days, out of simple curiosity (i was just getting up to speed with Perl -- heh, funny eh?).

    I love perl, its my first language I ever learned. its fun, expressive and enables some very cool things, especially when you make it look like an OO language :)

    I have found in my experience, t
    • What is the difference between the classpath and LD_LIBRARY_PATH anyway (other than the obvious "specification of jars instead of dirs" thing)? And what makes either any less or more difficult to set with ENV VARs?

      Shit, most of those who complain about the classpath don't even know what LD_LIBRARY_PATH is. They probably think that binaries automagically find their non-local code.

      Of course if they again wrote any real code (i.e. large enterprise projects) they would run into some hassles of SE project ma
      • asserts? The new loop syntaxes (honestly, I don't like these, but it just be my resistance to change)?

        Generics and asserts will change the way I code :-)
        • That sounds right. I'm mixed on enums (since that's a little too preprocessor and thus anti-OO for me). I think the caching on the interpreter will be a nice boost too.
          • enums have nothing to do with the preprocessor and are very OO. They are how you describe non-continous sets with distinct elements. Apple, Orange, and Banana. I mean come on, so they'll implement it with final statics internally, big deal.
            Java handles the symbol table wrangling, and encourages descriptive identifiers, so why not abuse it!?

  • ...if it can't be done in PHP, it doesn't need to be done.


    Actually, I would say that about Apple BASIC.




    • just to nitpick ... it's AppleSOFT Basic. :)


      • just to nitpick ... it's AppleSOFT Basic. :)

        Yeesh! [myoldcomputers.com]

        10 NEW
        20 PRINT "D'OH"
        30 GOTO 10




      • it's AppleSOFT Basic.

        AppleSOFT BASIC, which had floating point and other goodies, was only available on ROM later on in Apple's history, though older Apples could always run they had a "language card" that essentially bank-switched 16K of ROM. (This functionality and hardware was built-in to the Apple IIe.) I always prefered loading "Integer BASIC", not because it wasn't MS, Fear and Loathing of MS happened later, but because then you had a mini-assembler mode that made it easier for me to write 6502 asse

    • (Aiming low) *SMACK* (right between the eyes!)

      PHP sounds like a drug or something.

      Java rules the wasteland! Standing proud, not ducking...take your best shot. ;)
    • Three cheers for PHP

      ..and those too lazy to just learn perl!
  • I'm currently in a project where we are getting a hand-over Java project. The problem is, some of their implementation choices are ass.

    From this we want to develop a new system but the central parser engine we don't want to touch. It would be great if it could just be cut and pasted into our CVS module.

    Problem are those implementation choices. They didn't leverage the power of OO in a project with many sibling classes. No factories for shared global distributed functions, stylistic changes from one ki
    • That's my current assignment. Guy on a project for 6 months. Does more harm than good. Fired. Me contracted in. Have 4 weeks to take shitty code and fix it into something that works. Its 6 months worth of work. Its almost done. It may be worth it for project #2 (someone from my company is architecting it, so it'll be designed well. I'd step in as business analyst and senior developer).
  • Java sucks, Perl rocks.

    End of argument :-p
    • vi!

      my answer to everything. :)

      • Funny story. I was in a lab where I was trying to set up a source repository. Because I don't have admin rights there, I was going to need to use VSS instead of CVS (which is strange since it's a Java project). While fiddling with it I asked a guy a question.

        "What IDE are you using?" he asked.


        "Like the text editor?"

        "Vim is an IDE."

        "Why would you use that?"

        "Can your IDE do regex with your fingers on the homekeys and fit on a 1.44 floppy?"

        And I wasn't being facetious. There's a reason why yo
        • I'm AOL-ing again, but ditto. Vim is incredible. I've finally shown my friend/co-worker the light. He was using Eclipse, Visual Studio, blah blah blah. I would be fine having a couple xterms open using VIM and ant.vim.

          He tried it for a week and uninstalled all that other garbage shortly after.
      • Emacs :-p it comes with the power of e-LISP!


        (yes, I do use it. no, it is not my preferred editor - I use notepad [tm])
    • Your sig says you are interested in AI.

      Every written a neural network in Java? Then did feedback looping and such to it?

      Having a single 'neuron' object, and just mapping it around with managers and controllers makes Neural Nets fun and easy in java.
      • I do know that Java is better than Perl for any AI stuff - its just that for any little thing that I have to do, I have to go to such lengths to get it done.

        As an example - we're building a system that resides on PDAs (connected to tiny GPSes) to adapt to user schedule and calendar based on the position - to even get the basic thing up and running, there is so much that I have to do - that I'm better off using something simpler like C and reinventing the wheel.

        Do not get me wrong - I think Java is a great
  • Python wipes the floor with both of them. It's easy to learn, easy to write, easy to read, and easy to maintain.
    • No! COBOL!



      Actually, I don't have a flying fuck of a clue what I'm talking about (being a PHP monkey and all), but a true geek would never admit that. So PYTHON IS TEH SUCK d00d!!!1!11!!!



      • You're a web monkey...you never tried Tomcat with JSP & servlets? I would think with ur sk1llz you'd rock out with a *good* web development platform! :)

        I love these techno-religious battles. They're so meaningless, yet if everyone just listened to me, the world would be in a lot better shape.
        • JSPs and Servlets? Quit living in the past, man. Its all about the struts [apache.org], baby!
          • Haven't used struts. I got the impression that Struts was a crutch as opposed to a useful tool. I wanna write my own MVC--it's not hard!!!

            I should research it more instead of hearing about it second hand. Our prof in OO Web Development was none too fond of Struts--he loved Tomcat though.

            In that class, I wrote my own MVC app without learning what MVC was yet! That was the only time in my entire life that I re-invented the wheel.... :)
            • Let's say that stuts has the advantage of being there. No company is going to pay you to build your own MVC environment (even if you think you can do it better than struts). So, after getting used to struts it just works and you rarely have to touch any struts things once the whole project is correctly outlined.

              I won't say it's the best thing around, but we (read as: people who earn their money with Java and are on limited budgets, like me and FortKnox) do with the tools we get.

              • That sounds good to me. I think I'll look into it further since you clarified it for me.

                Just wasn't really sure if it was useful or not....

                More and more, I'm earning my money from Java too--which is fine be me. I could be stuck somewhere, like some middle aged guy, writing mainframe assembler or COBOL. :)
                • Trust me, I was sceptical too. Let's just say that struts will take about the whole navigation of your jsp vs. controllers away and do it for you. Nice... And "debugging" struts-config.xml can be really a pain. Well, I was lucky, when I didn't find out, our architect was there to hold my hand ;-)

                  Don't diss mainframe assembler or COBOL. These guys will still have *better paid* jobs when the Java guys are begging for quarters on the street. It might not be the most interesting job, but some of thes

                  • The way I'd look at it, I'd rather be happy with what I'm doing making less money and surviving than making tons of money and being miserable. Of course, begging for quarters on the street is not for me and I'd learn COBOL if that was the only choice! :)


                    I don't really see a dearth of good paying Java positions either, to be honest, and I see COBOL and mainframe assembler slipping more and more away to obscurity. Eventually there will be no need at all for that type of programming someday as s
                    • At least that's what I think.

                      Think again: banks are fond of their mainframes. Mainframes will still be treating your financial transaction in 25 years. You can trust me on that.

                      Good Java programmers are NOT a dime a dozen as far as I can tell.

                      Well, I hope I am one of the good ones :-)

                      So, are you home now or at work? I wish I was in Europe right now so work would be over for the day. :)

                      Last post I was at work on dial-up with my iBook. Now I'm at my parents on the machine I'm installing fo

    • I have the learning python book. I need to delve into it better. Was going to learn it after perl, but my job 'forced' me to learn java, and here I am ;-)
    • Damn, beat me to it.

  • C# and the .NET Platform make it 100% easy. Double-plus good.


    • C#? The .net platform, yes, but C# was acuratley described in a discussion of the name of the # symbol. # == rap as in C#. I'd love to love it, but I just find its annoying.

      • I'm sorry, but I don't follow you exactly. What do you find annoying about C#? The name? Or something in the language? If it is the language, what is it specifically you don't like?

  • I love Java. Don't know Perl. I think that programming skill has nothing to do with what languages you know.

    That said, when I think of Perl, I think of Slashdot. In a non-positive way.

    Java is not a cool language. C, C++ and Perl are cool. I've heard good things about Python, but sometimes it feels it's just the BSD of programming languages, for people who think perl (Linux) is too mainstream.

    What I most like about Java is that you have to be explicit. There isn't a lot that is just assumed, implied or do
    • You'd hate Perl then - everything is assumed, implied or done automatically.

      Reference an array index that is out of bounds? Not a problem, Perl grows the array out to the size of what you tried to reference!

      Use a number in a string context? Not a problem - Perl converts it on fly to be used as a string!

      Forgot a parameter for a function? Not a problem - just about every standard function has a default variable to be used for function arguments!

      Then again, Java probably does more stuff automagically th
  • The abstraction power of Perl with C/C++/Java syntax. The best of both worlds.

    Perl is a generally excellent language with an excellent implementation, but has the misfortune of having a far too low ratio of real programmers to webmonkeys and garden-variety sysadmins.

    Java is a pretty damn good language (especially in 1.5) with what has generally been crappy implementation, but it's almost exclusively used by real programmers.

    I'd put PHP in between Java and Perl in all respects. I like balance and all

    • Personal Home Pages...

      I've never gotten past how HTML/CGI/template-processing oriented the whole idea seems. Change my derelict views! I am but a system programmer.

      In that same respect, imagine the laughs I get when I suggest to people that javascript (well ECMAscript) would be a kick-ass replacement for perl or python as a system programming/scripting language. (But really, I mean, imagine Ruby, only less awkward and more intuitive)

      Is the same stigma/reality relationship true for PHP?
      • Actually, it stands for PHP Hypertext Preprocessor, though it is based on a series of Perl scripts devised by the original author called Personal Home Pages.

        I'd say that PHP has that stigma. And indeed, its roots are (as mentioned above) as an HTML-embeddable language (and indeed, as far as I know, the language explicitly requires that all code be contained inside <?php ?>). But that leads me to what I view as its greatest feature: the fact that it is oriented towards templated output (though it's

  • It doesn't matter what tool you use, you should test it before it goes to production (something lost on Taco et. al). Testing reveals bugs. JUnit makes java testing easy and in some sick sense, a game.

    I've been "promoted" (quoted because I'm still not sure if it is meant to be a promotion) to a job where my responsibility is managing testing efforts on a project. When we build the schedule, I make sure that 40% of the budgeted hours go to testing (some for planning, some for execution--depends on the pr
    • Don't get me wrong, testing is just as important as design and coding, however, I was only including 'user testing' in the 5%. I consider unit testing to be a part of development/implementation.
      • One of the efforts I'm on right now is spending the majority of their time in user testing. Let me try to explain it.

        We have a large system in a financial services company that is going through some small, but significant changes, i.e. the changes in the code are small relative to the impact it will have to the business. This system is a large legacy beast that crosses all lines of business in our division and interfaces with systems (some new some legacy) in other parts of the enterprise. There is some
  • Commentary from all sides, couple of comments that stood out were

    I think that programming skill has nothing to do with what languages you know.
    I would tend to agree with this with the exception of Assembly Language, We have 2 guys here that Know assembly inside and out and they can out program the rest of us in any language they might choose to, it has inspired me to start picking at learning assembly in my spare time, I had several classes in College where we had to do a smattering of Motorola Assemb
  • Perl makes 10% of it cake. Java makes 65% of it cake.

    Isn't necessarily true. Good Perl should be almost as easy to maintain as Good Java. It's more the programmer and the infrastructure they used than it is the language, although the language can help or hinder in certain cases.

    Let's make this clear: I love Perl. I don't know Java. I've tried to deal with Java several times but just couldn't deal with the verbose syntax, especially after having several near meltdowns dealing with MFC. I picked up Pe

    • Do I make you want to run away screaming? =)

      COBOL is the best tool for back end business processing hands down. Java is a close second.

      Every tool has its uses. You wouldn't use a hammer as a vise just as you would probably not want to use COBOL to run a large-scale website on the front end (although you may want it to handle back end data retrieval and manipulation, but that's another discussion altogether).

      You'd be surprised at what can be done with COBOL on the good old mainframe these days (as long
      • Do I make you want to run away screaming? =)
        D'oh! I had to go and open my mouth wide enough to stick my foot in it.

        For what it's worth, my mother was a COBOL programmer. It's the language that gives me migranes, not the people that use it. Again, like I've already said -- the best tool for the best job. If your problem is a screw, and COBOL is a screwdriver, then use it! =)

"If it's not loud, it doesn't work!" -- Blank Reg, from "Max Headroom"