Are the first programming courses in the Computer Science major supposed to be hard?

TomServo
Wed, 23 Nov 2011 03:35:44 +0000

It could be a weeder. It could be you just weren’t prepared for the class. At my school you take an intro class in standard C++ (or Java) before moving onto a three-quarter sequence on component-based software design in their own proprietary variant of C++, which incorporates design-by-contract, a mathematical modeling language to describe what functions and data types are/do. It’s definitely a weeder, while the first intro course was just to get your feet wet programming. Is this your first time getting your feet wet?

I think the biggest problem that holds people back in programming classes is lack of planning. Know what a piece of code is supposed to do, know what its “input” is, and know what its “output” is, and list the steps it is supposed to do all on paper. Actually writing the code should be the next-to-last thing you you (last would be typing it up and building, if you’ve done your job well there will be no debugging to do :-)). Don’t just dive in, design your algorithms on paper first.

One thing I do when designing anything with a loop is to actually write out instances of the loop, i.e. “the first iteration of the loop does x,y, and z, the second iteration does…” When I’ve written the first four or so instances of the loop, it’s clear what pattern is emerging and how to put it into code.