What Should the Standard Problem Contain?


Glad you asked. Here are a few of the things I like to discover in any new language:

  • How to print out a string. This is useful in terms of prompting the user for input, for example. As mentioned in the previous section, this is as far as you get with the Hello, world problem.

  • How to accept input from the user. You can start with simple strings, working your way up to formatted numbers. You can do an awful lot by just reading character strings, so that's a good place to start.

  • Simple algorithmic stuff. You should manipulate some data. You don't need to try anything fancy here, maybe just some simple assignment, arithmetic operations, and so on. This will expose whether you need to call in math libraries or not, and so on. It's not necessary to test your ship's rigging under storm conditions at sea, but you do have to get the boat out of the slip.

  • How to store data persistently. This is a big step up, because it asks that you write out a result and store it somewhere that survives the execution of the program. Ideally, you would like your sample problem to both read and write to the permanent store. Generally speaking, this exposes the language's interface to some sort of file system. Note that the file need be nothing more elaborate than a text file.

  • How to implement a "typical" data structure such as a linked list. Because these beasts come up over and over again in programming chores, it is good to have one in your sample problem so you can see how this trick works in the new language. Note that this option is just an extension of "Simple algorithmic stuff" discussed earlier.

  • How to do simple error handling. What do you do when user input or a data file is not what you expectwhen it's blank, corrupt, or just plain silly?

  • How to evaluate the abstraction and encapsulation capabilities. Will it be easy or hard to react to a change in requirements or problem definition?

I offer one big caveat here. What you are exploring are "programming in the small" features of the language. While these are important, they do not test the other very important "programming in the large" featuresthings like the capability to have public and private interfaces, interactions with other programmatic infrastructures, and, of course, graphics. In particular, much of the power of recent additions to our language arsenal comes from the richness of class libraries and the like; you won't have a chance to appreciate these until and unless you invest a lot more time exploring. Nonetheless, those things can be more easily investigated once the programming-in-the-small issues are better understood.




The Software Development Edge(c) Essays on Managing Successful Projects
The Software Development Edge(c) Essays on Managing Successful Projects
ISBN: N/A
EAN: N/A
Year: 2006
Pages: 269

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net