Thanks for the excellent suggestions.
Generator is certainly an interesting subject.
From what i understand, the advantage of generator is mainly about saving
memory, right? (i.e. no need to create a list in memory before iterate thru
Duck typing... Although it can be easily demonstrated, I find it hard to
explain its advantages to Java developers who are so used to Interfaces. (Is
it about the certainty of type info... I am not sure about their concern
Jython is not a possibility, but I will show them an example anyway. We can
use it to write some support script, I suppose.
(Off topic) Monkey patching - It is a term used by Ruby developer a lot. If
it means to change a function's implementation in run-time, i think python
can achieve the same, right? Is it equivalent to Mixin?
On Tue, Jul 12, 2011 at 2:00 AM, Thomas Jollans wrote:
On 07/11/2011 05:07 PM, Anthony Kong wrote:
Lately I am giving some presentations to my colleagues about the python
language. A new internal project is coming up which will require the use
One of the goals of the presentations, as told by the 'sponsor' of the
presentation, is to help the existing Java/Excel VBA programming team to
become productive in python asap.
I have a feeling that they are asking it based on their Java/Eclipse
experience. By productive they are actually looking for some GUI tools
that are as helpful as Eclipse.
Having done Java programming before, I am thinking of answering the
question this way:
1) For many of us, vi/emacs are sufficient for python development. (I
used vim + ctags as my primary IDE for a very long time)
2) For a feature-rich GUI environment, we can consider pyCharm. (I was
totally 'wowed' by it, and has convinced my last employer to purchased a
few enterprise licenses)
3) The Python language itself is actually small and concise. The need
for a full-blown IDE is less. The language itself could be counted as a
part of the productive tool.
If your colleagues are used to Eclipse, it's almost certainly best to
continue using Eclipse, with PyDev. Don't make a big deal of the tools,
just say that many Pythonista don't use a heavy IDE, mention PyDev, and,
if you want to, recommend pyCharm.
4) The functional aspect of the language (e.g. map, reduce, partial)
helps to make program shorter and easier to understand
Don't overemphasize this. Those functions can be very useful, and using
them can lead to very concise and simple code, but (big BUT) more often
than not, they're overly cryptic when compared to list comprehension and
Do make a huge case for generator expressions/list comprehension, and
5) The 'battery included' standard library helps to avoid the need of
complicated build tool.
6) The interactive shell helps to test out solutions in smaller units.
Speaking of testing: introduce them to the doctest module.
It is probably not the team is expecting. Do you have more to add? What
do you think about this 'answer'?
If using Jython is an option, present it! Jython will allow Java
programmers to use their existing knowledge of the Java standard library.
Explain, and make the case for, duck typing.
While actual functional programming is, as I said, a bit "out there"
from a Java/VBA standpoint, do show off function objects.
If you know what they're going to do with Python, you should point them
to relevant libraries/modules.
Don?t EVER make the mistake that you can design something better than what
you get from ruthless massively parallel trial-and-error with a feedback
cycle. That?s giving your intelligence *much* too much credit.
- Linus Torvalds