2004-10-16 · in Tech Notes · 176 words

Here are some of the things that first-time occam programmers in the CO516 classes I taught in 2004 found confusing.

Week 2: bugs.occ

The IF syntax; most of them tried "IF condition".

Variable declarations before the blocks that use them (figuring out where to add a SEQ).

Indenting (and "outdenting") large blocks of code; they found it frustrating until shown how to get VIM to do it automatically.

Warnings from the compiler about unused top-level channels.

Lack of implicit SEQ. (They all understood this when it was explained, but a couple of them rolled their eyes...)

Types in PROC arguments applying to multiple parameters.

CSCS

(Thanks to Matt Jadud for these.)

Colons at ends of PROCs.

The intersection of PAR and SEQ. For example, being able to recognize that

PAR
  processA
  processB
  PAR
    processC
    processD

is equivalent to

PAR
  processA
  processB
  processC
  processD

and that

PAR
  processA 
  processB
  SEQ
    processC
    processD

means that you have three "threads" of control, and in the third, two things are happening in sequence in parallel with the first two threads.