# Shiny as a diamond - What am I?

Shiny as a diamond
Once thought to be under the sea
Better than a snake
I seek to bring joy to many

You are my master, I control your slave
Read my words only where defined
If you don't exist, to me, you're a liar
Tell me what I am, if you'd be so kind.

Every line has meaning, (Well, maybe not the last one, that's just a rhyme to finish the poem) so you have to explain it all

• People like to make riddles about programming languages here, I see. – Ben Frankel Apr 11 '15 at 19:59
• Nah, just warspyking. He's already made three so far. – Joe Z. Apr 11 '15 at 19:59
• Number 7 is the tendency for many programming languages to treat nonexistence as "false" when checking for a boolean value. The same behaviour is exhibited by C, C++, Java, Javascript, Python with the not keyword... – Joe Z. Apr 11 '15 at 20:09
• What's with the downvotes? – warspyking Apr 11 '15 at 23:38
• @warspyking Wasn't me who downvoted, but I think it's because you've overmined this category of riddle. You wrote a good riddle and it was upvoted, but then you wrote and posted two very similar ones within a day, seemingly with less care. These types of bandwagons never work out well, even if you're riffing off of yourself. And, the riddle is less fun to solve when people already know what type of answer to expect from metagaming you being the author. – xnor Apr 12 '15 at 3:58

Taking this in another direction, because the OP rejected my first answer,

Shiny as a diamond

Rubies are shiny, as are diamonds.

Once thought to be under the sea

the two proposed names for the language were Ruby and Coral.

Better than a snake

Ruby advocates claim it is better than Python (citation needed)

I seek to bring joy to many

Matsumoto, Ruby's creator wrote "For me the purpose of life is partly to have joy. Programmers often feel joy when they can concentrate on the creative side of programming, So Ruby is designed to make programmers happy."

You are my master, I control your slave

Programmers control computers

Read my words only where defined

A reference to undefined variables

If you don't exist, to me, you're a liar

Undefined values evaluate as false in Ruby, as in many languages.

Tell me what I am, if you'd be so kind.

The Ruby language

• Read my words only where defined is incorrect, but Ruby is correct. – warspyking Apr 12 '15 at 1:50
• @warspyking This? (Spoiler alert) – user12205 May 8 '15 at 16:48
• @ace No ${}{}{}$ – warspyking May 8 '15 at 22:08

Shiny as a diamond

Pe[a]rls are shiny, as are diamonds.

Once thought to be under the sea

Double meaning: Some consider perl to be not as good as (and thus under) C; also, pearls come from the ocean

Better than a snake

Perl is clearly better than Python (citation needed)

I seek to bring joy to many

Language was written to fill a gap in available languages; also, see any of Larry Wall's early State of the Onion talks.

You are my master, I control your slave

Programmers control computers

Read my words only where defined

A reference to both perl's use as a text processing language and to undefined variables

If you don't exist, to me, you're a liar

Undefined values evaluate as false in perl

Tell me what I am, if you'd be so kind.

The Perl language

• Yeah, I think the third line is pretty contentious too. Python all the way! :D – Joe Z. Apr 11 '15 at 20:08
• This is incorrect. Not just the explanations, the answer is not Perl. Nice try though. – warspyking Apr 11 '15 at 23:37
• If you take luster into play, the first line is wrong. Pearls have a pearly luster(obviously) and diamonds have an adamantine luster. These two shines are very different. – Xavier Stanton May 30 '18 at 4:43

Daniel has the correct answer, but it has not been accepted because one of the hints was not explained satisfactorily. I would like to offer an explanation in hope that his answer can be selected.

Read my words only where defined

The contents of variables can only be read within the scope in which they were created

• (This would probably have been better left as a comment on the relevant answer, than as an answer in its own right.) – Rubio May 2 '18 at 22:14