    <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  :: ACCU York â€“ May 2020</title>
        <link>https://members.accu.org/index.php/journals/2806</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>


        <h2>Journal Articles</h2>


<div class="xar-mod-head"><span class="xar-mod-title">CVu Journal Vol 32, #3 - July 2020</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/journals/">All</a>

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

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

                     &gt;                         <a href="https://members.accu.org/index.php/journals/c412/">323</a>
                    (11)
<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;ACCU York â€“ May 2020</h1>
<p><strong>Author:</strong>&nbsp;Bob Schmidt</p>
<p>
<strong>Date:</strong> 06 July 2020 17:01:47 +01:00 or Mon, 06 July 2020 17:01:47 +01:00</p>
<p><strong>Summary:</strong>&nbsp;Frances Buontempo reports from a local ACCU group.</p>
<p><strong>Body:</strong>&nbsp;<p>ACCU York held a virtual workshop on May 28th. Gareth LLoyd led the session. We were given a coding challenge, which has been used has an interview question:</p>

<p class="blockquote">Given a string, like &quot;Can you reverse these words?&quot;, write code to reverse the words in the string to get &quot;words? these reverse you Can&quot; without extra memory allocation.</p>

<p>That caused a degree of discussion, and may have been off-putting for people more used to other languages. With hindsight, I wonder if we could have first reversed the words in a string by any means, then maybe if people had used a vector to copy the words into, then upped our game to avoid the extra copies.</p>

<p>We discussed possible approaches and somebody waved a copy of K&amp;R around (<a href="https://en.wikipedia.org/wiki/The_C_Programming_Language">https://en.wikipedia.org/wiki/The_C_Programming_Language</a>: <em>The C Programming Language</em> by Brian Kernighan and Dennis Ritchie). I love this book, but it set me thinking about C-style pointers to solve problems.</p>

<p>We were encouraged to try out the problem in Godbolt: <a href="https://godbolt.org/z/HpVcXw">https://godbolt.org/z/HpVcXw</a> This contained a main and a function to fill in.</p>

<table class="sidebartable">
	<tr>
		<td>
			<pre class="programlisting">
#include &lt;string&gt;
#include &lt;cassert&gt;
void reverseWords(std::string &amp;) noexcept
{
  // code here
}
int main()
{
  using namespace std::string_literals;
  auto str = &quot;Can you reverse these words?&quot;s;
  reverseWords(str); 
    // Use no extra allocated memory
  assert(str == &quot;words? these reverse you Can&quot;);
}
			</pre>
		</td>
	</tr>
	<tr>
		<td class="title">Listing 1</td>
	</tr>
</table>

<p>Had I followed instructions and done what I was told, passing standard strings around may have stopped me making a mess on paper with a pen, attempting to come out with neat K&amp;R style <code>char *s</code> and <code>char * d </code>algorithms. Furthermore, the assert would have a provided a way to check what I was doing. Oh well.</p>

<p>Most of us came out with something similar â€“ using an index which we had to increment, or a pointer, to walk the string. Without spoiling the workshop for people who havenâ€™t done this yet, the point emerged that C++ has many algorithms that make your life much easier.</p>

<p>We had a long discussion afterwards. In particular, using the â€˜sâ€™ suffix, from the <code>string_literals</code> namespace led to a detailed talk about argument dependent lookup â€“ ADL. Again, this may have put off some newer C++ programmers. However, the flow of the examples and chance to talk was very well balanced. If youâ€™ve not had the chance to attend ACCU York yet, the next meetup will probably be online too â€“ join in. Theyâ€™re a friendly bunch.</p>

<p class="bio"><span class="author"><b>Frances Buontempo</b></span> Frances has a BA in Maths + Philosophy, an MSc in Pure Maths and a PhD technically in Chemical Engineering, but mainly programming and learning about AI and data mining. She learnt to program by reading the manual for her Dadâ€™s BBC model B machine.</p>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
