FS25 “What I wish someone taught me 10 years ago”

Ven Popov

Introduction to programming and scientific computing

What is computation? Why care about it?

Fundamentals of programming for scientific computing

  • scientists are not programmers and have their own training requirements
  • typically haphazard training in the social sciences, statistics and related fields
  • online tutorials focus on specific technologies and languages
  • need for training of core concepts, practices and skills
  • not a computer science degree, not an in-depth math education, nor a mastery of a particular language
  • a mixture of all, focused on doing with understanding
  • exposure to most important concepts, even advanced ones
  • a blueprint so that you now what you need to know long-term

Doing with understanding

  • courses focused entirely on practice risk missing the big picture and transferable skills
  • courses focused entirely on theory risk disconnectedness
  • build a robust mental model of computation and software engineering

Why R?

  • a.k.a. why not Python, JavaScript, Julia, C or whatever
  • practicality
  • focus is on transferable concept and skills

Early wins

  • get to make/do something exciting right away
  • incrementally work towards a final project
  • optional paths

Brief introductions

  • Name?
  • Why are you taking this class?
  • What previous programming / mathematical experience do you have?

What is computation? Some background

  • Computation vs programming
  • First computer
    • A lock
    • Humans
  • Turing machines
    • Turing complete
    • Game of life
  • Low-level languages
    • Machine code
    • Punch cards
    • Assembly language
  • High-level languages
    • Compiling vs interpreting

Abstractions

  • expressing intent vs implementation
  • data structures
  • algorithms
  • core concepts
    • variables
    • functions
    • scope

Class structure

for (week in 1:14) {

  if (week %% 2 == 1) {
    type = "Lecture"
  } else {
    type = "Practice"
  }

  cat("Week ", week, ": ", type, "\n", sep = "")
}
Week 1: Lecture
Week 2: Practice
Week 3: Lecture
Week 4: Practice
Week 5: Lecture
Week 6: Practice
Week 7: Lecture
Week 8: Practice
Week 9: Lecture
Week 10: Practice
Week 11: Lecture
Week 12: Practice
Week 13: Lecture
Week 14: Practice

Outlook: Rough list of topics to cover

  • basic programming concepts
    • data structures
    • control statements - if, while, loops
    • functions
    • objects
    • scope
    • algorithms
    • randomness, seeds, distributions
    • tips & tricks
    • problem-solving
  • filesystem, project organization & command line tools
  • version control & collaboration
  • dependency/environment management & cluster/cloud computing
  • profiling, optimization and debugging
  • testing, documentation & reporting
  • (maybe: useful math refresher)

Learning resources

Learning resources