Channels ▼

Community Voices

Dr. Dobb's Bloggers

Dwindling CS enrollments

September 10, 2008

I keep finding articles that report enrollment numbers in college computer science departments continue to dwindle. A dominant reason suggested is the perception that programming is hard, boring, and no fun. One of those articles reported ...

Tucker Balch, an associate professor at Georgia Tech, told the AP that the [school's Robotics course] is an attempt to combat "prime number" syndrome. That disease, he said, afflicts computer science departments that typically ask newcomers to write dull programs performing mathematical algorithms.

Other programs use drag-and-drop, GUI driven, multi-media rich, programming environments to stimulate interest.

The former approach requires the purchase of (and its labs are constrained by) robotics hardware. The latter requires installing a development environment like Alice or Scratch.

Instead - I suggest that games and puzzles are an excellent vehicle for stimulating interest and practicing programming. Consider Mastermind - the simple code-breaking board game. What do you think about the following series of labs? Does this pilgrimage address the "boring and no fun" rap on the study of programming? Does this pilgrimage make the Mastermind domain doable in an introductory course?

  1. prompt, receive input, report input
  2. in a loop: prompt, receive input in 4 scalar variables, report input
  3. replace 4 scalar variables with one array of 4 elements
  4. convert 4 integer inputs to 1 string input, validate input, tokenize input
  5. add hard-wired answer array and compute "totally correct" response
  6. populate answer array with random values
  7. compute "partially correct" response

Other games and puzzles that could contribute to this approach are: Cracker Barrel peg game, fifteen puzzle, Set card game, alphametics puzzles, Sudoku, Wheel of Fortune, jumble word puzzles ...

Additionally - I propose an earlier emphasis on the concepts of algorithm and data structure. Are we otherwise guilty of low expectations? I'm not talking about: lists, trees, graphs, search, sort, O-notation. I'm thinking about a lunch-bucket worldview that: life-on-the-job is a daily pilgrimage to craft algorithms and data structures. The indirection and leverage of using arrays to access arrays is not a traditional data structures topic, but it is life in the real world. Using a map of pointers-to-function (or the dynamic binding of a virtual function hierarchy) to replace an ungainly "case" statement is an act of obstinate elegance.

In the Mastermind example, suggesting that the computation of the "totally correct" response is an algorithm, may seem trivial; but for the beginner - it is an act of algorithm. Computing the "partially correct" response may seem too advanced for the beginner; but I propose that it is an invaluable challenge. Someone once suggested, "If you can only think of one way to solve a problem - you don't truly understand the problem." For the "partially correct" algorithm, I created a "brute force" solution; and then upon further reflection, I created an "elegant" solution whose correctness is demonstrably easier to argue.

In the Cracker Barrel peg game: how should jump requests be validated and implemented? Is it algorithm or data structure? Does this strategy to emphasize "a higher moral order" in a first semester programming course address the "boring and no fun" rap on the study of programming?

A totally miscellaneous quote ...

There are lots of applications in service where the most sophisticated algorithm is bubble sort, and the most sophisticated data structure is linked list. [Scott Meyers]

Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.