# If Shakespeare wrote C++

**URL:** https://boards.straightdope.com/t/if-shakespeare-wrote-c/63580
**Category:** Miscellaneous and Personal Stuff I Must Share
**Created:** [April 28, 2001, 12:36am UTC](https://boards.straightdope.com/t/if-shakespeare-wrote-c/63580 "2001-04-28T00:36:09Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![BlackKnight](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@BlackKnight](https://boards.straightdope.com/u/BlackKnight)
#### Post date: [April 28, 2001, 12:36am UTC](https://boards.straightdope.com/t/if-shakespeare-wrote-c/63580/1 "2001-04-28T00:36:09Z")

</div>

if(I-\>compare(thee,summer-\>day)) {

assert( (getLovelyValue(thee)\>getLovelyValue(summer-\>day)) && (getTemperateValue(thee)\>getTemperateValue(summer-\>day)) );  
roughWinds.shake(May-\>darlingBuds);  
summer-\>lease-\>date.tooShort = true;

if(sometime) { Heaven-\>eye.shine(tooHot); }  
if(often) { Heaven-\>eye.goldComplexion = dimmed; }

if( (sometime) && ( chance || !trimmed(Nature-\>changingCourse) ) )  
Fair-\>fair.decline();  
}

assert( (thee-\>EternalSummer.shallFade()==false) && (losePosession(thee-\>Fair)==NULL) );

if( EternalLines-\>time(thee-\>growst()) ) {  
assert( !Death-\>brag(thee,Death-\>shade-\>wandrest(thee))) );  
}

if( Men-\>canBreath() && Eyes-\>canSee() ) {  
this-\>lives=true;  
this-\>givesLife(thee);  
}

}

(I know, I know, the formatting sucks. Actually, the entire thing kinda sucks. I’d appreciate any suggestions for improvement.)

---

<div class="post-metadata">

### Author: ![Marcus](https://avatars.discourse-cdn.com/v4/letter/m/85e7bf/32.png) [@Marcus](https://boards.straightdope.com/u/Marcus)
#### Post date: [April 28, 2001, 2:09am UTC](https://boards.straightdope.com/t/if-shakespeare-wrote-c/63580/2 "2001-04-28T02:09:18Z")

</div>

```auto

if ( mind.nobler ) {
	outrageous_fortune.slings = new Slings();
	outrageous_fortune.arrows = new Arrows();
	this.suffer ( outrageous_fortune.slings, outrageous_fortune.arrows );
}

```

---

<div class="post-metadata">

### Author: ![BlackKnight](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@BlackKnight](https://boards.straightdope.com/u/BlackKnight)
#### Post date: [April 28, 2001, 2:30am UTC](https://boards.straightdope.com/t/if-shakespeare-wrote-c/63580/3 "2001-04-28T02:30:08Z")

</div>

Very cool, Marcus. I like it.

So, who wants to help me do the entirety of “Hamlet”? 😉

---

<div class="post-metadata">

### Author: ![pesch](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/pesch/32/4925_2.png) [@pesch](https://boards.straightdope.com/u/pesch)
#### Post date: [April 28, 2001, 2:54am UTC](https://boards.straightdope.com/t/if-shakespeare-wrote-c/63580/4 "2001-04-28T02:54:33Z")

</div>

Ladies and gentlemen, we’ve just witnessed the birth of a new Internet e-mail message.

Give it a weekannahalf before we’ll see it again, stripped of attribution, with a title like “Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:LOOK@THIS:).”

Good work, **BlackKnight**

---

<div class="post-metadata">

### Author: ![BlackKnight](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@BlackKnight](https://boards.straightdope.com/u/BlackKnight)
#### Post date: [April 28, 2001, 3:05am UTC](https://boards.straightdope.com/t/if-shakespeare-wrote-c/63580/5 "2001-04-28T03:05:11Z")

</div>

> [@](#):
>
> \*Originally posted by pesch \*  
> **Good work, BlackKnight**

Thank you!

---

<div class="post-metadata">

### Author: ![dropzone](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dropzone/32/7515_2.png) [@dropzone](https://boards.straightdope.com/u/dropzone)
#### Post date: [April 28, 2001, 4:46am UTC](https://boards.straightdope.com/t/if-shakespeare-wrote-c/63580/6 "2001-04-28T04:46:42Z")

</div>

Hey! This can be fun. Except I’m seeing why I avoid c++.

Let’s try it in good ol’ linenumber BASIC:

10 PRINT “Thank you for playing 'To be or not to be?”  
20 INPUT “What is your Nobility Factor (0 to 100)”; NOBLE%  
30 IF NOBLE% \> 50 THEN GOSUB 1000 ELSE GOSUB 2000  
1000 PRINT “You will now suffer the slings and arrows of”  
1010 PRINT “outrageous fortune. Please play again!”  
1020 RETURN  
2000 PRINT “Sleep, perchance to dream.”  
2010 END

---

<div class="post-metadata">

### Author: ![BlackKnight](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@BlackKnight](https://boards.straightdope.com/u/BlackKnight)
#### Post date: [April 28, 2001, 5:35am UTC](https://boards.straightdope.com/t/if-shakespeare-wrote-c/63580/7 "2001-04-28T05:35:06Z")

</div>

> [@](#):
>
> \*Originally posted by BlackKnight \*  
> **if( Men-\>canBreath() && Eyes-\>canSee() ) {  
> this-\>lives=true;  
> this-\>givesLife(thee);  
> }**

I just realized this should be a _while_ loop, not an _if_ statement.

It should look like this:

```auto

while( Men->canBreath() && Eyes->canSee() ) {
  this->lives=true;
  this->givesLife(thee);
}

```

---

<div class="post-metadata">

### Author: ![BlackKnight](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@BlackKnight](https://boards.straightdope.com/u/BlackKnight)
#### Post date: [April 28, 2001, 8:02pm UTC](https://boards.straightdope.com/t/if-shakespeare-wrote-c/63580/8 "2001-04-28T20:02:10Z")

</div>

Oh come on. I _know_ there are more nerds on this board than just me, dropzone, and Marcus.

---

<div class="post-metadata">

### Author: ![TheNerd](https://avatars.discourse-cdn.com/v4/letter/t/858c86/32.png) [@TheNerd](https://boards.straightdope.com/u/TheNerd)
#### Post date: [April 28, 2001, 8:36pm UTC](https://boards.straightdope.com/t/if-shakespeare-wrote-c/63580/9 "2001-04-28T20:36:23Z")

</div>

Oh, I appreciate it. Very much. In fact, I suggest that you go buy yourself a “code poet” shirt from [http://www.thinkgeek.com](http://www.thinkgeek.com)

I like mine.

---

<div class="post-metadata">

### Author: ![Mercutio](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@Mercutio](https://boards.straightdope.com/u/Mercutio)
#### Post date: [April 28, 2001, 10:10pm UTC](https://boards.straightdope.com/t/if-shakespeare-wrote-c/63580/10 "2001-04-28T22:10:00Z")

</div>

::goes to pick up a copy of _HTML for Dumbasses_::

---

<div class="post-metadata">

### Author: ![BlackKnight](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@BlackKnight](https://boards.straightdope.com/u/BlackKnight)
#### Post date: [April 28, 2001, 10:27pm UTC](https://boards.straightdope.com/t/if-shakespeare-wrote-c/63580/11 "2001-04-28T22:27:17Z")

</div>

> [@](#):
>
> \*Originally posted by TheNerd \*  
> \*\*Oh, I appreciate it. Very much. In fact, I suggest that you go buy yourself a “code poet” shirt from [http://www.thinkgeek.com](http://www.thinkgeek.com)  
> I like mine. \*\*

Thanks for the idea!  
Hmm, I wonder if I could get a t-shirt specially made with my code-poem on it. 🙂

---

<div class="post-metadata">

### Author: ![ThreeLeggedBob](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@ThreeLeggedBob](https://boards.straightdope.com/u/ThreeLeggedBob)
#### Post date: [April 28, 2001, 11:46pm UTC](https://boards.straightdope.com/t/if-shakespeare-wrote-c/63580/12 "2001-04-28T23:46:39Z")

</div>

## May I try Java? It’s nearly as arcane…

package eng.midd;

public class Sonnet {  
Bard will = new Bard();  
Mistress she = new Mistress(will);  
Boolean foo;

public static void main(String args) {  
foo = (she.eyes() != SUN);  
foo = (CORAL.red \> Color.red(she.lips()));  
if (HAIRS == WIRES) {  
she.growWires(Black);  
}  
}  
}

* * *

That’s all I can remember without my Norton Anthology. You get the idea.

TLB

---

<div class="post-metadata">

### Author: ![Bill\_H](https://avatars.discourse-cdn.com/v4/letter/b/a5b964/32.png) [@Bill\_H](https://boards.straightdope.com/u/Bill_H)
#### Post date: [April 28, 2001, 11:51pm UTC](https://boards.straightdope.com/t/if-shakespeare-wrote-c/63580/13 "2001-04-28T23:51:05Z")

</div>

```auto

Romeo() {
   2 * allTheHeavens[fairestStars]();
   while( havingSome.business ) {
     do {
        entreat(herEyes);
        theirSpheres[twinkle]();
     } until(theyReturn);
   }
}

```

---

<div class="post-metadata">

### Author: ![BlackKnight](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@BlackKnight](https://boards.straightdope.com/u/BlackKnight)
#### Post date: [April 29, 2001, 1:35am UTC](https://boards.straightdope.com/t/if-shakespeare-wrote-c/63580/14 "2001-04-29T01:35:06Z")

</div>

Thank you Bill, TLB. Java is certainly welcome here! I like Java. I should have titled the thread “If Shakespeare wrote code” but, as usual, I wasn’t thinking.

Here’s a short but kind of cute C++ one:

```auto

double Double,toil,trouble;
Fire->burn();
Cauldrun->buble();

```

---

<div class="post-metadata">

### Author: ![dropzone](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dropzone/32/7515_2.png) [@dropzone](https://boards.straightdope.com/u/dropzone)
#### Post date: [April 29, 2001, 3:12am UTC](https://boards.straightdope.com/t/if-shakespeare-wrote-c/63580/15 "2001-04-29T03:12:01Z")

</div>

I almost said, “Hey! ‘Double’ is a reserved word! You can’t use it as a variable name!” until I noticed the capitalization.

Gawd, I hate case-sensitive languages.

---

<div class="post-metadata">

### Author: ![dropzone](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dropzone/32/7515_2.png) [@dropzone](https://boards.straightdope.com/u/dropzone)
#### Post date: [April 29, 2001, 3:16am UTC](https://boards.straightdope.com/t/if-shakespeare-wrote-c/63580/16 "2001-04-29T03:16:44Z")

</div>

> [@](#):
>
> \*Originally posted by BlackKnight \*  
> **Cauldrun-\>buble();**

Further support for one the great questions of our time, “Why can’t programmers spell?”

---

<div class="post-metadata">

### Author: ![Creaky](https://avatars.discourse-cdn.com/v4/letter/c/e68b1a/32.png) [@Creaky](https://boards.straightdope.com/u/Creaky)
#### Post date: [April 29, 2001, 5:44am UTC](https://boards.straightdope.com/t/if-shakespeare-wrote-c/63580/17 "2001-04-29T05:44:30Z")

</div>

Oops. I thought that this thread was referring to what Shakespeare got on his first term paper.

---

<div class="post-metadata">

### Author: ![Daemon](https://avatars.discourse-cdn.com/v4/letter/d/c6cbf5/32.png) [@Daemon](https://boards.straightdope.com/u/Daemon)
#### Post date: [April 29, 2001, 8:03am UTC](https://boards.straightdope.com/t/if-shakespeare-wrote-c/63580/18 "2001-04-29T08:03:08Z")

</div>

2b\<or\>\<not\>2b  
show b

(Not a real language, but it would work)

---

<div class="post-metadata">

### Author: ![Daemon](https://avatars.discourse-cdn.com/v4/letter/d/c6cbf5/32.png) [@Daemon](https://boards.straightdope.com/u/Daemon)
#### Post date: [April 29, 2001, 8:13am UTC](https://boards.straightdope.com/t/if-shakespeare-wrote-c/63580/19 "2001-04-29T08:13:11Z")

</div>

Let x = 2b \<or\> (\<not\> 2b)  
Print x

Hey guys, using boolean logic, and assuming b = 0 or 1, what are the possible solutions for x?

---

<div class="post-metadata">

### Author: ![BlackKnight](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@BlackKnight](https://boards.straightdope.com/u/BlackKnight)
#### Post date: [April 29, 2001, 8:11pm UTC](https://boards.straightdope.com/t/if-shakespeare-wrote-c/63580/20 "2001-04-29T20:11:57Z")

</div>

> [@](#):
>
> \*Originally posted by dropzone \*  
> \*\*
> 
> > [@](#):
> >
> > \*Originally posted by BlackKnight \*  
> > **Cauldrun-\>buble();**
> 
> Further support for one the great questions of our time, “Why can’t programmers spell?” \*\*

D’oh!

(There needs to be a wincing “D’oh!” smiley for when people screw up embarassingly.)

[Next page](https://boards.straightdope.com/t/if-shakespeare-wrote-c/63580.md?page=2)
