Git Product home page Git Product logo

odin-battleship's Introduction

Odin - Battleship

This project was provided by Odin to reinforce TDD material.

Challenges I've met:

  1. To make jest accept ESM syntax, you have to add a babel.config
  2. Code specific rabbit hole: functionally await f(y) and f(await y) are same.
    • In both cases the f function's internals are waiting for a resolution before a return.
  3. Testing a private function is a bad idea for encapsulation.
    • One way to solve this issue is to "Implicitly" test them with public methods
    • If such a function has effects (which it likely does), we can test the said object for changes.
  4. Defining a function's/project's behavior before it's implementation.
    • The most helpful solution to me was to graphically visualize the relations between the different functions.
    • This way I can get a good grasp of how all the gears of a project move, before writing a singe line.
  5. Code regression if I forget to test before a push
    • Add a github action that runs tests on each commit, work only on branches.
    • Setup a git pre-commit hook that runs the test command before each commit.
  6. Code becomes a mess when one part of the app wants to be up to date about another
    • In our decoupled approach, it is hard to have a clean and pure ui or Game.js.
    • The solution I found to this issue is implementing the Pub/Sub Pattern

odin-battleship's People

Contributors

haswell-s 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.