GithubHelp home page GithubHelp logo

matthiaskainer / fizzbuzz-specialized-vs-reusable-in-multiple-languages Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 6 KB

FizzBuzz Specialized vs Reusable Approach in multiple languages

C# 13.68% JavaScript 14.83% Kotlin 13.58% Shell 27.42% Python 13.42% Rust 17.06%

fizzbuzz-specialized-vs-reusable-in-multiple-languages's Introduction

A fizzbuzz example: specialisation vs reusability

Code companion to the article on matthias-kainer.de

Running examples

The run script will give you all possible commands. Example:

❯ ./run
usage: ./run <example>

  python: Runs the python example. Requires pipenv and pyenv or python 3.8 on your path for python
  rust: Runs the rust example. Requires rustc & cargo
  js: Runs the javascript example. Requires nvm or node > 16
  kotlin: Runs the kotlin example. Requires kotlinc-jvm 1.6.10 (JRE 17.0.2+8)
  all: Runs all examples

❯ ./run all

###########################
#         PYTHON          #
###########################

Elapsed specialized:            208.17ms
Elapsed reusable:               897.88ms
Same results?                   True

###########################
#        KOTLIN           #
###########################

Elapsed specialized:            136 ms
Elapsed reusable:               310 ms
Same results?                   true

###########################
#          JS             #
###########################

Same results?                    true
Elapsed specialized:            127.04168399982154ms
Elapsed reusable:               245.83684499934316ms

###########################
#        DOTNET           #
###########################

Elapsed specialized:            70ms
Elapsed reusable:               296ms
Same results?                   True

###########################
#         RUST            #
###########################

Elapsed specialized:            63.15ms
Elapsed reusable:               118.80ms
Same results?                   true

If you have all requirements install, you can run all examples in sequence with the ./run-all script

fizzbuzz-specialized-vs-reusable-in-multiple-languages's People

Contributors

matthiaskainer avatar

Watchers

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