News for hackers. Stuff that matters.
Re:Show HN: 15-question language identification quiz by throwaway2016a on Thursday July 13, 2017 @02:54PM (#14764076)
Got 14/15 but I have a feeling it was only because I made the assumption I would not see the same language twice. Without that assumption a few were toss ups for me.

Of all the languages on there the only one in that set I had never used / seen at all is Kotin and that's the one I got wrong.

Several of them were mandatory for me to learn in college but I haven't seen since. (looking at you, Prolog and Verilog... Verilog is useful but I don't do hardware dev)

Re:Show HN: 15-question language identification quiz by SilasX on Thursday July 13, 2017 @05:30PM (#14765424)
Got 14/15 because I couldn't tell Emacs Lisp from Clojure. Argh ...
Re:Show HN: 15-question language identification quiz by endgame on Thursday July 13, 2017 @09:07PM (#14766687)
The [ ] around the args are the giveaway.
Re:Show HN: 15-question language identification quiz by dvcrn on Thursday July 13, 2017 @10:16PM (#14766930)
defn vs defun :)

I remembered it somehow as "clojure doesn't allow you to define fun"

Re:Show HN: 15-question language identification quiz by nameless912 on Friday July 14, 2017 @12:47AM (#14767536)
Lol, I should print this out on a poster and give it to That One Clojure Guy(tm) at work.
Re:Show HN: 15-question language identification quiz by QuercusMax on Friday July 14, 2017 @01:54PM (#14771783)
Missed this as well. I should have guessed Clojure because it's a language people actually might use. All I could tell is it's some kind of Lisp.
Re:Show HN: 15-question language identification quiz by Arcsech on Thursday July 13, 2017 @07:20PM (#14766134)
Yep, I also missed Kotlin. I technically missed Clojure too, because I rushed and hit Emacs Lisp before actually fully reading the example and all the answers.
Re:Show HN: 15-question language identification quiz by arethuza on Thursday July 13, 2017 @05:02PM (#14765201)
I also scored 14/15 - got PHP wrong I thought it was Perl which is slightly embarrassing as I've never used PHP but I have used Perl.
Re:Show HN: 15-question language identification quiz by nameless912 on Friday July 14, 2017 @12:48AM (#14767540)
PHP and Perl are basically like Spanish and Italian when it comes to syntax. Both can more or less interoperate with the assistance of lots of hand gestures and facial expressions.
Re:Show HN: 15-question language identification quiz by twic on Thursday July 13, 2017 @08:00PM (#14766368)
Ditto. I'm positive that code would be valid Perl with the right libraries.

Which isn't saying much.

Re:Show HN: 15-question language identification quiz by dunham on Thursday July 13, 2017 @09:17PM (#14766726)
Same here, because I knew they intersected and presumed it was a trick question. Technically, I believe it is neither valid perl nor PHP because it's missing an opening brace on one of the if statements.
Re:Show HN: 15-question language identification quiz by sethrin on Friday July 14, 2017 @06:48AM (#14768829)
PHP lets you skip using curly braces for conditionals. I've seen real-world code which used this style only once, and it was about as bad as you'd expect.
Re:Show HN: 15-question language identification quiz by dunham on Saturday July 15, 2017 @04:42PM (#14778821)
Yeah, I suspected that, but it looked like there was a close brace and no open brace. (I only noticed because I was specifically looking at the braces to try to determine if it was PHP.)
Re:Show HN: 15-question language identification quiz by rmrfrmrf on Thursday July 13, 2017 @09:56PM (#14766849)
The lovely globals (e.g. `$_GET`) are what give PHP away.
Re:Show HN: 15-question language identification quiz by netvarun on Thursday July 13, 2017 @05:16PM (#14765324)
Can concur. I managed to get all correct, but that one question that almost tripped me was the PHP question.

As an ex-perl dev, (looks at self) shrugs in disbelief!

Re:Show HN: 15-question language identification quiz by khedoros1 on Thursday July 13, 2017 @05:26PM (#14765398)
I did that too, and in the same situation (although I got more wrong).
Re:Show HN: 15-question language identification quiz by yellowapple on Thursday July 13, 2017 @03:20PM (#14764312)
I also missed Kotlin.

A lot of them could be inferred from what the code is doing. For example, PHP and Perl are sometimes really hard to distinguish, but I was able to get PHP right by deciding that "this ain't what a Perl hacker would write". Same with Ada v. VHDL.

Re:Show HN: 15-question language identification quiz by munchbunny on Thursday July 13, 2017 @04:26PM (#14764855)
Missed Kotlin here too. I also missed one where I guessed Haskell when it was actually Prolog.

I feel like this quiz was much more about how much you've dabbled at surface level in various languages, enough or not enough to remember specific details to aid in process of elimination. For example, I knew what GLSL stood for, so the picture was most definitely not GLSL. And I had at one point written Scheme and looked into Lisp enough to guess that it was Clojure and not Lisp. And I remembered vaguely enough that Objective-C still uses C-like pointer notation, for example. And I remembered enough of computer engineering class to immediately identify that the VHDL question's code fit the use case despite not having written a line of VHDL (or Verilog) ever.

Re:Show HN: 15-question language identification quiz by twic on Thursday July 13, 2017 @08:01PM (#14766380)
For the last question, a smattering of art history will guide your guessing much better than a smattering of computer science!
Re:Show HN: 15-question language identification quiz by vram22 on Saturday July 15, 2017 @01:50PM (#14777921)
I got Kotlin right, but only because I happened to see some Kotlin code (due to the somewhat recent HN thread about it, based on a post by Steve Yegge), else might have got it wrong, due to maybe thinking Kotlin syntax would likely be similar to Java.

On second thoughts, though, I guess there is no need for a JVM language's syntax to resemble Java's (much, anyway). E.g. Jython, JRuby, Groovy, etc.