The other programmer here is very concerned about dynamic typing though in Python. He feels like this
would be too much of a hinderance on us and too easy for us to make a mistake and not catch it until
runtime making debugging harder.
OK what are your guys thoughts here? How have you all overcome the lack of static typing? Is Python a
bad decision here? By the way we will be using Postgres in the back if that matters to anyone.
If Python is good for banks[1], insurance companies[2], guys that do big
booms[3] and other significant parties, why colleges are worry?
[1]. This month I heard that some bank in Spain decided to use Pyro
(Python Remote Objects).
[2]. I work in one of them.
[3]. Lawrence Livermoore National Laboratory. You know. These guys that
made the Bikini Islands disappeared.
Dynamic typing (with all other flexibility that Python offers) is a
wonderful thing. I'm really sick when I must write anything in
ObjectPascal.
--
Jarek Zgoda
Unregistered Linux User # -1
http://www.zgoda.biz/ JID:zg...@chrome.pl http://zgoda.jogger.pl/
NP: Metallica - Helpless
+ Python is a good decision. Fears about lack of static typing are
largely unwarranted. The following page has a number of useful links
to discussions of the merits of static vs. dynamic typing.
The point of 'interfaces' in Java is to support something like
dynamic typing. In Python, as with Java interfaces, you don't care
what an object *is*, only what it *does*.
Also, there are external programs (pychecker
(href="http://freshmeat.net/projects/pychecker") and pylint
(href="http://freshmeat.net/projects/pylint") that perform many of the
checks that you would get with a statically-typed language.
Finally, the standard Python distribution includes PyUnit for
developing unit tests, following the same principles as JUnit, et al.
If you create unit tests, you should be able to find run-time problems
pretty quickly. I'd recommend avoiding tests that make sure the
caller is passing the right "type" of object, though. If the test
crashes because the arguments can't *do* the thing the test requires,
either the test or the caller is wrong. Either way, you've found a
problem.
--dang
Cameron Laird <cla...@phaseit.net>
Business: http://www.Phaseit.net
<snip>
> Along with everything others have already written--that
> you want to focus on test-driven development, that Python
> is a proven success in Serious Applications, and so on--
> your description raises a few concerns in my mind:
> 1. Why, in your mind or your teammate's,
> is dynamic typing a "lack"? What, pre-
> cisely, is the benefit of static typing?
> There are a number of legitimate
> answers. It occurs to me that, without
> precision on which interest you, we
> might be missing an opportunity to
> clarify "The Python Way" significantly.
The typing errors that would not be found until runtime.
>2. Most application-level Python code
> doesn't--and shouldn't!--employ dynamic
> typing in any material way. Does that
> help?
>3. Postgres is good stuff. Its support for
> Python has improved quite a bit over the
> past few years.
>4. My instinct tells me that, yes, you can
> produce quality results quicker with Py-
> thon.
>5. In writing, "the GUI is clunky" about
> Java, what do you mean? Are you refer-
> ring to a particular IDE, or a specific
> GUI toolkit? Java has several of each;
> perhaps alternatives would suit you
> better.
Java's main gui. Swing it is slow.
>6. Are there alternatives to having the
> two of you write a "package" from
> scratch? A LOT of software for college
> administration has been written already;
> is none of it appropriate for your situ-
> ation?
$500,000 to get the level of a product that we need as a complete solution. There
are a lot of little programs that would meet individual needs, many of which we now
use but we need a complete integrated solution at this point. We are a Bible
college and do have some unique needs for our students also.
Cameron Laird <cla...@phaseit.net>
Business: http://www.Phaseit.net
Are you sure a Web application can't meet your requirements?
--
<snip>
> Along with everything others have already written--that
> you want to focus on test-driven development, that Python
> is a proven success in Serious Applications, and so on--
> your description raises a few concerns in my mind:
> 1. Why, in your mind or your teammate's,
> is dynamic typing a "lack"? What, pre-
> cisely, is the benefit of static typing?
> There are a number of legitimate
> answers. It occurs to me that, without
> precision on which interest you, we
> might be missing an opportunity to
> clarify "The Python Way" significantly.
The typing errors that would not be found until runtime.
[John Roth]
That's actually where TDD shines - since "run time" is
about 10 seconds after writing the code, the number
of type errors that creap through is going to be somewhere
between none and very few.
At least, that's the case if you're using TDD religiously.
(I couldn't resist the pun, and I'm not at all sorry. [grin])
[/jr]
John Roth
I've found pychecker to be very useful in catching those:
http://pychecker.sourceforge.net/
--
Robin Munn
rm...@pobox.com
One static typing advantage I've run into:
When you change the name of a variable in a class, and re-compile the
program, the compiler shows you ALL places where compilation fails.
These could be hundreds of places in dozens of files. In dynamically
typed language like Python, you have to rely on text search, which
often yields many false positives, especially for common/overloaded
names like .count, .name, .type, etc. In statically-typed languages,
making name changes is not very painful, since the compiler will tell
you where exactly you need to follow up with the changes. In
dynamically typed language, you will have to manually write unit test
codes to ensure name consistency.
I am sure Python people have come up with strategies to deal with this
problem. That's what I'd like to hear. (Unit test is one route.) But
this is one place where I've found statically-typed compilers useful.
I mean, I have seen this discussion many times, but most responses
from Python users have not been realistic (often simply shrugging off
the problem and saying something like "compilers don't detect all the
bugs, blah blah blah".) I would like to hear more real-life experience
rather than academic conjectures.
regards,
Hung Jung
HJL> When you change the name of a variable in a class, and re-compile
HJL> the program, the compiler shows you ALL places where compilation
HJL> fails. These could be hundreds of places in dozens of files.
...
HJL> I am sure Python people have come up with strategies to deal with
HJL> this problem. That's what I'd like to hear. (Unit test is one
As others have pointed out, pychecker is good at catching these sorts of
problems.
HJL> I would like to hear more real-life experience rather than academic
HJL> conjectures.
I've used pychecker in real-life to detect these sorts of problems, in other
peoples' code no less, even though I have a (non-academic) position at
Northwestern University. ;-)
Skip
The OP said they would be using Test Driven Development. In TDD,
you write maybe a half dozen lines before running your test suite. If
it ran last time, and it didn't run this time, then you have maybe a
half dozen lines to check. Lots of people regard the 'undo' command
as a great debugger in this case.
Of course, if you write hundreds of lines before doing a compile,
then you will need all the help you can get.
John Roth
>
> regards,
>
> Hung Jung
That sounds like exactly the sort of problem that the Bicycle Repair Man
project (http://sourceforge.net/projects/bicyclerepair/) is intended to
solve. It's a refactoring browser for Python code.
Caveat: I've not actually used Bicycle Repair Man myself, so I don't
know if there are any hidden gotchas. But I've heard very good things
about it from other people.
The name "Bicycle Repair Man", BTW, is a reference to a Monty Python
skit involving a superhero whose special power was repairing bicycles.
--
Robin Munn
rm...@pobox.com