4 ms·
I was an ECE major at CMU. C0 basically served as an introduction to C, with contract annotations. The contract annotations were used to enforce more thinking
by murph-almighty 9y ago
I was an ECE major at CMU.
C0 basically served as an introduction to C, with contract annotations. The contract annotations were used to enforce more thinking about your code (i.e. proving your code worked via pre/post/loop conditions). There were still pointers, there was just a bit of syntactic sugar surrounding it.
About 2/3's through the course we switched to full-blown C, at which point we had to learn pointers. The intro to computer systems course (think malloc, proxy, and buffer overflow labs) used C as well, and that in turn required us to use pointers. There's no "losing out" on learning pointers. It's basically a step-stool to C.
At the time, I had a pretty good grasp of pointers and thought C0 was a bit silly- I'd never used contracts in my life. I currently work as a full-stack web developer (bit of a twist from my intended path) and I've never seen anyone "write out contracts" like I did in C0. I now think it was a valuable exercise in that it forces you to define the parameters that allow your code to run.
- bwasti 9y agothe CS department also offers a compiler class that has you write a compiler for C0: https://www.cs.cmu.edu/~fp/courses/15411-f13/resources.html https://www.cs.cmu.edu/~fp/courses/15411-f13/resources.html