[Edu-sig] Beginner programs?

Michal Wallace sabren@manifestation.com
Wed, 7 Feb 2001 13:05:45 -0500 (EST)


On Wed, 7 Feb 2001, Ryan Booz wrote:

> Second, I am opening myself up and asking for thoughts on the simple
> calculator program I wrote.  I'll include the code below, and would like
> to get any comments you have to offer.  If I'm going to use it as an
> example, I want to make sure it's a decent one.

One thought.. Perhaps when you introduce OOP, you could rewrite this
as a subclass of the class in the cmd module. It would simplify your
code quite a bit, I think... You'd be able to do stuff like:

calc> 5
5
calc> add 5
10
calc> sub 2
8
calc> help
==============================
commands:
==============================
add       sub     mul     div
calc> help add
...


Cheers,

- Michal
------------------------------------------------------------------------
www.manifestation.com  www.sabren.net  www.linkwatcher.com  www.zike.net
------------------------------------------------------------------------