├── .gitignore
├── Gemfile
├── README.md
├── Rakefile
├── _layouts
└── default.html
├── assets
├── favicon.png
├── logo.png
├── logo.svg
└── screen.css
└── meta.md
/.gitignore:
--------------------------------------------------------------------------------
1 | _site/
2 | tmp/
3 | Gemfile.lock
4 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source 'https://rubygems.org'
2 |
3 | group :jekyll_plugins do
4 | gem 'github-pages'
5 | end
6 |
7 | group :development, :test do
8 | gem 'html-proofer', '~> 2.6'
9 | gem 'rake', '~> 10.4'
10 | end
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: default
3 | permalink: /
4 | ---
5 |
6 | # Advanced JavaScript syllabus
7 |
8 | ***If you are a teacher or interested in the design of the course, see the [meta](https://github.com/advanced-js/syllabus/blob/gh-pages/meta.md) document.***
9 |
10 | * **Course:** [INFO1-CE9766, NYU SCPS](http://scps.nyu.edu/content/scps/academics/course_detail.html?id=INFO1-CE9766)
11 | * **Instructor:** Aidan Feldman, [alf9@nyu.edu](mailto:alf9@nyu.edu)
12 | * **Need help?**
13 | * [](https://gitter.im/advanced-js/syllabus?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
14 | * It sends message digests to people who aren't active in the room, so feel free to ask a question even if no one's around.
15 | * Look through and create [issues](https://github.com/advanced-js/syllabus/issues)
16 | * Office Hours during [Hacker Hours](http://hackerhours.org/) (see [schedule](http://www.meetup.com/hackerhours/events/calendar/))
17 | * [Email](mailto:alf9@nyu.edu) for 1-on-1 help, or to set up a time to meet
18 |
19 | ## Course Description
20 |
21 | Learn best practices in JavaScript in this intensive, five-session course. Topics include data encapsulation, closures, binding, inheritance, and name spacing. Discover some of the lesser-known, yet useful, features of the language, such as how to debug JavaScript problems on different browsers and improve performance. Create interactive webpages using third-party JavaScript libraries.
22 |
23 | Computers are provided in the lab, though you are encouraged to bring a laptop for in-class exercises.
24 |
25 | ## Prerequisites
26 |
27 | * [INFO1-CE9755 - JavaScript](http://scps.nyu.edu/content/scps/academics/course_detail.html?id=INFO1-CE9755) ([syllabus](http://samsultan.com/javascript)) or equivalent
28 | * Understanding of variables, data types, control flow, and basic function usage in JavaScript
29 | * Strong intermediate knowledge of HTML, and at least basics of CSS
30 | * Basic jQuery knowledge (DOM interaction like adding/removing elements/classes, etc.)
31 |
32 | These won't be enforced by the instructor, but you will be pretty lost without understanding those concepts. If you need a refresher, take a look at the [Beginner Materials](#beginner-materials).
33 |
34 | ## Course Overview
35 |
36 | We will dive into the nuances of JavaScript, how prototypal inheritance compares to classical inheritance, and how this can be used to build dynamic and complex web applications. Modern tools like jQuery and BackboneJS will be discussed, but students will learn the building blocks of these frameworks and after this course be able to understand what is happening under the hood. The focus will be on development for browsers, though most applies to other systems like Node.js, Phonegap, etc. Topics covered include:
37 |
38 | * Encapsulation, closures and scope
39 | * Classical vs. prototypal inheritance
40 | * The event loop
41 | * AJAX and JSONP
42 | * local
43 | * remote (e.g. Foursquare)
44 | * Creating MVC-style models (a'la Backbone.js) from scratch
45 | * Test- and Pseudocode-Driven Development
46 |
47 | Topics will be demonstrated through live-code examples/slides, available at [advanced-js.github.io/deck](http://advanced-js.github.io/deck/). Additional exercises will completed in-class.
48 |
49 | See [this interview](https://web.archive.org/web/20140306162909/http://blog.masterstreet.com/2013/09/05/interview-with-aidan-feldman-instructor-at-nyu-scps/) for more background.
50 |
51 | ## Homework/Projects
52 |
53 | All assignments are listed within the [Course Outline](#course-outline).
54 |
55 | ### Workflow
56 |
57 | If you're using GitHub Desktop, these general instructions will help:
58 |
59 | *
110 | 111 | 112 | 1. Introduction 113 | * Put name on sticky note on back of monitor 114 | * Discuss what the class is going to cover 115 | * Everyone introduce themselves 116 | * Name 117 | * What you "do" 118 | * What are your goals for the class? 119 | * What's something in JS (or technology) you worry that your peers understand but you don't? 120 | 1. Setup 121 | * How many people are comfortable with Git/GitHub? 122 | * Install [GitHub Desktop](https://desktop.github.com/) 123 | * If you are comfortable with Git already, you can skip this. 124 | * Sign up for GitHub 125 | 1. GitHub workflow 126 | * Walk through [workflow](#workflow) 127 | * Create pull request on [students repository](https://github.com/advanced-js/students) 128 | 1. Explain how slides work 129 | 1. Get through `countdown_exercise` slide 130 | 1. Talk through [requirements](#requirements) 131 | 132 | #### Homework 133 | 134 | * Join [the chat room](https://gitter.im/advanced-js/syllabus). 135 | * [Set up your GitHub profile.](https://github.com/settings/profile) 136 | * Access [NYU Classes](https://newclasses.nyu.edu) page, where grades will be posted. 137 | * [Documentation](https://wikis.nyu.edu/display/nyuclasses/Student+Quick-Start) 138 | * Read [JavaScript Garden](http://bonsaiden.github.io/JavaScript-Garden/). 139 | * Finish up and submit [echo](https://github.com/advanced-js/echo) and [countdown](https://github.com/advanced-js/countdown) exercises. 140 | * Complete [blink](https://github.com/advanced-js/blink) exercise. 141 | 142 | ### Class 2 143 | 144 | 1. Look at various approaches for `countdown()` 145 | * Show recursive solution 146 | 1. Developer Tools walkthrough 147 | * Elements (HTML) 148 | * Console (JS) 149 | * Scripts (JS) 150 | 1. Pair program to build [Memory v1](https://github.com/advanced-js/memory) (see [pairing tips](#pairing-tips)) 151 | 1. Cover OOP, though "oop_inheritance" slide 152 | * [Encapsulation example](http://jsbin.com/baqopu/1/edit?css,js,output) 153 | * Look at [Backbone.js Events](http://backbonejs.org/docs/backbone.html) 154 | 155 | #### Homework 156 | 157 | * Read [Mozilla's Introduction to Object-Oriented Javascript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript) 158 | * [OOP exercise](https://github.com/advanced-js/oop), through V2 159 | * [Memory v2](https://github.com/advanced-js/memory#v2) (individual) 160 | 161 | ### Class 3 162 | 163 | 1. Code review Memory 164 | 1. Get through [`oop_inheritance`](http://advanced-js.github.io/deck/examples/oop_inheritance/) slide 165 | 1. Cover automated testing 166 | * Build up a test framework from scratch 167 | * Examples in QUnit 168 | * [Simple](http://jsbin.com/woqusi/edit?html,js,output) 169 | * [Classes](http://jsbin.com/nukamun/edit?js,output) 170 | * [QUnit documentation](http://qunitjs.com/) 171 | * Other frameworks 172 | 1. Cover AJAX/CORS/JSONP ([files](https://github.com/advanced-js/deck/tree/gh-pages/demos/ajax)) 173 | * Network tab in Developer Tools 174 | 175 | #### Homework 176 | 177 | * Read [Google JavaScript Style Guide](https://google.github.io/styleguide/jsguide.html) 178 | * Complete [OOP exercise](https://github.com/advanced-js/oop) through V4. 179 | * [Memory V3](https://github.com/advanced-js/memory#v3) 180 | 181 | ### Class 4 182 | 183 | 1. Finish slides 184 | 1. Getting Serious example 185 | * Quick intro to Backbone.js 186 | * [Boilerplate](http://jsbin.com/IGivato/1/edit?html,js,output) 187 | * Click the Box [example app](http://jsbin.com/IGivato/5/edit?css,js,output) 188 | * TDD? 189 | 1. Multiple async 190 | * [Promises](https://github.com/advanced-js/deck/tree/gh-pages/demos/ajax/promises)/[jQuery.Deferred](http://api.jquery.com/jQuery.Deferred/) 191 | * Possibly show [async](https://github.com/caolan/async#control-flow-1) library? 192 | 193 | #### Homework 194 | 195 | * [Learn about AJAX](https://github.com/advanced-js/deck/tree/gh-pages/demos/ajax#readme) 196 | * [Mashup](https://github.com/advanced-js/mashup) 197 | * Improve your previous assignments 198 | 199 | ### Class 5 200 | 201 | 1. Present and code review Mashup projects 202 | 1. Possible topics (vote?): 203 | * Node.js 204 | * Server "Hello World" (from [Node.js homepage](http://nodejs.org/)) 205 | * [HTTP module docs](http://nodejs.org/api/http.html) 206 | * HTTP requests 207 | * [Status codes](http://pretty-rfc.herokuapp.com/RFC2616#status.codes) 208 | * Headers 209 | * CommonJS? 210 | * [Regular Expressions](https://github.com/advanced-js/deck/tree/gh-pages/demos/regex.html) 211 | * Convert live input from a text area, e.g. 212 | * Link Twitter handles 213 | * Substitute select words for emoji, using [emoji-css](http://afeld.github.io/emoji-css/) 214 | * Object-Oriented design 215 | * [Code Retreat](http://coderetreat.org/facilitating/structure-of-a-coderetreat) – possible "problems": 216 | * [Game of Life](http://coderetreat.org/gol) 217 | * Tic Tac Toe 218 | 219 | ## Pairing Tips 220 | 221 | * Three people is possible, but two works best 222 | * Agree on an editor and environment that you're both comfortable with 223 | * The person who's less experienced/comfortable should have more keyboard time 224 | * Switch who's "driving" regularly 225 | * Make sure to save the code and send it to both people 226 | 227 | ## Resources 228 | 229 | ### Required Reading 230 | 231 | * [Google JavaScript Style Guide](https://google.github.io/styleguide/jsguide.html) 232 | * [JavaScript Garden](http://bonsaiden.github.com/JavaScript-Garden/) 233 | * [Mozilla's Introduction to Object-Oriented Javascript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript) 234 | * [What’s so great about JavaScript Promises?](http://blog.parse.com/learn/engineering/whats-so-great-about-javascript-promises/) 235 | 236 | ### Beginner Materials 237 | 238 | This class assumes you are confident with this material, but in case you need a brush-up... 239 | 240 | * Codecademy – [JavaScript](https://www.codecademy.com/learn/javascript) and [jQuery](https://www.codecademy.com/learn/jquery) 241 | * [Eloquent JavaScript](http://eloquentjavascript.net/index.html) by Marijn Haverbeke, Chapters 1-5 242 | * [Want to learn JavaScript in 2015?](https://medium.com/@_cmdv_/i-want-to-learn-javascript-in-2015-e96cd85ad225) 243 | * [How jQuery Works](https://learn.jquery.com/about-jquery/how-jquery-works/) 244 | * see also – [Other Lists](#other-lists) 245 | 246 | ### Recommended Reading 247 | 248 | * [Functional JavaScript](http://shop.oreilly.com/product/0636920028857.do) by Michael Fogus 249 | * [Front-end Job Interview Questions](https://github.com/h5bp/Front-end-Developer-Interview-Questions) by @darcyclarke (for testing yourself) 250 | * [JavaScript Best Practices](http://www.thinkful.com/learn/javascript-best-practices-1/) 251 | * [JavaScript Patterns](http://shichuan.github.io/javascript-patterns/) by @shichuan (thanks @iandrewfuchs) 252 | * [JavaScript Patterns](http://www.amazon.com/JavaScript-Patterns-Stoyan-Stefanov/dp/0596806752) by Stoyan Stephanov 253 | * [JavaScript Web Applications](http://www.amazon.com/JavaScript-Web-Applications-Alex-MacCaw/dp/144930351X/) by Alex MacCaw 254 | * [JavaScript: The Good Parts](http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742) by Douglas Crockford 255 | * [Learning Advanced JavaScript slides](http://ejohn.org/apps/learn/) by John Resig 256 | * [Static Web Apps](http://www.staticapps.org/) 257 | * [Test-Driven JavaScript Development](http://www.amazon.com/Test-Driven-JavaScript-Development-Developers-Library/dp/0321683919) by Christian Johansen 258 | * [The JavaScript Interpreter, Interpreted](http://www.slideshare.net/marthakelly/js-interpreter-interpreted) by Martha Girdler [(video)](https://www.youtube.com/watch?v=iSxNCYcPAFk) 259 | 260 | #### Specific Topics 261 | 262 | * [Classical Inheritance in JavaScript](http://www.crockford.com/javascript/inheritance.html) by Douglas Crockford 263 | * [Partial Application in JavaScript](http://benalman.com/news/2012/09/partial-application-in-javascript/) by Ben Alman (thanks @michaelBenin) 264 | * [HTML5 Rocks](http://www.html5rocks.com) 265 | * [Learning JavaScript Design Patterns](http://addyosmani.com/resources/essentialjsdesignpatterns/book/) by Addy Osmani 266 | 267 | #### Other Lists 268 | 269 | * [JS: The Right Way](http://www.jstherightway.org/) (an overview of the JS landscape) 270 | * [Code School](https://www.codeschool.com/paths/javascript) 271 | * Thoughtbot's [Javascript Trail Map](https://upcase.com/javascript) 272 | * [How To Learn JavaScript Properly](http://javascriptissexy.com/how-to-learn-javascript-properly/) 273 | * [Superhero.js](http://superherojs.com) 274 | * [Teach Yourself to Code](http://teachyourselftocode.com/javascript) 275 | 276 | ### Tools 277 | 278 | * code validation: [JSLint](http://jslint.com) / [JSHint](http://jshint.com) 279 | * debugging: 280 | * [Chrome Developer Tools](https://developer.chrome.com/devtools/index) 281 | * [Official debugging tutorial](https://developer.chrome.com/extensions/tut_debugging) 282 | * Tutorial: [JavaScript Diagnosis](http://www.macwright.org/2015/03/10/javascript-diagnosis.html) 283 | * [Firefox Developer Edition](https://www.mozilla.org/en-US/firefox/developer/) 284 | * sharing code snippets: [gist.github.com](https://gist.github.com/) 285 | * asking questions: [Stack Overflow](http://stackoverflow.com/) 286 | 287 | #### GitHub 288 | 289 | * Git and GitHub 290 | * [Official GitHub Help](https://help.github.com/) 291 | * [Recommended resources](http://hackerhours.org/resources.html#github) 292 | * GitHub Pages 293 | * [Official site](https://pages.github.com/) 294 | * [Thinkful guide](http://www.thinkful.com/learn/a-guide-to-using-github-pages/) 295 | 296 | #### HTML/CSS/JS Sandboxes 297 | 298 | * [JS Bin](http://jsbin.com/) (recommended) 299 | * [bl.ocks.org](http://bl.ocks.org/) 300 | * [Cloud9](https://c9.io/) 301 | * [CodePen](http://codepen.io/pen/) 302 | * [JSFiddle](http://jsfiddle.net/) 303 | * [Mozilla Thimble](https://thimble.mozilla.org) 304 | * [Plunker](http://plnkr.co/) 305 | * [rawgithub.com](http://rawgit.com/) 306 | 307 | #### Frameworks 308 | 309 | * Framework comparison: [TodoMVC](http://todomvc.com) 310 | * [Testing](https://coderwall.com/p/ntbixw) 311 | 312 | ### Reference 313 | 314 | * [Mozilla Developer Network](https://developer.mozilla.org/en/JavaScript) and [Learn JavaScript](https://developer.mozilla.org/en-US/learn/javascript) 315 | * [w3schools](http://www.w3schools.com/jsref/default.asp) 316 | * [JavaScript: The Definitive Guide](http://shop.oreilly.com/product/9780596000486.do) by David Flanagan 317 | * [Simplified JavaScript Jargon](http://jargon.js.org/) 318 | 319 | ### More Examples 320 | 321 | * [map/reduce](http://jsbin.com/ojapAsUR/2/edit?js) (in [Underscore](http://underscorejs.org/#map)) 322 | 323 | ## Grading 324 | 325 | * Class Participation – 30% 326 | * Homework – 70% 327 | 328 | ## Statements on Plagiarism 329 | 330 | ### SCPS 331 | 332 | > New York University takes plagiarism very seriously and regards it as a form of fraud. The definition of plagiarism that has been adopted by the School of Continuing and Professional Studies is as follows: "Plagiarism is presenting someone else's work as though it were one's own. More specifically, plagiarism is to present as one's own words quoted without quotation marks from another writer; a paraphrased passage from another writer’s work; or facts or ideas gathered, organized, and reported by someone else, orally and/or in writing. Since plagiarism is a matter of fact, not of the student's intention, it is crucial that acknowledgement of the sources be accurate and complete. Even where there is not a conscious intention to deceive, the failure to make appropriate acknowledgement constitutes plagiarism. Penalties for plagiarism range from failure for a paper or course to dismissal from the University. 333 | 334 | ### Instructor 335 | 336 | Reuse and building upon ideas or code are major parts of modern software development. As a professional programmer you will never write anything from scratch. This class is structured such that all solutions are public. You are encouraged to learn from the work of your peers. I won't hunt down people who are simply copying-and-pasting solutions, because without challenging themselves, they are simply wasting their time and money taking this class. 337 | 338 | Please respect the terms of use and/or license of any code you find, and if you reimplement or duplicate an algorithm or code from elsewhere, credit the original source with an inline comment. 339 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'html/proofer' 2 | 3 | task :test do 4 | sh 'bundle exec jekyll build' 5 | HTML::Proofer.new('./_site').run 6 | end 7 | 8 | task default: :test 9 | -------------------------------------------------------------------------------- /_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |Are you new to front-end web development? Here's a secret: no one else really knows what they're doing either.
— Nicolas (@necolas) January 17, 2013