Evan Martin (evan) wrote in evan_tech,
Evan Martin
evan
evan_tech

  • 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.
Subscribe

  • dremel

    They published a paper on Dremel, my favorite previously-unpublished tool from the Google toolchest. Greg Linden discusses it: "[...] it is capable…

  • socks5 proxying flash via ssh

    Suppose you're in Germany and want to watch some Flash-based videos that are IP-limited to the US for whatever reason. At first you'd think you could…

  • more on synonyms

    Before Chrome, this is what I spent much of my Google career working on.

  • Post a new comment

    Error

    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