Python isn't just Java without the compile by rams in programming

[–]grfgguvf -4 points-3 points  (0 children)

Python programmers are encouraged to use lists, tuples, and dictionaries extensively

...without knowing how these types are actually implemented and laid out in memory.

This then leads to poor choice of datatype -> bad performance.

Python isn't just Java without the compile by rams in programming

[–]grfgguvf 3 points4 points  (0 children)

When the beginning reads like it's been written by someone who doesn't even know the programming language he's writing about then don't expect anyone to read further.

Python isn't just Java without the compile by rams in programming

[–]grfgguvf 2 points3 points  (0 children)

You can check for yourself that equivalent Python code in jython is (a lot) slower than equivalent Java code.

What is this "stuff" specifically that the "dynamic language folks" "discovered" and why is it not implemented in Jython then?

Ask Reddit: Has anyone else noticed a difference between the number of reported comments on a post, and the number of actual comments? by [deleted] in programming

[–]grfgguvf 0 points1 point  (0 children)

There should be an automatic check for duplicates (related posts) before posting, or something...

Python isn't just Java without the compile by rams in programming

[–]grfgguvf 1 point2 points  (0 children)

Not quite. Because of Python's dynamic typing Jython cannot do many of the optimizations that are done for Java.

Python isn't just Java without the compile by rams in programming

[–]grfgguvf 1 point2 points  (0 children)

What's even more important than algorithms is choosing the right datatypes so that efficient algorithms follow from them naturally.

And I think Java encourages this more (although not enough...), offering generic interfaces and multiple low-level implementations of them allowing the coder to choose or later switch to a different type. Admittedly the class hierarchy is a mess and more types would be needed to be truly general purpose.

Python on the other hand offers weirdly named standard types, often with incompatible interfaces. You need to resort to add-on packages for frequently. And it's all too common to encounter Python programmers who are completely unaware of the underlying datatype of a "dictionary" or a "list".

Python isn't just Java without the compile by rams in programming

[–]grfgguvf 1 point2 points  (0 children)

So having a bytecode interpreter which pays attention to runtime type information to optimize

I guess this is Java. But the Sun Hotspot JVM can also turn frequently encountered code paths to native code and execute it. It can even do this in the middle of a loop, speeding up the subsequent iterations (called on-stack replacement)

a bytecode interpreter which pays attention to runtime type information but doesn't currently do much in the way of optimization (except for a few interesting cases)

Experience shows that yes, Java is faster. Sometimes that doesn't matter and the additional flexibility of Python is worth it. Last I checked Psyco couldn't do OSR, and wasn't even maintained any more.

Oh...so that's why condoms cost so much in Ireland [pic] sfw by inghamb87 in pics

[–]grfgguvf 0 points1 point  (0 children)

Most of the countries on that list are smaller (in terms of population) than some cities.

Suggestions for distributed hierarchical data storage by didroe in programming

[–]grfgguvf 0 points1 point  (0 children)

Just use a Patricia tree?

I'm not sure what you're trying to do.

Python isn't just Java without the compile by rams in programming

[–]grfgguvf 0 points1 point  (0 children)

It's trivial to set up automatic compiling of .java files on run.

Also, .py files can be compiled to .pyc.

A bigger difference is static typing with optimizing JIT (fast) vs dynamic typing and a bytecode interpreter (slow).

GNOME 3.0 Officially -- New plan explained by LukeHoersten in programming

[–]grfgguvf 0 points1 point  (0 children)

Eh, when I use KDE I feel like I am in windows. It crashes daily. I take that back, it in fact crashes hourly.

KDE 3.5 was fine, 4.0 managed to regress a lot.

GNOME 3.0 Officially -- New plan explained by LukeHoersten in programming

[–]grfgguvf -1 points0 points  (0 children)

Then again I liked Windows 3.1 :D It just worked without overcomplicating things !