Giter VIP home page Giter VIP logo

elm-katas's Introduction

Elm Katas

One of the best ways to learn a new language, or improve a skill (TDD, refactoring, or any other pattern or technique) is using a simple exercise to focus in on what you want to learn or improve. This is sometimes called deliberate practice.

Tennis Rules for Kata

The scoring rules are described here: https://codingdojo.org/kata/Tennis/.

Setup

  1. Install dependencies with npm install.
  2. Run tests with npm run test-watch (or run them just once with npm test).
  3. Start the app with npm start (this will automatically open the browser for you, and the page will auto-reload whenever you save your code).

Tennis Kata

Goal: use TDD to create a tennis scoreboard page. Clicking on the Player 1 Scored and Player 2 Scored buttons will update the scoreboard.

Recommended approach

The trick is to do the simplest step possible, but also integrate end-to-end as often as possible. That means that:

  • You should start with a single case and make that work simply (like player 1 can score a point).
  • But before moving to the next case (both players can score, player score can go above 15, etc.), get that wired in to the Main.elm page so you can actually demo it (don't wait to integrate till the end, the feedback from using it on the page will make sure it works and is a nice design).

Elm makes refactoring incredibly easy and safe (the compiler will step you through the changes you need to make when you update your types). Take advantage of that by starting with the simplest solution for a given test case, then refactoring to allow for more complexity just-in-time.

elm-katas's People

Contributors

dillonkearns avatar dctid 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.