The web app provides side-by-side examples of syntax differences between programming languages. You can use it as a cheatsheet or as a learning material to learn one of them through another. Creating these examples I tried to use the most used and the cleanest solutions.
All examples are executable. You can copy and launch them without changes. It helps to understand what the code is doing easily.
View web app here.
Created with:
All languages:
Java and Kotlin:
Add more languages:
Install ruby:
$ ruby --version
Install dependencies:
$ bundle
Run the app in localhost (http://localhost:4567):
$ bundle exec middleman
To generate outputs below the examples:
$ rake
To add a new language:
langs
variable to config.rb
Rakefile
to run all the examples to produce output files that are included to the final htmlTo add an example:
data/code.yml
code/
folderWhere can I provide a version?
Interpolation in Python is:
first = "Don't worry,"
second = 'be happy'
print('%s %s' % (first, second))
Since 3.6 you can use:
first = "Don't worry,"
second = 'be happy'
print(f'{first} {second}')
To achieve it:
data/code.yml
python:
.: string_interpolation.py
'3.6': string_interpolation.py
code/python/
code/python/3.6
git checkout source
bundle exec middleman build
bundle exec middleman deploy
Feel free to add or modify any examples.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)