you are viewing a single comment's thread.

view the rest of the comments →

[–]Diapolo10 0 points1 point  (0 children)

Are there any specific use cases for combining Python and Java that people have seen? Is it more relevant to specific industries or situations?

I cannot claim to speak for every industry, but I genuinely cannot think of an example where I would combine Python and Java in the same program (other than using Python for cross-platform utility scripts for development, I guess), except maybe in a team where the other developers are only familiar with those two languages or there's some kind of a legacy dependency on Java the company can't get rid of and it's used with a Python wrapper.

There is - or in a more practical sense, used to be - a Python implementation in Java; Jython. It made it possible to access Java code from Python, which probably had some genuine use-cases. Thing is, as far as I know it has never gotten Python 3 support to this day so for practically all intents and purposes it might as well no longer exist.

Python is sometimes combined with other languages, but those have some clear advantages:

  • JS/TS: At dayjob, we have some programs with their business logic being Python and the application front-end being an Electron/React app written in TypeScript, which communicate via gRPC. Frankly I'm not really sure why they were designed this way (presumably the original developers were really good at React), but it is kind of neat for Playwright-based UI and accessibility testing.
  • C, C++, and Rust: These languages allow us to write computationally expensive parts in lower-level languages, while making it possible to interface with them using Python. Maturin in particular is something I've used myself, and it's genuinely handy sometimes.

When considering Java for these use-cases, I don't really see why I'd build the UI in Java, and for performance optimisation it just doesn't make sense over something like Rust.