Problem solving

    Cards (44)

    • Programming is not about languages, the language ultimately doesn't matter that much
    • Programming is not about memorizing syntax
    • Programming is not primarily about math
    • Programming languages are simpler than human languages
    • Programming is not primarily about typing fast
    • There are about 7-8 core concepts that are universal across programming languages
    • When learning to program, it's better to focus on teaching the core concepts rather than just teaching code
    • There are about seven or eight key concepts that are universal across programming languages for a beginner to learn
    • Your first programming language is hard, your second is harder, but by your third or fourth you start seeing the similarities across languages
    • Coding is really about teaching algorithms and data, not just teaching a specific programming language
    • The secret to teaching beginners is to focus on the concepts first, and then convert to code later
    • Beginners often try to jump straight to coding without understanding the underlying algorithms and problem they are trying to solve
    • Comments
      Not to explain the code to programmers, but to explain the code to the computer
    • Writing an algorithm
      1. Write it in English first
      2. Ensure it answers key questions like variable name, type, and initial value
      3. Then convert to code
    • Variables
      • A place in memory to hold data
      • Need to know the name, type, and initial value
    • Output
      Printing a message to the user, usually text
    • Input
      • Requires a question to be asked of the user
      • Requires a variable to store the user's answer
    • Focusing on the algorithm and concepts first is more important than worrying about the specific syntax of a programming language
    • When analysing markets, a range of assumptions are made about the rationality of economic agents involved in the transactions
    • The Wealth of Nations was written
      1776
    • Rational
      (in classical economic theory) economic agents are able to consider the outcome of their choices and recognise the net benefits of each one
    • Producers act rationally by

      Selling goods/services in a way that maximises their profits
    • Workers act rationally by

      Balancing welfare at work with consideration of both pay and benefits
    • Governments act rationally by

      Placing the interests of the people they serve first in order to maximise their welfare
    • Groups assumed to act rationally
      • Consumers
      • Producers
      • Workers
      • Governments
    • Rationality in classical economic theory is a flawed assumption as people usually don't act rationally
    • If you add up marginal utility for each unit you get total utility
    • Operator overloading is a form of polymorphism and it's actually concatenated rather than adding because it's automatically detecting that these are strings and not integers
    • When you're around beginners, saying that operator overloading is a form of polymorphism and it's actually concatenated rather than adding is the worst thing we can say because they'll feel stupid
    • The plus sign is so smart that it does different things when it sees text and when it sees numbers and apparently it thinks that five and three is text
    • There is a way to find out what type of data something is using the type function
    • As we encounter a problem, we develop a new algorithmic tool to solve it
    • It's hard to get people to throw away code that they spent hours writing, even if it's wrong
    • When writing code, it's often easier to see the order of things on a whiteboard before writing the code
    • For loops have a century, a start, a finish, and a change
    • While loops only have one parameter, which is the condition, but you still need to think about the century, how it starts, how it ends, and how it changes
    • Boolean variables are the cleanest variable type because there's not a lot that can go wrong with them
    • The break statement is where you exit a loop
    • Game code gets messier because we don't design it for maintenance, we design it to be fast
    • C is the old school way of programming, with pointers everywhere and no strings
    See similar decks