Fri 27 Mar 2020

Python Is Not Java

I was recently looking at the source of a wxPython-based GUI application, about 45.5KLOC in size, not counting the libraries used (e.g. Twisted). The code was written by Java developers who are relatively new to Python, and it suffers from some performance issues (like a 30-second startup time). In examining the code, I found that they had done lots of things that make sense in Java, but which suck terribly in Python. Not because “Python is slower than Java”, but because there are easier ways to accomplish the same goals in Python, that wouldn’t even be possible in Java.

So, the sad thing is that these poor folks worked much, much harder than they needed to, in order to produce much more code than they needed to write, that then performs much more slowly than the equivalent idiomatic Python would.

Source: Python Is Not Java, an article by PJ Eby.

The Usefulness of Python’s Permutations and Combinations Functions

I’ve been writing a lot of Python recently. As a relative newcomer to the language, it continues to impress me with its versatility and “quality of life” features. I’m not surprised that it’s been gaining so much popularity among developers as of late.

Two such features I’ve discovered recently are the permutations and combinations functions of Python’s itertools module. The module is basically a set of convenience functions to produce iterators to suit various needs.

Source: The Usefulness of Python’s Permutations and Combinations Functions, an article by Kevin Dawe.

How long did it take you to learn Python?

Beginners seem to ask this question when they are feeling daunted by the challenge before them. Maybe they are hoping for a helpful answer, but it seems like most answers will just be a jumping off point for feeling bad about their own progress.

Everyone learns differently. They learn from different sources, at different paces. Suppose you ask this question and someone answers “one month”? Will you feel bad about yourself because you’ve been at it for six weeks? Suppose they say, “ten years”? Now what do you think?

Source: How long did it take you to learn Python?, an article by Ned Batchelder.