CS 200 - Programming I Jim Williams, PhD
Comp Sci 200 - Programming I Who Am I? What is Computer Science & Programming? Who is here? Large Course Overview Programming Process
Who Am I? My Interests: CS Education, specifically the teaching and learning of programming. PhD in Computer Science, minor in Educational Psychology Husband, Father, Coach, Traveller, ... http://pages.cs.wisc.edu/~jimw/
What is Computer Science? With a name like computer science, you might think it is all about the computer. Core principles: Abstractions and algorithms This course: Learning to give instructions to the computer. Read and Write Java
What is Computer Science? The study of the computer itself as well as how computers are applied to solve problems in any field. What is Programming? Designing algorithms and writing them in a language a computer can execute.
Why Study Computer Science? To understand our world To study and understand processes To be able to ask questions about influences To use a new form of literacy A new way to learn science and math Job skill Use computers better https://cs200-www.cs.wisc.edu/wp/why-study-computer-science/
Enjoyment and Satisfaction Lots of puzzles, problem solving and challenge Opportunity to create something from nothing Opportunity to apply to any field Many enjoy these aspects of Computer Science and find a lot of satisfaction when successful.
Key Concepts Sequence Choice Repetition Delegation Sharing information information may be an Address Testing/Verification
Programming aka Writing Code Java is a text language for controlling the computer. Programs are called "code" for a reason. Decode "convert (a coded message) into intelligible language." [Google Dictionary]
Learning Programming Learn fundamentals of the Java language Learn key concepts of controlling a computer that are independent of a language. In other words, learning other similar programming languages will be a bit easier.
Who is here?
Quality of Writing Is the quality of an author's writing directly related to how long it took to learn the language they are writing in? (I don't think so…) It takes people different amounts of time to learn a programming language, but once you achieve fluency, there doesn't seem to be much difference. John Anderson
When Women Stopped Coding http://www.npr.org/sections/money/2014/10/21/357629765/when-women-stopped-coding
Course Overview Large Course Learn how to learn programming Course Website https://pages.cs.wisc.edu/~cs200/
Society of Women Engineers Not just for women and not just for engineers; all students are welcome. We are especially looking for more computer science students! Emilie Wille
Today Course Logistics Learning Expectations: Understand vs Apply zyBooks Assignments Getting Help Lecture Notes Learning Expectations: Understand vs Apply Content: Programming Process Tracing & Explaining (Decoding) Edit-Compile-Run Cycle
Understand vs. Apply Steph Curry, NBA Golden State Warriors Basketball Analogy Demonstration vs. Practice Declarative Knowledge vs Procedural Knowledge Importance of Practice for learning If you watch the same video or even 10 different videos on how to shoot a basketball do you get better at shooting a basketball? Steph Curry, NBA Golden State Warriors
Learning Programming Lots of little steps that quickly build Not mastering little steps creates bigger steps Goes beyond Remembering and Understanding to Applying, Analyzing, Evaluating and Creating. Goal: Have basic fluency in Java and be able to solve small problems using it.
Tracing & Explaining Tracing Stepping through a program anticipating what each instruction does and the next instruction to execute (run). Keep track of what is happening in memory. Explaining In your own words, summarize what Java statements do.
CS200 View of Computer A view of the computer appropriate to understand programming with Java. This view of the computer gets more detailed as we go in the course.
CS200 View of Computer Processor Executes program one step at a time. Java statements say what to do. Memory holds data (and program itself) access through variables and references
Learning to Trace with Java Visualizer Java Visualizer available via our course website or: https://cscircles.cemc.uwaterloo.ca/java_visualize/ import java.util.Scanner; public class RectangleArea { public static void main(String [] args) { Scanner input = new Scanner(System.in); int height = 0; int width = 0; System.out.print("Enter height: "); height = input.nextInt(); System.out.print("Enter width: "); width = input.nextInt(); int area = height * width; System.out.println("A rectangle with height " + height + " and width " + width + " has an area of: " + area); input.close(); return; //optional at end of method, unless returning value }
Programming Process Users Files Programmer Editor (Virtual) Compiler Machine Compiler Hello.java Hello.class Computer Files Programmer
Programming Errors Naming/Saving Syntax/Compile time Runtime & Logic Editor (Virtual) Machine Compiler Hello.java Hello.class Computer Files Programmer
Programming Process Question Cat.txt Cat.java Cat.class Cat For the class named Cat, what is the name of the file that the compiler creates and is provided to the Java Virtual Machine to run?
Edit-Compile-Run Cycle From the command-line: notepad javac java