News for hackers. Stuff that matters.
Re:N-queen puzzle in 4 lines of Scala by mathetic on Sunday April 10, 2016 @09:56AM (#11466096)
Arggh, every single time someone posts an incredible cool small piece of code that solves a difficult problem, comments like this appear.

This whole HN attitude of pristine code is killing me. This is a piece of code in a GIST and solves the problem in three lines, it is clearly not intended for production use in a large code base.

Please stop searching for something wrong and enjoy what is presented in all of its glory.

Re:N-queen puzzle in 4 lines of Scala by haddr on Sunday April 10, 2016 @12:51PM (#11466984)
The difference here is that when you read the title you think: "wow, scala features allows solving interesting problems in few steps, let's see". And the you realize that it's a cheat. This code is literaly squeezed into those 4 lines, full of less common idioms, and quite obscure.

It should be called "0,5kb scala contest" than "solving x with scala", to avoid misunderstanding.

Re:N-queen puzzle in 4 lines of Scala by zyngaro on Sunday April 10, 2016 @10:23AM (#11466209)
Maybe it's the case here but in the scala community in general I noted a tendency to emphasize cleverness over clarity and simplicity.
Re:N-queen puzzle in 4 lines of Scala by ADRIANFR on Sunday April 10, 2016 @01:39PM (#11467245)
Re:N-queen puzzle in 4 lines of Scala by pyrale on Sunday April 10, 2016 @05:19PM (#11468212)
This piece of code doesn't "solve" the problem, it's a crude bruteforce implementation. The problem is hard for a reason.

Another way this code could be useful would be to showcase good readability practices, but it doesn't.