lang-compare
lang-compare copied to clipboard
Java updates
- removed redundant generic type specifications
- favored try-with-resources
- applied streams where that seemed appropriate and the other languages used that style
Thank you! I'm thinking about how to manage language versions. I want to keep Java 7 examples. As soon as I decide this I'll merge this PR.
@evmorov I had same thought, some languages, for example JavaScript drastically differs between versions.
I think, language mapping based on file extension should be change on path.
This:
CODE_EXTENSION = {
'coffee' => 'coffeescript',
'rb' => 'ruby',
'java' => 'java',
'py' => 'python',
'php' => 'php'
}.freeze
can be changed to this:
CODE_EXTENSION = {
'coffee' => 'coffeescript',
'ruby' => 'ruby',
'java/7' => 'java',
'python/3' => 'python',
'php' => 'php'
}.freeze
And files can be organized in to directories, for example:
`-- code/
|-- coffee/
| `-- array_add.py
|-- ruby/
| `-- array_add.py
|-- java/
| `--7/
| `-- ArrayAdd.py
|-- php/
| `-- ArrayAdd.py
`-- python/
`-- 3/
`-- array_add.py