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.
[ Parent
| on HN ]
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.