
Python & Java: Side by Side Comparison - iamelgringo
http://www.ferg.org/projects/python_java_side-by-side.html
======
mynameishere
You aren't going to be 5-10 times more productive by avoiding the nightmare
that is System.out.println(), or any of the other things he mentions. For
instance, I can't believe this warrants attention:

    
    
      if ( a > b )
      {
          a = b;
          b = c;
      }
    
      if a > b :
        a = b
        b = c
    

Why he thinks the Python example is better here I won't speculate upon--why he
thinks the Python example would contribute to a 5x or more productivity
increase I will attribute to foolishness--but it did give him a chance to
gloss over meaningful whitespace, something that should have died with
FORTRAN.

 _a number of influential voices in the programming community have been
expressing serious doubts about the supposed advantages of static typing._

Ooh, an argument from authority. Well, I'm convinced. I could just as easily
say that "IBM supports Java"--well, IBM is full of influencial voices, yes?

 _Each top-level public class must be defined in its own file. If your
application has 15 such classes, it has 15 files._

Again, pure foolishness to think that this contributes to productivity. "Woe
is me, I have to make another file." At any rate, I'm not sure "top-level" is
an important distinction. I can put as many private or public static classes
in the same file as I want. Do this enough, and you will find out why it is a
bad idea.

 _You discover that F must throw exception SpecialException, and it must be
caught by A._

False. To avoid this unmitigated nightmare, simply throw the exception up, or
only use RuntimeExceptions.

Java doesn't have first-class functions. That's its biggest problem.

~~~
bayareaguy
_Again, pure foolishness to think that this contributes to productivity._

That aspect of Java can be very painful when you need to refactor your
hierarchy if you don't have the appropriate tools. But that is not necessairly
a fault of Java. Refactoring class hierarchies too often likely indicates a
problem in the requirements, the design or the specific developer team.

------
ks
Ir wouldn't make a difference to most examples, but he could save a few lines
by not putting { on a separate line.

------
mironathetin
He never had to debug complex python code. It's a nightmare.

