On Wed, Oct 30, 2013 at 1:00 PM, Buck Calabro <kc2hiz@xxxxxxxxx> wrote:
the learning mode of many of us RPG programmers was to dig
into the code and off we'd go.
OK, fair enough. That is a common learning mode regardless of
language. But Python comes up spades here too. There is an entire
searchable "cookbook" of recipes (of varying quality, just like
real-world RPG code!):
http://code.activestate.com/recipes/langs/python/
Almost all the recipes scratch someone's itch, and so tend to be
inherently useful rather than merely to demonstrate esoteric features.
Some of the highest-quality recipes have eventually been absorbed
into Python's standard library; others have grown into third-party
packages released into the community:
https://pypi.python.org/pypi
There is indeed much, much more learning material available for Python
than there ever was for RPG! The problem for DIYers is that we can't
readily tell which Python patterns to apply for which business problem.
That will come with experience, but that 'experience' has already been
baked into the existing RPG code base.
Hmm. I'm trying to decide whether this perception is colored by the
fact that you're experienced in RPG and a beginner in Python, so
things seem clearer in RPG. I know I keep saying Python is so easy to
learn, but perhaps my view is colored by the fact that I've already
learned (enough of) it.
One thing I think makes patterns easier to find in RPG is that, to be
quite blunt, RPG doesn't make it easy to do very many things. But why
should it? RPG is extremely DB2-for-i-oriented. Step too far away
from that, and you're in the weeds.
With Python (and many other less specialized languages), the language
itself is so expressive and so powerful that the language tends to
mold itself to the task at hand. (This is part of the reason why Lisp
and Ruby programmers wind up developing so many domain-specific
languages; it just happens during the natural course of solving their
problems.) With such languages, there is a lot more "open space" and
a lot fewer "well-worn paths".
But at least you can start with the recipes. If you want to see
uniformly high-quality code, the best place to look might be in
Python's standard library (found in the Lib subdirectory, so
C:\Python27\Lib in a typical Windows installation, for example).
John
As an Amazon Associate we earn from qualifying purchases.