Hacker News new | ask | show | jobs
by sotojuan 3542 days ago
The worst part of Hacker Rank is that it takes arguments as STDIN, forcing you to to a "read from STDIN" ceremony before actually getting to the problem.
3 comments

If reading from STDIN is something that's considered a "ceremony", I'm already concerned about the rest of the code.

STDIN is one of the most common input methods I use for most of the commands I interact with on a daily basis. It would be like discovering that somebody found "logging errors to STDERR" to be a "ceremony"

In real life, I agree. But if I'm trying to solve an array sorting problem, why can't they just give me an array? LeetCode does it and it works fine. I get to focus on how to sort the array.

The other commenter (natdempk) makes some good points though.

The days of Perl CGI are a distant memory. More than that, it is a distraction. I'd be happier with the use of a parameterized test framework that lets you get to the point much more quickly.
If you work with a modern framework, chances are high you'll never actually read from STDIN. For example, I have no idea how I'd read from standard input in ObjC or Swift.
I could see why that might be annoying, but it forces the coder to make choices about their data structure and makes it easier for hacker rank to support many languages.
In most of the problems i've done, there's boilerplate code to read from standard input supplied as part of the problem. You just have to implement the algorithm.

In the problems where it's not, yeah, it's annoying. But it's also the same one or two lines every time, so it's not a big deal.