I would argue that (a & 1 == 0) is a cheaper simple test for evenness...
</gratuitous-nitpick>
Good show. Not really sure what the point of the list was... but
sometimes these things are just (for) fun.
-- Chris N-S

I would argue that (a& 1 == 0) is a cheaper simple test for evenness...
</gratuitous-nitpick>
Good show. Not really sure what the point of the list was... but
sometimes these things are just (for) fun.
-- Chris N-S

I am amazed at how Java guys still prefer their crappy, noisy and
efficient way. And sadly they represent the majority.

Well, compared to C++, a Java programmer needs to keep in mind far less
arbitrary details, that if forgotten cause many bugs in C++ programs. Java
compiler is strict and catches many bugs, it works well enough, and you just
need small jars to distribute the compilation result. Today Java works on many
machines, on 32 and 64 bit well enough, there are tons of libraries, Java
programmers that you are able to hire, tons of tools to edit/debug/improve Java
code, Java is today pretty fast and its GC is first world class. There are even
other languages like Scala and Jthon that run on the JVM and interoperate with
it and its libs. Given all that, the verbose syntax of Java becomes a minor
thing. Java is full of faults and downsides, but most other languages/language
ecosystems are worse.
Bye,
bearophile

I am amazed at how Java guys still prefer their crappy, noisy and
efficient way. And sadly they represent the majority.

Well, compared to C++, a Java programmer needs to keep in mind far less
arbitrary details, that if forgotten cause many bugs in C++ programs. Java
compiler is strict and catches many bugs, it works well enough, and you just
need small jars to distribute the compilation result. Today Java works on many
machines, on 32 and 64 bit well enough, there are tons of libraries, Java
programmers that you are able to hire, tons of tools to edit/debug/improve Java
code, Java is today pretty fast and its GC is first world class. There are even
other languages like Scala and Jthon that run on the JVM and interoperate with
it and its libs. Given all that, the verbose syntax of Java becomes a minor
thing. Java is full of faults and downsides, but most other languages/language
ecosystems are worse.
Bye,
bearophile

I was referring to the particular posters who praised the Java solution,
which is obviously inferior to nearly every 'filter' variant provided by
other posters.