1 / 20

Introduction to COMPSCI 220: Programming Methodology

Learn about modern programming languages, including Java, C++, Scala, and Go, and develop skills in reasoning about program correctness, debugging, and maintainability.

rwerner
Download Presentation

Introduction to COMPSCI 220: Programming Methodology

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. COMPSCI 220 Programming Methodology

  2. What Have You Learned So Far? Java Java Java Java Java!!+a few algorithms & data structures

  3. Can you just master Java and be done? No!

  4. Different Tasks => Different Languages GLShader Arduino-C Python

  5. New Languages Show Up At An Unprecedented Rate

  6. The COMPSCI 220 Approach • You will need to learn many new languages to succeed in computer science • We’d love to spend 10+ years teaching you all the languages(but then you’d miss the new languages introduced in those years) • We don’t have 10+ years Thus, what we will teach you: • Principles that translate across any modern language, including Java, C++, Scala, Go, Swift • How to reason about programs for correctness, ease of debugging, and maintainability

  7. JavaScript Is Everywhere

  8. JavaScript Is Everywhere

  9. The 220 web-based IDE: Ocelot

  10. A Modern Take On JavaScript COMPSCI 220-JS: Design to match other languages • JavaScript has been around for > 20 yearsMany old ways of programming still existNew features, abstractions, and capabilities have been continuously added • COMPSCI 220: An emphasis on modern JavaScriptChecks will disallow older features that have been supersededKnown bad coding practices are explicitly prohibited • Arbitrary JS code from the internet may not compileMuch of the internet uses older JS features, and often poor coding practicesYou should not be using code from the internet for assignments anyway • Anything you write in Ocelot will work outside class

  11. What We Will Focus On (A Sampler) • First-class functions • Higher-order functions • Dynamic typing • Testing: unit, property based, reference • Functional programming • Abstract data types • Applications: Robotics, programming language implementation

  12. Rules • Read the syllabusMore rules included in the syllabus • Work on your ownCheating = automatic F • Your code must compileDoes not compile = 0 on assignment • Late policy: four late days, then penalty per daySee syllabus for details

  13. Rules • Deadlines are hard and non-negotiable • Exam: make-up exam or disability service requests must be approved one week before the exam. • If you fall ill on the day of exam and have to request a make-up, you must provide an official doctor’s note. • No accommodation will be made after the exam.

  14. Grading

  15. How To Succeed • Start assignments earlyYou will need to think about them before coding.Starting on the last day will not work well. • Come to office hours and discussionsThe quickest and easiest way to resolve doubts. Even faster than Piazza, email, text, facebook, twitter, etc. • Ask questionsIf you have a doubt about something, so will others. Those who don’t, will benefit from revision. You’re really helping everyone by asking.

  16. JS: Basic Syntax; Using the Console let a = 42; // Declare a variable, and assign it a number. let b = 'Hello World'; // A string. let c = [0, 1, 4, 9]; // An array of numbers. const pi = 3.14159265359; // A constant. console.log('The value of pi is ' + pi.toString()); // Print to the console. console.log(c); // The console can display objects. let d; // Will not compile: need to initialize value. // The === operator in JS is equivalent to the == in other languages. if (1 === 1) { console.log('All is good.'); } function factorial(x) { let y = 1; for (let z = 1; z <= x; ++z) { y = y * z; } return y; }

  17. Types in JavaScript • Static types: In Java, you have to specify the types of variables and methods. The Java compiler catches type errors before you run the program. • Dynamic types: In JavaScript, you do not have to specify the types in the program. The JavaScript evaluator catches type errors when the program is running. • Note: JavaScript has types. > typeof 1 "number" > typeof 2.3 "number" > typeof "Hello, world!" "String" > typeof true "boolean" Note: all numbers have the type "number", which is equivalent to the type double in Java.

  18. Some Small Gotcha Points About JS • Instead of "==", use "===". Instead of "!=", use "!=="JavaScript does not treat "==" and "!=" the same way as other languages. We will not use this feature: remember, good programming practices. • The type of a variable can changeDo not deliberately use this feature. It hampers readability, and may lead to bugs. let a = 2;a = "Hello world"; • The value undefined has type "undefined". It is similar to null in Java.

  19. Project 1: Image Processing Removed green and blue Grayscale Highlight edges Blur

  20. COMPSCI 220 Homework Programming: • Submit on Gradescope • Autograder will only reveal full test results after due date. Only a few simple test results will be shown before. Written: • Fill in the answers, and upload pdf to Gradescope See course website for late policy

More Related