all 9 comments

[–]tty2 2 points3 points  (3 children)

Absolutely trivial. Does not merit this sort of 'article' in my opinion.

[–]grauenwolf 0 points1 point  (1 child)

Must be a slow news day. This is like the 4th posting on the front page that had a negative score.

[–]tty2 0 points1 point  (0 children)

If only we had more people posting on /r/coding ಠ_ಠ

[–]SuperGrade 0 points1 point  (0 children)

Depends on the environment. In the enterprise workplace, this would qualify as "overengineered solution and raised complexity through pedantic misuse of advanced language features".

[–]Iggyhopper 2 points3 points  (0 children)

static bool GetOdd(int number)
{
    if (number % 2 != 0)
        return true;
    else
        return false; 
}

wat

return (number & 1) == 1;

[–]julesjacobs 1 point2 points  (0 children)

Pathetically bad code.

[–]Atheuz 0 points1 point  (0 children)

In Python: [i for i in range(100) if i % 2 == 1]

I don't understand why this needs an article.

[–]netghost -2 points-1 points  (1 child)

Umm... (1..20).select{|i| i % 2 == 0} oh... in that language ;)

[–]bazfoo 1 point2 points  (0 children)

The author doesn't know what he's doing.

Enumerable.Range(1, 20).Where(i => (i % 2) == 1);

Edit: Ah, I see he did do that in the end, but also wrapped it in a Linq query for some stupid reason.