Giter Club home page Giter Club logo

functional-programming's Introduction

Functional Programming

WikiConceptPracticing with survey dataProcessing RDW Data

This repo is created to process data provided by de Volkskrant, so that a data visualisation can be created using D3. The data consists of parking data gathered by the RDW (Dutch Vehicle Authority), and contains many different variables that can be put together, combined, made relationships with. This should create an interesting data-visualisation, which de Volkskrant can use to write an article. Read more about this in my Debriefing.

Learning goals

  • Understanding and applying Functional Programming principles:
    • Pure and Impure functions
    • Higher-order functions
    • Composition
    • Currying
    • Immutability
  • Data processing techniques

Getting started

Setting up the repo

To get started, you first need to clone the repo and install the dependencies:

git clone https://github.com/theonejonahgold/functional-programming
cd functional-programming
yarn install || yarn

Available commands

yarn watch # Watches the src & dist folder on file changes
yarn build # Builds the TypeScript code in the src folder
yarn start # Starts Node in the dist folder
yarn lint  # Runs ESLint on files to check for consistent code.

Concept

Extended version

Main Question

What is the relation between distance and availability of parking places to hot-spots in the city?

Research questions

  • Where are the parking places situated?
  • How many parking garages are open 24 hours a day?
  • What is the average closing time for parking garages?
  • Do parking garages change their prices during the night, and how?
  • With how many parking garages can you exit with your vehicle throughout the entire day?
  • What is the capacity of the parking places?

Used variables

The used variables are available through this link.

Project structure

.
├── src    # Contains JS and CSS source code.
│   ├── data        # Here, all the data files are put. For privacy reasons, this folder only contains a .gitkeep file on the public repository. You need to supply your own data.
│   ├── utilities   # Utilities are general functions that can be adapted to certain use cases. They are divided into files named after the type they manipulate.
│   ├── helpers     # This folder is for functions used for specific use cases like language parsing.
│   ├── modules     # The modules folder is a place where all functions compositions are written.
│   ├── index.js    # Where it all comes together. This file is run when compiled to JS code.
│   └── index.css   # The main CSS file, where all the styling is created using TailwindCSS.
├── public
│   └── index.html  # The html file that gets loaded when you run a dev server or run start a production build.
├── build  # Contains identical folder structure as src folder, with compiled JS code, node modules compiled to web modules.
└── config # Contains the Nodemon configurations used for development of this project.

Functional Programming Principles Applied

  • Composition: The combining of functions to create extra functionality.
  • Functional purity: All functions give the same output when the same input is used.
  • Data immutability: All data passed into the functions is copied and then mutated, so that the original data itself is never mutated.
  • Currying: All functions return a function that can be used in a Higher-order function.
  • Higher order functions: All functions created can be passed into these to manipulate the data passed.

Tools used

functional-programming's People

Contributors

jonahgoldwastaken avatar

Stargazers

 avatar  avatar

Watchers

 avatar

functional-programming's Issues

Feedback hoofdvraag

Hi Jonah!

Wow super interessante onderzoeksvraag ben benieuwd wat hier uit gaat komen! 😊 Je deelvragen zeggen goed wat je wil onderzoeken, alleen door de formulering van je hoofdvraag lijkt het net alsof je het met nog iets wil vergelijken klopt dat?

Algemene feedback docenten 28 oktober

  • Duidelijk maken wat de variabelen zijn die ik ga gebruiken per deelvraag.
  • Data dat nog ontbreekt ook duidelijk aangeven.
  • Maak aannames op basis van de onderzoeksvragen.
  • Leg de data uit die ik gebruik.
  • Zet nog meer links in de README naar de wiki.
  • Stakeholders in de debriefing!!!
  • JSON structuur laten zien -> Ga ik doen met diagrammen.
  • Proces dataverwerking goed laten zien.

Peer Review

Readme & Wiki

Tops

  • Great structure of your readme!
  • The structure of your wiki is the same, fantastic!
  • You described all the data from the datasets you've found very well.
  • A real strong debriefing! Not too long, and to the point.
  • You've got a nice modular project already, all the principles of functional programming are applied, and you're even using typescript!

Tips

General

  • If I were you, I'd change the language from the readme to Dutch, because you are referring to a Dutch wiki.
  • I'd put your code editor files in your .gitignore as well (.nova & .vscode).
  • You've forgotten to add a repo description! (Don't worry, I forgot it too)

Data

  • It's best if you'd also write down what is done with invalid or empty values within each data set.

Wiki

  • It might be nice to add the functional patterns you've described in your readme to the table of contents.
  • It might be interesting for the reader to know if you've found invalid values and how you've dealt with these.
  • In "RDW Data verwerken" & "Oefenen met survey data" you've placed pictures that are barely readable, maybe try cutting these up into multiple pictures?
  • On the page "Week 2" it says: "Proces logboek week 1"

Code

  • It would be nice to see a couple comments to better understand your code!

Grading

  • Application of subject matter
    I can only give a 5-6 since we all haven't touched d3.js yet.
  • Understanding
    I get the feeling you understand everything you're using. When I ask you for instance about the pipe() function you're using in your code you can give me a great explanation on what it is and how it works. 9-10
  • Quality
    You've put a lot of effort in your wiki and your code. The only thing about your code is that it's missing comments, other than that you're doing everything quite perfectly. 7-8
  • Process
    You've shown your process on the RDW Data. What I'm missing is a couple code examples. Maybe you could show a code example you tried to apply to your code but didn't work, and then show the solution you've found to fix this problem. 3-4

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.