Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
You are just saying that you think that Perl is better than Java.

Well, as a Java consultant, Perl is much better than Java when talking in production. Also Perl is better in performance too, since Java speed is just crap, yes it is, why to try to conform with the turtle of Java when we know that all the other languages are faster. Let's stop to dream, and let's see the reality.

The only problem with Perl is that it doesn't have the loby that Java has. Soo, the stupid guys will think that Java is better than Perl because it has certification, etc... Soo, they pay me to coordinate the Java production of project. But with all the respect, Perl is better than Java, since I have real comparations with the 2 teams that I have here, and the Perl team is 3 times faster, with much more resources in their softwares, and with less erros. But I only still use Java, since I can't tell them to not use Java, since the client want a system in Java, and because they pay me very well.

I just think how stupid is to do a Java algorithm. Our programmers spend much more time looking in the Java docs, and finding examples at java.sun.com, than really doing the program. Soo, why any resource in Java doesn't have an intuitive way to use. A good example is to work with hashes, specially from the point of view of a Perl programmer, that use a hash just when it want, and the Java programemr does everything to avoid a hash to not use another different object interface in their algorithm.

Other funny thing in Java is the convertion of it's basic types. Soo, they have, char, byte, short, int, long, float, double and string. Soo, how I convert, let's say, string to double, and double to string. Now how I convert int to double? It just doesn't have a common way to do that! In Perl, well, we just never have this problem, since we have something very intelligent, SCALAR! just to show you how stupid is that, here are the ways to convert this types, from a convertion class that we have created:

public static double Str2Double(String i) { if ( i.indexOf(".") >= 0 ) { int p = i.indexOf(".") ; i = i.substr +ing(0,p) ;} double o ; try { o = Double.parseDouble(i) ;} catch (Exception e) { o = 0 ;} return o ; } public static String Double2Str(double i) { String o ; try { o = Double.toString(i) ;} catch (Exception e) { o = "" ;} if ( o.indexOf(".0") == (o.length()-2) ) { o = o.substring(0, (o.l +ength()-2) ) ;} return o ; } public static double Int2Double(int i) { double o ; try { o = (double)i ;} catch (Exception e) { o = 0 ;} return o ; }
Soo, here we have a big static class, with all the convertion methods, what make our life easier. Also we have implemented the Scalar type in Java, what is even better. But why we don't have this resources that make life easier by default in Java? Why we need to develope them? Is simple, because they want that!

Other way to have a Perl programmer laughing is to compare the IO system of Java. For example, how we read a file in Java? Example:

import java.io.RandomAccessFile ; ... java.io.File file = new java.io.File( "/tmp/file" ) ; RandomAccessFile stream = new RandomAccessFile(file , "rw") ; int len = 1024 ; String buffer ; try { byte[] b = new byte[len] ; int n = stream.read(b , 0 , len) ; if (n > 0) { buffer = new String(b,0,n) ; } }
With Perl is just open() and read():
open(my $io,"/tmp/file") ; read($io, my $buffer , 1024) ;
The point is not the number of lines, is the number of resources that we need to learn and use to do this in Java. In Perl we need just to know the behavior of open() and read(). In Java, well, Is soo much thing that I just don't want to start to explain!

Other think that I don't understand is the Java "compilation". Everybody says that Java is "compiled". What a crap, the .class files are just bytecode. But we PerlMonks know that Perl also have it's own bytecode, very well parsed and optimized. Soo, why is sooooooo sloooowwww, to "compile" the .class files, and than why is sooooo slooowww to load and run a .class file?!!! All us know that the .class file is just operations for the Java VM, like a assembler code, that has nothing to do with the OO structure of a Java class. Actually we can have structured code for the Java VM machine, soo why is soo slow to run?

Well, the Java folks can try to defend Java, but what I say is just the reality show man! Java sux, but they pay. ;-P

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


In reply to Re: There's Only One Way To Do It by gmpassos
in thread There's Only One Way To Do It by jdporter

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-03-29 13:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found