chimni has asked for the wisdom of the Perl Monks concerning the following question:


I started developing a tool in perl,now management wants me to shift to a java framework.
Following is my problem statement and the design components i thought up.
Would shifting to java for such an app be useful?
someone give me an excuse not to :))))
actually just your frank opinion on what technology suits this tool.


I was given the following problem statement:
Requirements
Make a network statistics reporting dashboard showing line charts of the following
a)Ping response time daily,weekly,monthly
b)Bandwidth util in bits/sec time daily,weekly,monthly
C)Bandwidth util out bits/sec time daily,weekly,monthly
Graph plot points

-Daily 5 mts
-Weekly 1 hour
-Monthly 6 hours
scope

80 router *2= 160 interfaces.
Data is to be polled at 5 minutes intervals.
Graphs for n-1 days to be shown on the web
query interface for showing date time to date time graph
Polling script to be deployed in Europe.Database and front end in India.All reports to have GMT standard.
Design constituents
What all i think i will use.the purpose is to make the tool as well as learn more perl.
Database

MySQL 4.0 (feel oracle is over kill)
DBI-1.40
DBD-mysql-2.9003
DBI-SHELL-11.93 (optional for db maintenance)
Graphing

DBIx::Chart 0.01
DBD::Chart 0.80 (png charts)
Data Polling

Net::FTP (for transfer)
Net::SNMP
syetem ping
Front end

cgi.pm
HTML::Template 2.6
Forking :-Parallel::Forkmanager
Error Logging :-Log4perl
Webserver -Apache


Would Java/Java framework(our company has a home made one) offer any particular advantage over perl in this scenario.
My opinion : i do not know if java is better than perl .But for such an app i do not need java.
Thankfully they have regex in 1.4.0 or i would have gone mad.
Thanks,
chimni
  • Comment on Choice of development language:Perl or Java

Replies are listed 'Best First'.
Re: Choice of development language:Perl or Java
by Abigail-II (Bishop) on Feb 27, 2004 at 11:54 UTC
    i do not know if java is better than perl.
    Both Java and Perl are fine languages, that have proven their merits. I do expect though that you'll get a lot of biased replies - but considering the place you ask, that's what you expect.

    I think that if you have to ask here whether Java or Perl would be better, you have already lost the case. When choosing a language to develop an application in while being employed, there's a lot more that matters than whether language X is more suited than language Y.

    Standards are good, because that favours interchangability. That's why companies prefer to limit the amount of languages they use; because the more languages they have work written in, the more different abilities they need to hire.

    What all i think i will use.the purpose is to make the tool as well as learn more perl.
    I guess that "learning more Perl" is your own private goal, and it's not the companies goal to have you learn Perl with this project, otherwise, they wouldn't say you need to do it in Java. The fact that you state such a goal makes me think you haven't quite mastered Perl yet - and this weakens any argument of shorter development times that you could use.

    Abigail


      "When choosing a language to develop an application in while being employed, there's a lot more that matters than whether language X is more suited than language Y."

      ++. You are right (as you 99.9999% of the times are) :)
      I have not "mastered" perl,lots to learn,I dont think even you or merlyn or the other guru's here quite claim that.(so I probably never will).:))
      shorter development time i could provide but your quote above has made me factor in the "political environment" in an organization.
      I guess i'll just tread on as few toes as possible :))
      thanks
Re: Choice of development language:Perl or Java
by astroboy (Chaplain) on Feb 27, 2004 at 11:51 UTC

    A similar system was written for a telco that I used to work at. It was done in Java, had a team of three and took a few months to write. The reporting web front end was done using a proprietary tool (not Crystal but something similar). That took another developer a couple of months - he spent most of the time fighting the tool (graphs looked fine in development preview mode, bad when deployed to the production server).

    They were all good developers, but looking back it seemed to me that it could be done alot more simply in Perl (which I didn't know at the time). I often think that I wouldn't mind rewriting the system myself now that I've learnt a bit of Perl...

Re: Choice of development language:Perl or Java
by Tomte (Priest) on Feb 27, 2004 at 12:21 UTC

    Doing most of my work in java, with one ongoing project written in perl (based on slahcode), I have to say I'm biased towards recommending perl for such a task: It is, to quote dragonchild once more, already 90% written in perl.

    On the other hand: I recommend this, because to dive into the depths of slashcode taught me something about perl and how to programm it: but that took a fair amount of time (we released the first version with 4 weeks delay, some of that attributed to myself learning to love perl the hard way).

    If you know how to code in java and how to use this internal framework, and this framework is actually suited for such a project, java may very well be your premiere choice ragarding your company and assuming you want to keep your job there.

    One point in favour of perl is maintance time; maintaining a java application server (most of the time with apache on top) costs far more time than apache+mod_perl; and bug-fix / new-version cycles will take much less time.

    regards,
    tomte


    Hlade's Law:

    If you have a difficult task, give it to a lazy person --
    they will find an easier way to do it.

Re: Choice of development language:Perl or Java
by flyingmoose (Priest) on Feb 27, 2004 at 14:45 UTC
    I once helped write a systems monitoring app for a telecom once -- internship project, but it was well coded. I came back to work some over Christmas, and they ported it to Perl to reduce server load -- it now was written in 10x less code, ran 10x faster, and consumed 10x less RAM. That's all I'm going to say. At the time I was indoctrinated to be very-pro-Java and it really was enlightening. I knew Perl at the time, but how could those few lines of code replace what took me so long to implement?

    That, and Java for me is a pain-in-the-you-know-what to manage. Inconsistant API's, bad layout managers, the joke that is "write once run anywhere", bad File I/O, poor OS interlocks, JNI's a pain in the butt, ugly bloated regex syntax (if you aren't locked into 1.3 like we are for SCO (ack) support), slow development speed even among "expert" Java programmers, cultural requirement to use getters/setters versus "real" OO, JVM bugs, etc, etc, etc...really I'm not going to post too much more on the subject since it's just going to get me worked up about how much I hate to use this language everyday at work, and how we should really be using Perl!

    Ok, I will add one more thing. For a guy that hasn't written any Java, this article is dead-on IMHO. And I've written a ton of Java:

    Paul Graham on Java

Re: Choice of development language:Perl or Java
by inman (Curate) on Feb 27, 2004 at 13:00 UTC
    The choice of development language depends on the task in hand. It would appear from the description of the task that you want to do conventional networking/parsing/web/DB tasks for which Perl is an excellent fit. The task also involves all of the features that are covered many times in the monestary, so you get some support from friendly monks.

    The argument would favour Java if you needed to target specific Java APIs for which a Perl version was not available or you needed to meet hosting requirements that restricted you to Java/JSP.

    From the companies point of view there is the issue of maintainability. If you are the only Perl developer amongst a group of Java developers then I can see how Java might be a preferred.

Re: Choice of development language:Perl or Java
by adrianh (Chancellor) on Feb 27, 2004 at 15:16 UTC
    management wants me to shift to a java framework

    Have you asked why?

    It may well have nothing at all to do with whether Perl is more or less suitable for this particular task.

Re: Choice of development language:Perl or Java
by Theo (Priest) on Feb 27, 2004 at 15:23 UTC
    Does Java have a lot of modules already written for you?
    Would your boss even consider letting Perl into the maintenance environment?
    Are your Java skills better that your Perl skills?

    You could develop the Java version on company time and the Perl version on your time. If Perl is as much better for the job than Java is, (as some here seem to think) then you should have the Perl version up and running before the Java version is anywhere near done.

    -Theo-
    (so many nodes and so little time ... )

Re: Choice of development language:Perl or Java
by dominix (Deacon) on Feb 27, 2004 at 12:18 UTC
    well. just to know, did you ever hear of mrtg ?
    --
    dominix
      I've used mrtg, and I'm far less than thrilled about it. Unless the tool changed majorly the past year, its design is fundamentally flawed. It makes you make decisions related to how the data is going to be displayed when configuring data collection/retention.

      For instance, you let mrtg make yearly graphs about loadavg. Almost always, your loadavg is less than 2, but you are very interested in seeing when it's close to 2 and when it's below 1. But 6 months ago, an application went haywire, forked itself too many times, and your load avg briefly approached 100. Your yearly graph is now worthless, as that single spike dominates the picture, turning your graph almost into a representation of a Dirac function. You can prevent yourself against that by having mrtg discard too high values, but then you have no history of the event. It doesn't allow to ignore spikes when displaying the results.

      Anyway, this rant has little to do with Perl. Except that I've written plotting applications many times in Perl, and I vastly prefer them over mrtg. I never use any plotting modules in my Perl program - I always open a pipe to gnuplot.

      Abigail


      i knew that was coming.
      well i have looked at mrtg.
      mrtg uses RRD tool (graphing and round robin database )
      data aggregates and/or gets written over in time.
      my people do not want aggregate data,want to see each polled value on a graph for a certain period.
Re: Choice of development language:Perl or Java
by Jenda (Abbot) on Feb 27, 2004 at 16:22 UTC

    The app looks like a textbook case of something that should be done in Perl.

    Well whether or not do they have regexes is not the real point. I've seen the regexes in C# and to tell the truth it's not something I'd like to use. The person who designed the "framework" around them aparently suffers from OO overdose. Though the question is whether he could do any better in C#. Anyone seen the "capitalize the first letter of each word in a string" examples in "C# in a nutshell"? Gross!

    Jenda
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
       -- Rick Osborne

    Edit by castaway: Closed small tag in signature

Re: Choice of development language:Perl or Java
by prostoalex (Scribe) on Feb 27, 2004 at 16:55 UTC
    It looks like for Perl you already know the components of your system, and can probably provide rought estimates on the time it's going to take to complete the project.

    For this exact application Java doesn't offer any unique advantages over Perl. Management should evaluate the speed of development, and whether it's wise to switch to a new environment, when you've already assembled a team proficient in a different environment.

    However, let me point that I think Java allows for better code reusability than Perl, and if you expect similar projects to pop up, it might be worth switching, but at the same time Perl is not terrible with reusability either.

Re: Choice of development language:Perl or Java
by blue_cowdawg (Monsignor) on Feb 27, 2004 at 18:27 UTC

    My thoughts on this can be summed up in a phrase: "Right tool for the job."

    How do you go about figuring out the right tool for the job? Glad you asked!

    Some (but not all) of the criteria I used for picking a language for a task is as follows:

    • Am I going to have to redistribute the code or
    • does my code have to run on random clients?
    • How much work am I going to have to do to get the language to do what I need it to do?
    • Do I have to spend time learning this language before I can write my code and do I have the time to do that?
    • Is the lifespan of the end product short or long? And with that thought:
    • Is someone going to have to maintain this code after I'm done with it and what are the skill sets that are available or expected in future maintainers.
    • and kind of summarizing some of those thoughts: portability...portability...portability...

    I have to confess that I have yet to write something that has gone production in Java. Not that I haven't started to, but somewhere along the line I run into something that I intended for Java to do that I couldn't make it do and I threw my hands up in the air and found another way to do it. So some of my opinions about Java are colored by my perceptions of the language.

    On the other hand for heavily UI/Web based applications I might consider writing a Java UI to run on a user's local browser and use Perl as my backend to collect and ship data.

    Another consideration that I did not list above that is an important one to you professionally is if the technical direction of your company expects you to code in Java (or some other language) and you refuse then this could be reflected negatively in your next performance appraisal. The exception (possibly) to this is if you are considered a big fish in your local pond and you can convince whoever is setting the techinical direction that there is merit to doing something other than the set technical direction.

    Just my US$0.02 worth...


    Peter L. Berghold -- Unix Professional
    Peter at Berghold dot Net
       Dog trainer, dog agility exhibitor, brewer of fine Belgian style ales. Happiness is a warm, tired, contented dog curled up at your side and a good Belgian ale in your chalice.
      To add to this, don't we want to look at:

      a) How many people in the company knows java vs. perl

      b) Do they have any reusable libraries in one language

      c) What kind of IDEs they use and what language it supports

      d) what about other supporting tools?

      e) what about documents such as design/coding guidelines?

      Don't you have to consider all these if you want to introduce a new language to a company?

Re: Choice of development language:Perl or Java
by gmpassos (Priest) on Feb 27, 2004 at 18:58 UTC
    With all the respect, but your management don't know anything about Perl and Java. If you need to make a network statistics, I can guaranty to you that with Perl is much more easy (actually is perfect for that) and with Java will be a hell. But, good luck.

    Is strange to see that:

    "I started developing a tool in perl,now management wants me to shift to a java framework."

    For me is strange, since I saw a lot of companies, big actually, that changed their Java system to Perl or PHP, after use Java for more than 5 years! I say that because I have worked as consultant for 7 shifting projects like that, all of them to change Java to Perl. And all the big companies said to me that they are just tired to spend time and money with Java, they just want results.

    I can't forget to say what I listen one time about Java from the IT of a big ISP:

    "If you have time and money to spend, use Java, if you wan't to win time and money use Perl".

    Graciliano M. P.
    "Creativity is the expression of the liberty".

      if you can't get good string manipulation library for java...as the built-in routines are a pain and take lots more lines of code than perl...then go perl. But, like you already mentioned, it may be more polictically correct for you to go to java. if they don't mind you taking some initiative, then you could re-write a little part of the current system in java and show them how much more messy it is than in perl...maybe they'll listen; or maybe they won't -- depends if the order came from high above or not.
Re: Choice of development language:Perl or Java
by EvdB (Deacon) on Feb 27, 2004 at 17:39 UTC
    It seems to me that this project can be split into three parts: Collect the data, store the data and then display the data.

    You have chosen to store the data in mySQL, which leaves the other two tasks. Perl could easily handle collecting the data and passing it to the database, java may be better at displaying the data. As long as the database remains the same the two parts could be dealt with seperately. That said if your main display method will be over the web then Perl would be a good bet.

    Prototype in perl, and unless there is a compelling reason to change, keep it in perl.

    --tidiness is the memory loss of environmental mnemonics

Re: Choice of development language:Perl or Java
by chimni (Pilgrim) on Mar 01, 2004 at 04:37 UTC

    Thank you all for your thoughts on the topic.
    I have contemplated a course of action based on all the advice i have got.
    I will go ahead with "company directives" ,we dont want a "z" in a performance appraisal or be labeled "does not align with corporate strategy"
    (Boss,if you happen on perlmonks and are reading this,it's a JOKE.yeah,your supposed to smile).
    At the same time i wil build a perl prototyope and bring it to my superiors attention.(fortunately ,i am blessed with a team that figures this overtime might lead to undertime in the future).
    Of course it is upto the managemet to decide:
    If you have time and money to spend, use Java, if you wan't to win time and money use Perl

    Thank you again for your insight ,not only about programming and languages but also about how companies think and why they think so.
    Being relatively new in the industry the above has been the greatest learning.
    Thanks again.
    rgds
    chimni