Welcome to WebmasterWorld Guest from 54.209.227.199

Forum Moderators: open

If you're happy and you know it

clap your hands!

     
4:57 pm on May 9, 2019 (gmt 0)

Moderator from US 

WebmasterWorld Administrator lifeinasia is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 10, 2005
posts:5832
votes: 182


As a developer, I am very offended that the lyricist did not include proper exception handling for people who are:
- not happy, or
- people who are but don't know it
5:02 pm on May 9, 2019 (gmt 0)

Senior Member

WebmasterWorld Senior Member Top Contributors Of The Month

joined:Apr 1, 2016
posts:2548
votes: 719


What? Else do nothing. But it needn't be explicitly declared.
5:33 pm on May 9, 2019 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:15636
votes: 795


Not every IF requires an ELSE. You’re postulating
IF (happy && knowit)
  { clap hands }
ELSE
  { take some other action}

Or perhaps better
IF (emotional state is known)
  {
  IF (emotion == happy)
    {clap hands}
  ELSE
    {take action A}
  }
ELSE
  {take action B}

But it could just as well be
IF (all conditions are met)
  {clap hands}

with no ELSE about it, unless you particularly need to verify that the conditions have at least been evaluated. I believe my php error logs are filled with “thing I was told to look for was not found” when not-finding is a perfectly legitimate result. It’s like saying “if it is raining, carry an umbrella”, and if it isn’t raining, then don’t--but don’t start yammering about error conditions just because no rain was detected.

I'm more concerned with the “happy and you know it” aspect. What is the difference between “I am not happy” and “I don’t know whether I am happy”? Is it possible to be happy and not know it? For best results, the condition should be expressed as “if you know that you’re happy”--but even that is redundant, since an emotional state only exists if it is perceived. The construction only becomes meaningful if you’re evaluating someone else’s happiness. And then you get into arguments about how dare you assume I’m happy when I, the direct agent of the relevant emotional state, say I’m not?
6:01 pm on May 9, 2019 (gmt 0)

Moderator from US 

WebmasterWorld Administrator lifeinasia is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 10, 2005
posts:5832
votes: 182


Is it possible to be happy and not know it?
Apparently so, as the song requires both conditions (being happy, knowing that you're happy) be met.

Granted, an ELSE is not explicitly required. But in the real world, I worry about all those OCD folks that don't meet the conditionals and have to sit listening to the rest of the song waiting for instructions.

And from a data perspective, if the person doesn't clap, then you're stuck with a NULL value as you don't know if:
- the person is not happy
- the person is happy, but doesn't know it
- the person's happiness is indeterminate
- the person didn't understand the instructions
- the person understood the instructions, but can't comply (e.g., double amputee)
- the person understood the instructions, but refuses to comply
And I'm sure there are other scenarios that I haven't though of.
6:25 pm on May 9, 2019 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:15636
votes: 795


ONERR()
  { output “I dunno, something went wrong” }
6:54 pm on May 9, 2019 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member tangor is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Nov 29, 2005
posts:9714
votes: 925


IF ("happy" = " ")
DO
(beer+1)
UNTIL (" " = "happy)
7:29 pm on May 9, 2019 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:15636
votes: 795


Seriously, though, it’s a two-step process. After the IF happy THEN claphands part, the next step is
IF (!claphands)
  { nursery school teacher == further investigation of error }
9:58 pm on May 9, 2019 (gmt 0)

Moderator from GB 

WebmasterWorld Administrator mack is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:June 15, 2001
posts:7833
votes: 90


Nothing beats a bit of coder humour :-)

Mack.
11:40 pm on May 9, 2019 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:15636
votes: 795


Nothing beats a bit of coder humour
I will never, ever tire of

  When the lines on your screen
  Are not quite what they seem
  That’s a moiré


... even if I am surrounded by young squirts who have no idea what that means.
12:48 am on May 10, 2019 (gmt 0)

Senior Member

WebmasterWorld Senior Member Top Contributors Of The Month

joined:Apr 1, 2016
posts:2548
votes: 719


... even if I am surrounded by young squirts who have no idea what that means.

I'm far from being a young squirt, but I had to look it up.
here to save others some time: [en.wikipedia.org...]

Clever!
8:08 am on May 13, 2019 (gmt 0)

Senior Member from GB 

WebmasterWorld Senior Member piatkow is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 5, 2006
posts:3456
votes: 62


But, like me, it was moiré that you looked up, not the song.
10:17 am on May 14, 2019 (gmt 0)

Full Member

10+ Year Member Top Contributors Of The Month

joined:July 8, 2005
posts:337
votes: 5


This is why I love WW!
11:08 am on May 14, 2019 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member tangor is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Nov 29, 2005
posts:9714
votes: 925


And all of us ichthyologists are equally thrilled that morie eels are remembered!
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members