Eh, I'll throw in my $0.03.
I'm in education circles, and the vast majority of "how do I clear the screen" questions
are little Johnnys'. You have to give lil'J credit -- he's trying to go above and beyond the assignment to make his program look neat.
Those others who actually want to make videogames and the like ask things like: how do I change colors, move the cursor, make the cursor invisible, get input one key at a time, and even "make a video game", and are quickly led to things like <conio.h> (ack!) and NCurses and the Windows Console API.
The standard I/O streams are streams like any other file... you can read and write them and apply fancy formatting to them. Handling I/O is a very important part of writing
any program. The problem is, of course, how we perceive the standard streams as somehow 'different' than other streams.
Knowing how to use formatting functions on streams is a worthwhile goal -- a very important one -- and should not be minimalized because
cin is the principal exemplar of such streams. Remember,
cin and
cout (and
cerr, of course) are analogous to C's
scanf() and
printf() -- the C++
std::
iostreams do
formatted I/O.
Why is handling the standard streams such an important concept? Much of it has to do with the history of the Unix operating system(s) and its revolutionary way of handling I/O: every program gets access to
predefined and
already opened I/O streams, which default to the user's terminal (tty) but can be
redirected to any file or device. This is
power! Programs instantly became simpler, portable, and retargetable. This kind of flexibility was quickly recognized and almost every other OS scrambled to update -- and new OSs had it in the protodesign -- to use this paradigm.
Of course, when you really
do want to control the console (games, TUI text editors, etc), that becomes another consideration. Which leads me to the underlying question in this discussion (as I see it, of course) that
helios touched on.
What? You want UI design too? |
The idea that UI design is hard is an entrenched one, but false. The problem is that programmers are only taught how to make things happen, but I've never even heard of a class to consider the hows and whys of User Interface design. (Run away! Run away!)
If you are braver than King Arthur (or if you've never seen Monty Python -- shame), the difference is simple:
programmer - program does X, Y, and Z with algorithms A, B, and C.
user - program does Q when I press button N.
LOL. Yes, I'm talking about the same program.
Users don't see or understand the internal workings of your program. All they know is, given what they are looking at (your application's window or console prompt), what do they
expect to happen when they do N?
You, as the
programmer have only to to learn to correlate the user's expectations with the functional aspects of your program.
Granted, this
does take a little getting used to, but it is
not difficult. It only takes a little help and imagination. Look here at the
Wikipedia.
http://en.wikipedia.org/wiki/User_interface_design#Processes
Notice how much attention is given to the
user's point of view:
User interface design requires a good understanding of user needs. |
Which is just a simple way of saying -- What does the user think my program will do? How does the user expect to interact with my program? And does my program do what the user wants it to do?
Don't take
my word for it. (Thanks Levar Burton!)
Controlling Your Environment Makes You Happy by Joel Spolsky
http://www.joelonsoftware.com/uibook/chapters/fog0000000057.html
Effective User Interface Design by Ray Konopka
Foo. I've spent a good while looking for this online. Apparently he now offers this knowlege as a product and I can't find a link to his original paper. Alas. If you want it, PM me and I'll email you a copy.)
The Art of Unix Usability
Chapter 2. History: A Brief History of User Interfaces by Eric Raymond
http://www.catb.org/~esr/writings/taouu/html/ch02.html
First Principles of Interaction Design by Bruce Tognazzini
(This is a detailed recap of the points made in the Wikipedia article)
http://www.asktog.com/basics/firstPrinciples.html
User Interface Hall Of Shame (with links to the
Hall of Fame)
http://homepage.mac.com/bradster/iarchitect/shame.htm
Here are some good links for more reading
http://www.ambysoft.com/essays/userInterfaceDesign.html
http://www.sylvantech.com/~talin/projects/ui_design.html
http://www.ibm.com/developerworks/library/us-myth.html
And here's a little humor for those who got this far:
http://toastytech.com/guis/uirant.html
Whew. That's all I've got. (For now...) ;-]