Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

dynamic typing question

0 views
Skip to first unread message

Jason Tesser

unread,
Dec 19, 2003, 9:28:58 AM12/19/03
to Python List (E-mail)
I work for at a college where I am one of 2 full-time developers and we are looking to program a new
software package fro the campus. This is a huge project as it will include everything from registration to
business office. We are considering useing Java or Python. I for one don't like Java because I feel the
GUI is clunky. I also think that we could produce quality programs faster in Python.

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.

Jarek Zgoda

unread,
Dec 19, 2003, 5:20:39 PM12/19/03
to
Jason Tesser <JTe...@nbbc.edu> pisze:

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

Stephen Ferg

unread,
Dec 21, 2003, 9:58:49 PM12/21/03
to
> How have you all overcome the lack of static typing? Is Python a bad decision here?

+ 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.

http://www.ferg.org/projects/python_java_side-by-side.html

Dang Griffith

unread,
Dec 22, 2003, 8:23:55 AM12/22/03
to
On Fri, 19 Dec 2003 08:28:58 -0600, "Jason Tesser" <JTe...@nbbc.edu>
wrote:

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

Dang Griffith

unread,
Dec 22, 2003, 8:26:33 AM12/22/03
to
On Mon, 22 Dec 2003 13:23:55 GMT, Dang Griffith
<noe...@noemail4u.com> wrote:
<snip>

> Finally, the standard Python distribution includes PyUnit for
>developing unit tests, following the same principles as JUnit, et al.
<snip>
The module is called unittest, though, not PyUnit.
--dang

Cameron Laird

unread,
Dec 26, 2003, 10:04:05 AM12/26/03
to
In article <mailman.355.1071850...@python.org>,

Jason Tesser <JTe...@nbbc.edu> wrote:
>I work for at a college where I am one of 2 full-time developers and we
>are looking to program a new
>software package fro the campus. This is a huge project as it will
>include everything from registration to
>business office. We are considering useing Java or Python. I for one
>don't like Java because I feel the
>GUI is clunky. I also think that we could produce quality programs
>faster in Python.
.
.

.
>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.
>
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.
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.
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?
--

Cameron Laird <cla...@phaseit.net>
Business: http://www.Phaseit.net

Jason Tesser

unread,
Dec 26, 2003, 10:16:13 AM12/26/03
to cla...@phaseit.net, pytho...@python.org
Hi,

<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.

--
http://mail.python.org/mailman/listinfo/python-list

Cameron Laird

unread,
Dec 26, 2003, 12:11:58 PM12/26/03
to
In article <mailman.119.1072457...@python.org>,
Jason Tesser <JTe...@nbbc.edu> wrote:
.
.

.
>>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.
.
.
.
Slow in development or deployment? Is there a chance SWT
would serve you better?

Are you sure a Web application can't meet your requirements?
--

Cameron Laird

unread,
Dec 26, 2003, 12:15:54 PM12/26/03
to
In article <mailman.119.1072457...@python.org>,
Jason Tesser <JTe...@nbbc.edu> wrote:
.
.
.
>>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.
.
.
.
One role Python fulfills well is "glue" that links
together existing programmatic resources. Inte-
gration's a great thing. So is re-use of work
that already exists. I wonder if there's some
way for you to have both.
--

John Roth

unread,
Dec 26, 2003, 12:40:11 PM12/26/03
to

"Jason Tesser" <JTe...@nbbc.edu> wrote in message
news:mailman.119.1072457...@python.org...
Hi,

<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

Robin Munn

unread,
Dec 26, 2003, 2:49:24 PM12/26/03
to
Jason Tesser <JTe...@nbbc.edu> wrote:
> Hi,
>
><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.

I've found pychecker to be very useful in catching those:

http://pychecker.sourceforge.net/

--
Robin Munn
rm...@pobox.com

Hung Jung Lu

unread,
Dec 26, 2003, 3:27:29 PM12/26/03
to
cla...@lairds.com (Cameron Laird) wrote in message news:<vuojf5k...@corp.supernews.com>...

> 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.

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

Skip Montanaro

unread,
Dec 26, 2003, 3:38:25 PM12/26/03
to Hung Jung Lu, pytho...@python.org

HJL> One static typing advantage I've run into:

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

John Roth

unread,
Dec 26, 2003, 4:20:59 PM12/26/03
to

"Hung Jung Lu" <hungj...@yahoo.com> wrote in message
news:8ef9bea6.03122...@posting.google.com...

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


Robin Munn

unread,
Dec 26, 2003, 5:58:08 PM12/26/03
to

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

0 new messages