• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Java advantage over python?

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What advantage does Java have over Python?
 
Saloon Keeper
Posts: 7314
170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That is like asking "what advantage does a hammer have over a screwdriver". Different tools in the hands of different craftsmen lend themselves to different jobs.

See https://coderanch.com/t/688678/java/Learning-Python-order-learn-Java and https://coderanch.com/t/694518/languages/choose-Python-Java for extensive previous discussions.
 
Marshal
Posts: 75620
354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
. . . and welcome to the Ranch
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Python is mainly used for small scripts by rookies, its performance is terrible compared to Java. Java is usually used for more professional applications.
 
Bartender
Posts: 1868
81
Android IntelliJ IDE MySQL Database Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
John, you may be interested in know that Python is/was used by YouTube and many AI system.
As such I'm not too sure that you previous statement regarding some of the issues with Python hold true.
Here is a write up regarding other large Python projects
https://smallbizbonfire.com/profiles/blogs/top-7-famous-applications-written-in-python-you-should-know
which is repeated in this posting
https://www.codeinstitute.net/blog/7-popular-software-programs-written-in-python/.

The advantage of one language over another depends on the problem to be solved. Each language was created by the creators to solve a problem.
Some languages can solve certain problems easier/quicker then others. Therefore Tim previous statement appears to be fairly accurate:

Tim Moores wrote:That is like asking "what advantage does a hammer have over a screwdriver". Different tools in the hands of different craftsmen lend themselves to different jobs.


 
Tim Moores
Saloon Keeper
Posts: 7314
170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For some perspective, check out the recent coverage by such an unlikely magazine as The Economist: Python has brought computer programming to a vast new audience
 
Rancher
Posts: 89
13
Scala Eclipse IDE MySQL Database Tomcat Server Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Because they are different doesn't mean they are incomparable though. We can pro con each language to give OP a better understanding of why you should pick one or the other

we can start with an informative post Tim Holloway wrote a couple months ago

Tim Holloway wrote:I work along the same lines as Joe Ess. Although I also still use Perl if I need something that's heavy on regular expressions.

Python is good for complex quick-and-dirty apps.  It's almost exclusively what I use for Raspberry Pi projects, since there's a good fit between the APIs I use and Python. I also use Python BeautifulSoup when I need to mine HTML for data.

Java is what I use when I need industrial strength. That is:

A) I need to handle heavy loads/many concurrent users and I need a robust and complex infrastructure to support me.

B) I need security

C) I need performance

D) I want the flexibility to swap out different service providers at need. For example, Hibernate versus Apache OpenJPA.




The languages differ in style which may or now be an issue for other. Java being extremely verbose while Python is white space delimited (which I hate personally).

Java is more portable as it is designed to be able to run on any machine, while you might have python run into compatibility errors.

There is the static versus dynamic typing debate which is a conversation of its own.

Java is king of the mobile app space (atleast for Android) as the android runs on a modified version of the JVM.

Java has an absolutely MASSIVE amount of functionality built in. UI, CRUD, time calculation, functional programming plus many more all come standard. I can't really speak for Python on this as I'm not a python dev.

At the end of the day, it does come down to which tool is better though. you can screw a screw with a claw hammer but its not necessarily efficient.  Keep these issues an what everyone else has said when determining what to use

Being a Java dev I am kind of biased though so here's an article from a Python dev's perspective
 
Saloon Keeper
Posts: 25453
178
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are 2 unofficial tiers of programing, or perhaps 3.

The lowest tier is lightweight programming. This can be casual users, or school projects, or people who want to program but not want to invest in a detailed education in computer science and software engineering.

Or, it can be serious software professionals who need something quick and don't care if it's "dirty". Meaning basically hack work to solve a problem that's annoying, but doesn't rate rigorous design, security, or performance.

The second tier is industrial-grade programming. That's stuff that does require careful design, usually has to integrate into an IT infrastructure and (contrary to the opinions of management and the users) cannot be done properly by little 10-year old Jimmie, since after all "All You Have To Do Is..."  

A third tier is heavyweight industrial. Real geek work like compiler internals, OS design and support, stuff like that.



Once upon a time, the lowest-tier stuff tended to be done in Visual Basic. Mostly before VB became popular, computers were too hard to use, so I won't address what preceded that. The original BASIC wasn't really seen outside computer labs.

But VB was almost exclusively a Microsoft DOS/Windows product. Microsoft made some forays onto the Amiga and Mac platforms, but for the most part, it didn't have the hacker traction that it did in Windows. Instead, the Amiga tended towards REXX, and Apple likes to make up its own solutions. Python, on the other hand, was a late arrival, but has become widely accepted almost everywhere, although on Windows I think the .Net tech probably still reigns supreme.

Java is definitely not a lightweight development platfom. You cannot even get code to compile until you've done considerable up-front work, much less make it display any acceptable output (at which point, of course, they expect it in production by Tuesday, despite the fact that the public façade is about as real as a Western movie town).

Java can do performance and security demonstrably better than Python. But that doesn't mean that Python is just a "toy". Consider this: The Red Hat Linux operating system does a very comprehensive HAL configuration process when you boot, and the subsystem that handles that - Anaconda - is primarily written in Python (Python, Anaconda, get it? meh). Python also contributed a lot of infrastructure to OS virtualization platforms, although Go is perhaps more popular when you do containers.

I'm certainly pro-Java, but I spent half this morning working with a home automation controller, talking to it in Python.

Then I moved on to a project that reads temperature, humidtiy and rainfall from remote radio sensors. In C++.
 
Campbell Ritchie
Marshal
Posts: 75620
354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:. . . A third tier is heavyweight industrial. Real geek work like compiler internals, OS design and support, stuff like that.

The sort of thing also done in academia (at its best), IBM Research, Microsoft Research, etc.

. . . . Mostly before VB became popular, computers were too hard to use, so I won't address what preceded that. The original BASIC wasn't really seen outside computer labs.

It was quite popular nearly fifty years ago, when I was doing timesharing.

. . . a project that reads temperature, humidtiy and rainfall from remote radio sensors. In C++.

Presumably because C/C++ can access low‑level system resources so much more readily.
 
Tim Holloway
Saloon Keeper
Posts: 25453
178
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:

Tim Holloway wrote:. . . A third tier is heavyweight industrial. Real geek work like compiler internals, OS design and support, stuff like that.

The sort of thing also done in academia (at its best), IBM Research, Microsoft Research, etc.


Also a certain company known as Red Hat, Oracle - which reminds me - databases, and a whole slew of open-source projects. This is systems-level programming and as a rule, it differs from line-level work in that instead of doing "useful" work, it makes it possible for the apps that do do useful work to run, and, more importantly, requires an extra high skill level because you're typically dealing with threading, interrupts, and/or low-level OS code. Or, as I used to say: "If you can understand what I do, I'm probably not doing the stuff I'm paid to do."

Campbell Ritchie wrote:

Tim Holloway wrote:. . . . Mostly before VB became popular, computers were too hard to use, so I won't address what preceded that. The original BASIC wasn't really seen outside computer labs.

It was quite popular nearly fifty years ago, when I was doing timesharing.

Q.E.D. You probably didn't have a terminal balanced on your laundry basket at home, but more likely had to go to a specialized room containing terminals.

Campbell Ritchie wrote:Presumably because C/C++ can access low‑level system resources so much more readily.

No, actually, just because that's the preferred platform for the toolchain. Pretty much anything you can do in C/C++ can be done in Python these days, although native-code compiling for "bare metal" stuff might be problematic. That's why I was using Python to screw around with the serial ports earlier.

The platform in question for my other project is an Arduino, which is why C++. However one of the most popular Arduino-like devices - the ESP8266 - comes pre-loaded ready to run Lua. Since I know C++ a lot better than I know Lua, I use it instead.
 
Campbell Ritchie
Marshal
Posts: 75620
354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Holloway wrote:. . . instead of doing "useful" work, it makes it possible for the apps that do do useful work to run . . .

Setting up resources for other programs. Not like driving from A to B. More like building a road from A to B.

Q.E.D. You probably didn't have a terminal balanced on your laundry basket at home, but more likely had to go to a specialized room containing terminals. . . .

There was only one terminal, a TTY, with a dirty great box of fanfold paper and keys with CR=Campbell Ritchie and LF=LineFeed on, to move to a new line.
 
Have you no shame? Have you no decency? Have you no tiny ad?
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic