Improving my grade.


R. Clayton (rclayton@monmouth.edu)
Wed, 19 Jul 2000 11:01:58 -0400 (EDT)


  Can you tell me what I should do to improve my grade for the class.

Study and work, study and work. For most people - and certainly for all the
people in class, including me - the only way to really learn programming is to
write programs, and to keep writing programs. And for most people, the only
way to write good programs is to study and know the tools you're using (the
STL, in this class) and to study how other people write programs. But after
you've studied, you need to sit down and write programs.

  As you said, "I recommended you write three functions: the first reads the
  mailbox, the second finds the the message starts, and third finds the message
  ends." I did that in my first assignment. It extracted the header but
  didn't print out message right. And that is why I came to ask you for help
  last time but you told me not to do it my way and that's why I started this
  way, which gives me lots of errors.

My intention behind those suggestions was not so much that you should write
those particular subroutines, but that you should start thinking like a
programmer: how can I break this problem up into smaller problems such that
each smaller problem is easier to solve, and can be solved independently of the
other smaller problems.

What I was actually suggesting is that you solve your problem in the following
way:

 1 Start with an readmbox program that does nothing: int main(void) { }

 2 Add to your readmbox program a subroutine that reads the mailbox file and
   does nothing more. Once you have this minimal readmbox program written,
   stop and test it: what happens when you give readmbox a nonexistent file;
   what happens when you give readmbox an empty file; what happens when you
   give readmbox a really long filename.

   Again, the point is to develop your programmer's thinking skills: is my
   program working properly? How do I know it's working properly? What tests
   can I run to help determine that my program's working properly? What can go
   wrong with the data? If it does go wrong, does my program handle it
   properly?

 3 Once you've got your minimal readmbox program working - and only when you've
   got your minimal readmbox program working - add a new subroutine that, for
   example, finds the message starts. Then go back an retest your program both
   to insure the old code still works and to make sure the new code works too.

 4 Repeat step 3 until the program's finished.

This was the intention behind my suggestion; not that you just sit down and
write three subroutines. When I looked at your code, and when I looked at the
results of compiling your code, it is true I saw subroutines. But what I
didn't see was a clear purpose behind the subroutines; it seemed to me to be a
mish-mash of stuff, probably thrown together in one sitting and then tweaked
into submission. That is not good programming.

I'll admit that good programming is difficult to learn, and that it takes a lot
of work to carry out. I certainly don't expect you to become an expert
programmer in this class, but I do expect you to work as hard as you can to
become as expert a programmer as you can within the objectives of the class.



This archive was generated by hypermail 2.0b3 on Fri Aug 11 2000 - 15:25:05 EDT