    <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
     <channel>
        <title>ACCU  :: A Hollywood Take on Dangling Pointers?</title>
        <link>https://members.accu.org/index.php/articles/2370</link>
        <description>Professionalism in Programming</description>
        <dc:language>en-us</dc:language> 
        <dc:creator>Administrator</dc:creator> 
        <admin:generatorAgent rdf:resource="http://www.xaraya.org" /> 
        <admin:errorReportsTo rdf:resource="mailto:webeditor@accu.org" />
       <sy:updatePeriod>hourly</sy:updatePeriod>
       <sy:updateFrequency>1</sy:updateFrequency>
       <docs>http://backend.userland.com/rss</docs>




<div class="xar-mod-head"><span class="xar-mod-title">Programming Topics + CVu Journal Vol 29, #2 - May 2017</span></div>

<table border="0" cellpadding="1" cellspacing="0">
    <tbody>
    <tr>
        <td valign="top">
            Browse in :
       </td>
       <td valign="top">

                                            <a href="https://members.accu.org/index.php/articles/">All</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c13/">Topics</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c65/">Programming</a>
<br />

                                            <a href="https://members.accu.org/index.php/articles/">All</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c76/">Journals</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c77/">CVu</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c373/">292</a>
<br />

                                            <a href="https://members.accu.org/index.php/articles/c65-373/">Any of these categories</a>

                    -                        <a href="https://members.accu.org/index.php/articles/c65+373/">All of these categories</a>
<br />
</td>
   </tr>
   </tbody>
</table>




<div class="xar-error">
   <p>
 <strong>Note:</strong> when you create a new publication type,
the articles module will automatically use the templates
<em>user-display-[publicationtype].xt</em>
and <em>user-summary-[publicationtype].xt</em>.
If those templates do not exist when you try to preview or display a new article,
you'll get this warning :-)  Please place your own templates in themes/<em>yourtheme</em>/modules/articles . The templates will get the extension .xt there. </p>
</div>
<div class="xar-norm xar-standard-box-padding">
   <h1><strong>Title:</strong>&nbsp;A Hollywood Take on Dangling Pointers?</h1>
<p><strong>Author:</strong>&nbsp;Martin Moene</p>
<p>
<strong>Date:</strong> 05 May 2017 09:20:59 +01:00 or Fri, 05 May 2017 09:20:59 +01:00</p>
<p><strong>Summary:</strong>&nbsp;Silas S. Brown tells a fable about read-only variables.</p>
<p><strong>Body:</strong>&nbsp;<p>A friend wrote <code>someString.substr(3).c_str()</code> and her code seemed to work but her colleagues were saying something about â€œgoing out of scopeâ€ that she didnâ€™t understand. So I sent her a film script.</p>

<p>The scene opens in some forgotten alleyway. Cue scary music. In walk the Silly Evil Overlord (SEO) and his Minions, all dressed in black. (Yes, Iâ€™m afraid itâ€™s only a B movie. Weâ€™re not super-rich you know.)</p>

<p>The SEO speaks. â€œAnd nowâ€, he says, â€œmy secret plans for dominating the world are well in progress. I tricked the book-shop chain into opening up a new book shop that contained just the books we wanted. And thenâ€, (turns to shout at his Minions) â€œMinion Number One! Did you accomplish your Mission for me?â€</p>

<p>â€œYes my lord. I stole a special piece of paper from the new book shop, my lord. This should tell us everything we need to know.â€</p>

<p>â€œGoodâ€, said the SEO. â€œAnd now, because I am Evil, and the audience need to see my Evilness, itâ€™s time for my first Evil Act of the Film. Mwa-hahaha!â€ (stereotypical evil laughter) â€œSeeing as we have now got what we want from the new book shop, we have no use for that book shop anymore. Mwahaha!â€ (Pulls out a small cylindrical gadget marked â€˜Scope of Destructionâ€™ and presses a button on it. Explosion sounds. Stock footage of pyrotechnics. Hole in the ground.)</p>

<p>SEO still chuckling. â€œAnd nowâ€ (pause) â€œfor the second part of my Evil Secret Plan. The piece of paper you took from the book shop contains all the details we need to break into the bank and steal a gazillion dollars.â€ (Weâ€™re in America of course. Where else would make movies this bad? Oh, Iâ€™ll probably get some flak for that.)</p>

<p>Scene changes to inside a tunnel. A sign says â€˜Bank Vaultâ€™ above a myriad flashing lights and buttons. SEO and Minions arrive.</p>

<p>â€œAnd nowâ€ says the SEO, â€œMinion Number Five! Read the special piece of paper that tells us the Secret Security Key!â€</p>

<p>Minion Number Five starts to read. â€œ<em>Breaking Into Movie Banks for Dummies</em>. The book you require is located on shelf 451 of the Book Shop.â€</p>

<p>Minion Number Four steps forward. â€œMy lord, I will go to the book shop and get it at once.â€ (runs off)</p>

<p>Minion Number Three: â€œummmm... my lord? He wonâ€™t get very far my lord.â€</p>

<p>SEO thunders â€œWHY not?â€</p>

<p>â€œBecause, um, er, my lord, pardon me please, your evilness, I mean, um,â€</p>

<p>â€œYou blew up the book shop, my lordâ€ says Minion Two.</p>

<p>SEO is indignant. â€œWe didnâ€™t have to keep the book shop around, wasting all that space! We had no use for it anymore after we took out the one sheet of paper we really needed. Besides, imagine the inconvenience of having to keep a whole book shop on my List of Things to Blow Up Before I Die. Besides, didnâ€™t Mr Black assure us that one piece of paper from the book shop was all that would be needed?â€</p>

<p>â€œWith all due respect my lordâ€ said Minion One, â€œperhaps what Mr Black really meant to say is, he can manage on one piece of paper as long as the book shop is still around for him to...â€</p>

<p>â€œWHY DIDNâ€™T Mr COMPILER pick me up on this??â€ thundered the SEO.</p>

<p>Enter Mr Complier. â€œMy lord, technically you didnâ€™t break any of my Compiler Rules. You said you needed to keep the piece of paper, and you kept it. You never said the book shop it points to has to still be around for you to check what it refers to. Thatâ€™s not in my department to spot. Maybe Mr Lint might have seen it, if youâ€™d happen to catch him on a good day, but fundamentally you must understand that, although we do try to point out your mistakes as best we can, thereâ€™s a certain class of error that always sneaks past us and -â€</p>

<p>â€œEnough!â€ thunders the SEO. â€œIâ€™ll blow YOU up next. Suggestions! There must be Something we can do.â€</p>

<p>â€œMy lordâ€, chimes in another Minion, â€œwe put a special lock on it called <code>const</code>, so it canâ€™t change. Doesnâ€™t that mean the book will have been protected from change even though you blew up the book shop?â€</p>

<p>Laughter all round. â€œWaitâ€ said the SEO, â€œI want to look into this. Minion Number Five! You didnâ€™t read the whole piece of paper, I know it. Read it again.â€</p>

<p>Minion Number Five was nervous. â€œOKâ€, he managed, â€œhere we go my lord: <em>Breaking Into Movie Banks for Dummies</em>. The book you require is located on shelf 451 of the Book Shop. The bearer of this Ticket is entitled to read the Book but not to write in it.â€</p>

<p>Silence. Camera pans around everyoneâ€™s faces.</p>

<p>Minion Three pipes up. â€œSo in other words, <code>const</code> doesnâ€™t mean it canâ€™t change, it just means they wonâ€™t let US change it with that ticket. It might still change behind our backs if someone else has a better ticket. Or aâ€¦â€ (looks nervously at the spent detonator and breaks off)</p>

<p>Mr Compiler comes back in, â€œIt means Iâ€™ll moan at you if you try to write in the bookâ€ he said. â€œUnless of course you tell me to stop moaning with a <code>Cast</code>. In which case Iâ€™ll let you write in it. And yes, of course itâ€™s no guarantee against somebody else writing in it, or moving it, or blowing it up. Thatâ€™s the trouble with those tickets. If youâ€™ve got the ticket, it doesnâ€™t mean youâ€™ve got the book, so youâ€™d better know where the book is and whoâ€™s looking after it.â€</p>

<p>â€œOhâ€ spat the SEO. â€œUseless Tickets. Next time I have an Evil Plan, Iâ€™ll have my minions copy the whole Book, not just the Ticket!â€</p>

<p>Gasps around all the Minions. â€œMy lord! Tickets can be very useful for speed, much faster than copying a whole book! You just have to make sure you know what youâ€™re doing withâ€¦â€</p>

<p>â€œSilence!â€ thundered the SEO. â€œUntil I know what Iâ€™m doing, Iâ€™m having you all copy out whole books next time before I blow up the book shop, even if that does slow me down a bit! In fact, Iâ€™m going to find some more intelligent Minions that know when to steal a book instead of copy it. But that comes later.â€</p>

<p>A Minion dares to speak up: â€œMaybe we should try to get that book anyway, my lord. I mean, it might have survived the explosion. Sometimes they do, especially if nobodyâ€™s got around to re-building something else on the same spot before we get there. Like when we vandalised the market stall in the Prequel Film That Shouldnâ€™t Be Made, remember? So it does sometimes work anyway. And if it doesnâ€™t, weâ€™ll just get nothing or gibberish, and weâ€™ll know. It canâ€™t be worse than that, can it?â€</p>

<p>Minion Number Four comes back, panting and clutching a book. â€œMy lord, guess what? Your Arch-Rival, sir, the Intelligent Evil Overlord. He persuaded the Town Planners to allocate the freed-up spot to him, and he made sure we still had the access rights. And he built an exact replica of the book shop you blew up, in the exact same place, and sure enough it had the right-looking book on shelf 451. Hot off the press too! And itâ€™s a signed copy, look at this.â€ (opens at the first page, SEO reads) â€œDear SEO, I know youâ€™ll enjoy using this special replacement edition I made specially for you. I wouldnâ€™t normally say anything, but I just had to sign it this time for the audienceâ€™s benefit. Mwa-hahaha. IEO.â€ (Letâ€™s not call him Cunning Evil Overlord because thatâ€™s how you get fired.)</p>

<p>Minion grabs book. â€œIsnâ€™t that kind of him? Iâ€™ll start using it at once, my lord. What could possibly go wrong?â€ (Jarring orchestral chord. Fade to black.) </p>

<p>Two months later my friend was unfortunately fired from her post, saying they'd criticised her for failing to work independently, but also for failure to sufficiently communicate with colleagues.</p>

<p>She found this contradictory, and I must confess I would have expected a little more clarity from an 84,000-employee German enterprise.</p>

<p>I recommended she make a point of asking future potential employers if they practise pair programming â€“ it sounds like thatâ€™s what she needs.</p>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
