Newsgroups: comp.edu,comp.lang.ada,comp.lang.c++,comp.lang.modula2,comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!europa.chnt.gtegsc.com!howland.reston.ans.net!news.moneng.mei.com!uwm.edu!reuter.cse.ogi.edu!netnews.nwnet.net!news.u.washington.edu!uw-beaver!pattis
From: pattis@cs.washington.edu (Richard Pattis)
Subject: Re: Comparison of languages for CS1 and CS2
Sender: news@beaver.cs.washington.edu (System PRIVILEGED Account)
Organization: Computer Science & Engineering, U. of Washington, Seattle
Message-ID: <DBEnwD.6G9@beaver.cs.washington.edu>
References: <3te71s$nig@theopolis.orl.mmc.com> <dewar.804964120@gnat> <3tkr7u$2bh@felix.seas.gwu.edu>
X-Nntp-Posting-Host: june.cs.washington.edu
Date: Sat, 8 Jul 1995 16:17:01 GMT
Lines: 23
Xref: glinda.oz.cs.cmu.edu comp.edu:13120 comp.lang.ada:32298 comp.lang.c++:137321 comp.lang.modula2:11928 comp.lang.scheme:13030

Mike and Robert

I always supplied my students with a package full of Fmt functions that
returned the STRING representations of various built-in types, and included
parameters specifying formating information (with useful defaults). It seemed
to be the best of both worlds: If X = 5, Fmt(X) = "5"; Fmt(X,2) = " 5";
Fmt(X,2,'0')= "05" (good for clocks), Fmt(X,2,' ',Left) = "5 ".

Also, once you go that far, you can have functions that return INTEGER values
as Roman Numerals, English text, etc.; e.g., "CCCXIV" and "Three Hundred and
Fourteen" which are useful in some contexts, and emphasize that how a value is
represented (the bits) is decoupled from how it is printed (the characters).

Such a presentation motivated returning STRING equivalents for any user-defined
types that students declare.


Rich
-- 
  Richard E. Pattis                  "When debugging, a novice programmer
  Looking for a Job		      inserts corrective code; an
			              experienced programmer removes
			              defective code." 
