Git Product home page Git Product logo

flight's Introduction

Separation of Concerns

"The most important principle in Software Engineering is the Separation of Concerns (SoC): The idea that a software system must be decomposed into parts that overlap in functionality as little as possible."


Learning Objectives

Priorities: ๐Ÿฅš, ๐Ÿฃ, ๐Ÿฅ, ๐Ÿ” (click to learn more)

There is a lot to learn in this repository. If you can't master all the material at once, that's expected! Anything you don't master now will always be waiting for you to review when you need it. These 4 emoji's will help you prioritize your study time and to measure your progress:

  • ๐Ÿฅš: Understanding this material is required, it covers the base skills you'll need to move on. You do not need to finish all of them but should feel comfortable that you could with enough time.
  • ๐Ÿฃ: You have started all of these exercises and feel you could complete them all if you just had more time. It may not be easy for you but with effort you can make it through.
  • ๐Ÿฅ: You have studied the examples and started some exercises if you had time. You should have a big-picture understanding of these concepts/skills, but may not be confident completing the exercises.
  • ๐Ÿ”: These concepts or skills are not necessary but are related to this module. If you are finished with ๐Ÿฅš, ๐Ÿฃ and ๐Ÿฅ you can use the ๐Ÿ” exercises to push yourself without getting distracted from the module's main objectives.

  • ๐Ÿฅš event-driven programming: identify the concept in a JS program via listeners & handlers
  • [ ]๐Ÿฅš entry points: describe what an entry point is, there are 2 kinds in the programs for this module - initialization & interaction. identify them in a program
  • ๐Ÿฅš function roles: describe what function roles are and why they're important. they can identify a function's role given checklists for each role covered in this module:
    • listeners: functions that attach event listeners to the DOM
    • ๐Ÿฅš handlers: entry point for user interactions
    • ๐Ÿฅš utils (utilities): pure functions to help do things with data
    • ๐Ÿฃ components: render data into DOM elements to display for the user
    • ๐Ÿฅ custom events: create custom events events in your components, passing useful data between components and handlers
  • ๐Ÿฅš DOM access: You read and write values from the DOM in an event handler
  • ๐Ÿฅš es5 vs. es6: You can demonstrate the change in developer-experience pre and post es6 by stepping through in the debugger and explaining differences in scoping (global vs. script, block vs. local, modules) between two programs with identical user experience but different implementations.
  • ๐Ÿฅš Scope Hierarchy: You is comfortable navigating different scopes in the browser's debugger to understand an existing application (script, module, closure, local, block)
  • ๐Ÿฅš Code Splitting: You can use ES Modules to split your code into multiple files & folders according to function role, data, listeners and initialization. They can use generated dependency diagrams and documentation to understand and navigate this folder structure.
  • ๐Ÿฅš Dependency Graphs: You can use a project's dependency graph to understand how it is organized and to navigate the source code.
  • ๐Ÿฅš Development Strategies: You can write development strategies that have all of the program's state defined at the beginning, and separate each user story into interface and interaction tasks.
  • ๐Ÿฃ Naming Functions: You can come up with clear and helpful names for the functions in your program. A good function name will take into account the function's role and the program's domain, like in the /naming-variables exercises from Debugging.
  • ๐Ÿฃ DOM manipulation: You can manipulate the DOM when implementing level-appropriate user interactions
  • ๐Ÿฃ Isolating Components: You can use a test.html file to render your components with different inputs
  • ๐Ÿฃ Forms: You can do basic handling of form data via event.target.form
  • ๐Ÿฃ Handling events: You can use the event argument to process user interactions, including bubbled events using event.target
  • ๐Ÿฃ Passing Component Unit Tests: You can write vanilla DOM component functions to pass provided unit tests
  • ๐Ÿฃ refactoring: refactor a single-script tutorial-style web page into multiple files using imports and exports
  • ๐Ÿฅ reverse-engineering: You can incrementally reverse-engineer a level-appropriate user interaction following these steps:
    • init
    • Listeners
    • Handlers
    • (possibly): Utils, Components, Custom Events
  • ๐Ÿ” From Spec: given user stories, You can develop a site from scratch using a template repository.
  • ๐Ÿ” Writing Component Unit Tests: You can write unit tests to validate your component functions using BDD syntax

TOP


Getting Started

How to study the code in this repo.

setting up study-lenses

You will need NPM and nvm on your computer to study this material

Using a browser with good DevTools will make your life easier: Chromium, FireFox, Edge, Chrome

  1. Install o update the study-lenses package globally
    • $ npm install -g study-lenses (if you do not have it installed)
    • $ npm update -g study-lenses (if you already have it installed)
    • Didn't work? you may need to try:
      • (mac) $ sudo npm install -g study-lenses
    • having trouble updating?
      • try this: $ npm uninstall -g study-lenses && npm install -g study-lenses
  2. Fork and clone this repository:
    1. fork the HackYourFuture repository to your personal account
    2. clone your fork to your computer
    3. when there are updates to the module:
      1. update your fork with a PR
      2. pull the changes from your fork to your computer
  3. Navigate to the module repository in terminal
    • $ cd separation-of-concerns
  4. Run the study command from your CLI
    • $ study
  5. The material will open in your default browser, you're good to go!
    • you can read the study-lenses user guide from your browser by navigating to localhost:xxxx?--help

If you use windows and get this error:

  • ..dy.ps1 cannot be loaded because running scripts ...

follow the instructions in this StackOverflow answer, that should take care of it ; )

npm run test -- path/to/file.spec.js

You can run tests in this repository using the test script, it will run all the tests in the path you provide.

If you do npm run test or npm run test -- ./ it will run every test in this repository. (there are a lot)

npm run document -- path/to/src

Pro Tip: do not use npm run document without a specific path, it is very slow!

This script will build a dependency graph for all the JavaScript files inside a specific /src folder. It can be very helpful to run the document script every time you add/remove a file or change the import/exports in an exercise.

If you run this script at a higher directory, like ./, it will document all of the /src folders inside that directory.

npm run format -- path

This script will format all of the code in the path you provide.

Linting

There is no linting script in this repository. It's for practice only, no need to check every detail. Your project starter repositories will have linting scripts.

TOP


Study Tips

expand/collapse
  • Don't rush, understand! Programming is hard.
    • The examples and exercises will still be there to study later.
    • It's better to fail tests slowly and learn from your mistakes than to pass tests quickly and not understand why.
  • Don't skip the examples! Understanding and experimenting with working code is a very effective way to learn programming.
  • Practice Pair Programming: two people, one computer.
  • Take a look through the Learning From Code guide for more study tips

Priorities

If you can't finish all the material in this repository, that's expected! Anything you don't finish now will always be waiting for you to review when you need it. These 3 emoji's will help you prioritize your study time and to measure your progress:

  • ๐Ÿฅš :egg: - Understanding this material is required, it covers the base skills you'll need for this module and the next. You do not need to finish all of them but should feel comfortable that you could with enough time.
  • ๐Ÿฃ :hatching_chick: - Do your best to start this material. you don't need to master it or finish it but getting the main idea will be helpful for taking the next steps.
  • ๐Ÿฅ :hatched_chick: - Have you finished all the ๐Ÿฅš's and started all the ๐Ÿฃ's? push yourself with these challenges.

Hashtags

There's sooo many examples and exercises in this repository, it's easy to forget of what you still need to finish or what you want to review again. Luckily VSCode is really good at searching through folders of code.

You can write hashtags in your comments while you're studying, then search for those hashtags later so you don't miss anything. Here's some ideas:

  • // #todo, still a few blanks left - search for #todo in Study Lenses or VScode to find all the exercises you still need to study
  • // #review, coercion is confusing this again next week - search for #review to find the files you need to study again
  • ... anything goes! Find the hashtags that work for you

Module Project Boards

If you create a fork of this repository you can open a project board in your fork to track your progress through the module. Just 3 columns can be enough: Todo, Doing, Done.

TOP


draino in the fridge

TOP

flight's People

Contributors

lishan6 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.