rcj@burl.UUCP (Curtis Jackson) (03/19/86)
Most computer science (or programming, if you prefer) students tend to leap before they look because they enjoy what they are doing. They don't stop to think about portability, memory vs. speed, user-interface modification, etc. So, put that in the specs for your students. Don't tell them to write you a golden mean sort -- tell them to write you a *portable* golden mean sort whose main emphasis is speed over memory usage. Tell them to write you an interpreter for pseudo-language FOOBAR (defined by you) that will be run on a machine with incredibly limited memory; give extra credit for innovative programs that reduce memory requirements. Also be sure to explain to them that these things will NOT be specified in the real world and that they will have to learn to ask these questions on their own. The easy way to accomplish that one is to assign the third assignment or so with no restrictions. Someone in the class is bound to ask, "Does this one have to be portable, run on a low-speed CPU, or what?" Compliment this wonderous being profusely and then divide the class into various sections with different operational parameters in implementing the same program. Compare the results and discuss them afterwards. <side note> One of the best courses that I had in writing sneaky efficient programs was an automata theory course in which we wrote Turing machine programs for a month. The instructor wanted programs that used a minimal alphabet, a minimal number of states, and were efficient. It taught me to think sneakily, but also did me another favor -- it taught me the value of *tools*. I wrote in one rainy afternoon a Turing machine emulator with which to simulate my Turing machine programs to see if they worked and to improve their efficiency. Talk about a help! It also got me in good with the prof; unbeknownst to me the current issue of Byte magazine that month had contained a feature on a Fortran Turing machine emulator (mine was in Pascal) -- he actually wanted me to clean it up and submit it to Byte since Fortran couldn't do dynamic memory allocation! Noting that if I were running Byte I sure wouldn't publish two Turing machine emulators two months in a row; I refused. ;-) -- The MAD Programmer -- 919-228-3313 (Cornet 291) alias: Curtis Jackson ...![ ihnp4 ulysses cbosgd allegra ]!burl!rcj ...![ ihnp4 cbosgd decvax watmath ]!clyde!rcj