Giter Site home page Giter Site logo

extra-proj's People

Contributors

ben40d9 avatar rconjoe avatar

Watchers

 avatar

extra-proj's Issues

organize code into modules

problem

opening index.js is kind of stressful now. it is scary and hard to read. there is enough going on in this project now that we should organize it into folders, files, and modules. i'm also going to add new datasets with new problems to this repo, so it would be good to housekeep before then.

requirements

  1. organize this code however you see fit. experiment with different ways of splitting it up, keeping in mind that your main objective is to make it modular and easy to use in different places. look at what other node projects do to get some ideas, but the only wrong answers here are ones that don't make it any easier for you to pass code between files or build on it without modifying the existing code too much. abstraction is key, it's just easy to over-abstract too, so be careful.

  2. make your normalized csv data reusable. what i mean by this is only read the file and parse the stuff into a workable format once, and export that data from the file using module.exports so we can require it elsewhere. dont use import/export because we have not enabled es6 for this project, it is still commonjs.

  3. put each problem in its own file. put comments describing the problem and your thought process in the solution you came up with or any relevant notes.

  4. vscode sets up eslint stuff for you out of the box but make sure you have this extension installed.


other relevant info

"what the fuck is a linter? don't i have prettier already?"

eslint we will use for linting. prettier we use for formatting.
linting makes sure your code will run without errors. it makes sure you're following the language's rules to varying degrees.
formatting is just checking subjective code style preferences. it checks against your own rules.

in short:

  • LINTERS: CHECKS FOR CODE ERRORS AND BAD PRACTICES examples eslint, jslint, jshint. eslint is most common.
  • FORMATTERS: ENFORCES STYLISTIC PREFERENCES examples prettier, jsfmt, jsinspect.

you set linters and formatters up with config files usually. think .prettierrc.js/json/etc and/or .eslintrc.js/json.

links

  • really good page from microsoft explaining common app architecture principles.
    we really care about the first two - separation of concerns and encapsulation.

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.