lang-compare icon indicating copy to clipboard operation
lang-compare copied to clipboard

Java updates

Open pfarner opened this issue 8 years ago • 2 comments

  • removed redundant generic type specifications
  • favored try-with-resources
  • applied streams where that seemed appropriate and the other languages used that style

pfarner avatar Jun 15 '16 16:06 pfarner

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 avatar Jun 18 '16 22:06 evmorov

@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

sirex avatar Jun 19 '16 06:06 sirex