Evan Martin (evan) wrote in evan_tech,
Evan Martin

  • Mood:

i ought to be more careful

I got a really bad grade on my compilers assignment, and I was sorta disappointed because I really should’ve put more time into it. I was proud when I turned it in because I was pretty confident it mostly worked, but when I got it back I saw that it didn’t.

Just now I looked at it more carefully, wondering what I had wrong. Was it the harder stuff, like arrays of arrays or pass by reference? No, somehow I failed simple things like the “if-then-else” test! I investigated further and discovered that I had inverted the meanings of the literals “true” and “false” (apparently my test to verify they worked was something like if true or false, which has the same meaning when they’re inverted).

Many of their tests relied on those working. Stuff like the test of break (while (true) { okflag = 1; break; }) was not producing the expected result for reasons other than my (correctly working) break implementation.

And the arrays? They worked fine. 20% of my grade was lost due to the simple inversion of two very important characters.

  • your vcs sucks

    I've been hacking on some Haskell stuff lately that's all managed in darcs and it's reminded me of an observation I made over two years ago now (see…

  • jaunty upgrade

    Upgraded to Ubuntu Jaunty. X hung with garbage on the screen after rebooting. Booted into "restore mode" (I forget the exact name), it gave me a…

  • ubuntu summit

    There's an Ubuntu summit going on in Mountain View next week. I'll be there Monday and plan to meet up with someone who's interested in packaging…

  • Post a new comment


    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 1 comment