Learn CS

On bugs

  • Humans have a tendency to blame their incompetence on something else. ‘The software I wrote has a bug; the computer is dumb!’.
  • If your software crashes unexpectedly, it was really because you didn’t handle it.

CS106B

  • Truth and beauty. Working software is not enough; well-designed and well-engineered code matters.
  • Everything in Java lives inside a class, whereas there are functions in C/C++ that don’t and hence allow you to do stuff in a more procedural way.
  • Function prototypes are a way of telling the compiler about something that’s coming up later.
  • <<: string insertion operator.
  • Integer division has truncation built into it.
  • Only two types of user-defined types in cpp: Enums and Records/Structs.
  • Default parameter passing is pass-by-value. Add & to declaration for pass-by-reference.