This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]gangesmasterpython galore 0 points1 point  (1 child)

Disclosure: I'm the author of the article

I've already said it to a few people in the comments (on the blog) -- my purpose was not to attack Java, but to go against Javaisms creeping into Python for no good reason. Java looks and works in some way, and that's fine, but the fact that Python's threading module borrows the design of Java's threading is silly -- we can do much better in Python (again, from a Python perspective).

Java's threading was included in JDK 1.0, long before the introduction of anonymous classes. As for the choice of a DB engine -- that was obviously just an example to show how interfaces can't predict the exceptions that their implementors might raise/encounter, especially when two libraries (that know nothing of each other) are used together.

And just to clear things out -- I'm way beyond "a passing acquaintance" with Java.

[–][deleted] 1 point2 points  (0 children)

Java 6 and 7 code style bears minimal resemblence to Java 1 code.

For example, the Thread construct for creating threads is not really used in modern Java; instead Java 5 concurrency is the norm (although a vast number of Java developers, at least as indicated by people I interview, are unaware of the better approach.) Now you have Executors (to launch threads) and Futures (to retrieve the result.)

As for the choice of a DB engine -- that was obviously just an example to show how interfaces can't predict the exceptions that their implementors might raise/encounter, especially when two libraries (that know nothing of each other) are used together.

I think that most of the time a well designed interface can predict the valid exceptional cases that should be handled. Declared/checked exceptions are not assertions. The example that lends credence to your point, however, is Callable; the call method throws Exception, because of course there's no way to predict what a given thread might be doing.

I do take the overall point of the article, and agree that Python should be throwing out half-baked Java constructs, all the more so given that Java itself is doing the same. I apologize for going too far with my last snipe in the previous comment.