Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> but the Python API isn't all that wonderful, and dynamic typing means that I spend too much time debugging

I don't know, this just seems more like inertia. "I'd rather stick to what I know best than this popular thing." Which is fine, and I'm glad Java has made improvements making it easier to hit the ground running. But blaming the use of Java on the inadequacies of Python? The python API can do just about anything, it has regex toolings, I've never found myself needing anything else. And the typing complaints? Yeah it can be annoying if you're not good at keeping track of your own typing hints, but modern python supports type annotations and linters like mypy[1] catch everything related to that just fine. I've always admired many of Java's features, but let's not act like the reason for using Java for scripting is the pitfalls of Python. It's just because of an underlying preference for Java.

1. https://mypy-lang.org/



> Yeah it can be annoying if you're not good at keeping track of your own typing hints

If you write all the code you deal with, then sure. My experiences on big projects tend to be typing problems introduced by libraries. The kind where documentation and the decorators suggest it'll only ever return some specific value type, but then very occasionally it'll return a tuple of that value type and a message.


Fair, but in the context of scripting, which seems to be the focus of this article, how often are you dealing with complex library code? When I write scripts for file manipulation / simple automation, I'm usually not dealing with complex library objects. Plenty of os method calls, plenty of regex matches, but little else in this context. Big projects are another thing entirely. There's a plethora of reasons why you may want to use a different language for a certain project type. But it doesn't seem fair to imply that python is uniquely handicapped (or otherwise inferior to Java) for scripting and simple automation use-cases.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: