Re: Where to put user interface

From: Karl Heinz Buchegger (kbuchegg_at_gascad.at)
Date: 12/12/03


Date: Fri, 12 Dec 2003 14:19:21 +0100

Gary Labowitz wrote:
>
> I've been seeing more and more students putting cout/cin statements in
> constructors to get the data needed to build an object. This is even though
> I have told them that the I/O should be done in the application and then
> used to create an object initialized with the arguments from the I/O.
> It's falling on deaf ears.
> Is it so natural to think of constructing an object by asking for the
> information?
> Thoughts on this design?

No doubt that this is bad design. But where should
the students get this information from? They have
no experience.
So give them an example and let them do it their way.
But then: create a second assignment where they have
to reuse the already created class. But this time make
sure that the reading in the ctor gets in their way
(eg. let them read from a file, but insist that the
reading is done in a seperate function ). They will have to
change the class for doing this. Now go back to
assignment one and ask what changes need to be done
in order to make the same class usable in both assignments.

This way they will actually see, what disadvantage it brings,
if the ctor does the reading.

-- 
Karl Heinz Buchegger
kbuchegg@gascad.at


Relevant Pages

  • No Child Left Behind - the good and the bad.Economy
    ... Among 4th-grade students the ... average scores of black youngsters bumped up two points in reading and four ... By holding schools to account ... the law has captured the attention of educators nationwide. ...
    (soc.culture.african.american)
  • Re: Propper Englesh
    ... For bonus points, spot my crappy comma usage :-) Damn, I hate reading ... kids who are average or better don't get stretched. ... And of that 8% - the 8% brightest students from the richest, biggest, ... their fault because their teachers are often illiterate. ...
    (uk.people.support.depression)
  • Re: Any English teachers here?
    ... I am an English teacher. ... students they should avoid negative comments. ... I have very few rules when I teach writing classes. ... lofty reading list) would be appropriate for college. ...
    (rec.music.artists.springsteen)
  • Re: FoxTrot 8/10
    ... --some of whom were already reading and some who were not ... makes learning the several hundred thousand words much easier. ... Students begin by learning how our alphabetic ... They learn the sound ...
    (rec.arts.comics.strips)
  • Re: [OT] Conjectures? on the "constant pointer on Turbo C programming" junk
    ... > post a question on C programming on the group comp.lang.c thru ... > Technology, department, name and 6-digit student number. ... > university with some students using the universitie's computers. ... It seems to me that the kids presumably have an assignment to post to Usenet. ...
    (comp.lang.c)