{"id":15353,"date":"2012-03-15T08:56:38","date_gmt":"2012-03-15T13:56:38","guid":{"rendered":"http:\/\/www.shamusyoung.com\/twentysidedtale\/?p=15353"},"modified":"2012-03-15T10:06:46","modified_gmt":"2012-03-15T15:06:46","slug":"programming-language-vs-written-language","status":"publish","type":"post","link":"https:\/\/www.shamusyoung.com\/twentysidedtale\/?p=15353","title":{"rendered":"Programming Language vs. Written Language"},"content":{"rendered":"<p>Rick recently <a href=\"http:\/\/www.shamusyoung.com\/twentysidedtale\/?p=15344&#038;cpage=1#comment-266166\">asked<\/a>:<\/p>\n<blockquote><p>Off topic here Shamus, but I&#39;m curious. As a programmer and a writer does it bug you that writing convention has close quotes after the period at the end of a sentence?<\/p>\n<p>Vader explained &#8220;Luke, I am your father.&#8221;<\/p>\n<p>As a programmer it infuriates me that the quote reaches out past the end of the sentence. It&#39;s within the sentence, therefore logic dictates it should finish within the sentence.<\/p>\n<p>I&#39;ve even seen plenty of books\/magazines\/websites\/newspapers miss the closing quote marks completely when at the end of a paragraph. For it to be that widespread it must be a typographical rule I&#39;m unfamiliar with.\n<\/p><\/blockquote>\n<p>I&#8217;m sure a lot of this weirdness comes from the way the written word has evolved.  First as pen-on-paper, then typeset, and finally to this digital form. However, that doesn&#8217;t excuse the lapses of logic in the system.  <\/p>\n<p>One of the problems here is that we&#8217;re nesting sentences.<\/p>\n<p><!--more--><em>Vader explained to Luke that he was his father.<\/em><\/p>\n<p>That&#8217;s a complete sentence. So is this:<\/p>\n<p><em>Luke, I am your father.<\/em><\/p>\n<p>Both of them should get a full stop. My programmer logic says it should be like this:<\/p>\n<p><em>Vader explained &#8220;Luke, I am your father.&#8221;.<\/em><\/p>\n<p>So we have two full stops, one for the thing being said and another for the sentence relating who said it. Now, you could argue that the dot-quote-dot at the end just looks strange, and so leaving out a dot is a stylistic shorthand. This could be similar to the way the expression <code>b=b+1<\/code> can also be expressed as <code>b++<\/code>, simply because this is such a common thing to do. However, shorthands should be offered <em>in addition to<\/em> the long-form correct way, and dot-quote-dot is not correct according to the accepted rules.<\/p>\n<p>This becomes a problem when the ending punctuation of the quoted sentence doesn&#8217;t match the containing sentence. For example, some people like to say: <\/p>\n<p><em>Not bad for a Monday!<\/em><\/p>\n<p>Let&#8217;s say this gets on my nerves, and I want to ask if you feel the same way.  Apparently the grammatically correct way to do this is:<\/p>\n<p><em>Don&#8217;t you hate when people say &#8220;Not bad for a Monday&#8221;?<\/em><\/p>\n<p>But this obliterates the exclamation in the original quote. I think this is a much better way to do it:<\/p>\n<p><em>Don&#8217;t you hate when people say &#8220;Not bad for a Monday!&#8221;?<\/em><\/p>\n<p>Unfortunately, this is wrong, and will get red-penned by any self-respecting instructor or editor. <\/p>\n<p>Yes, it looks odd, but I suspect that&#8217;s only because this is unfamiliar to us. At least this system makes sense and follows rules that can be intuited. The rules on using quotes in written prose are dauntingly complex and filled with odd exceptions. <\/p>\n<p>However, the written word is not the only place we find annoying exceptions.  The <code>for<\/code> loop in C++ has always annoyed me. In C++, we are taught that ALL STATEMENTS MUST END WITH A SEMICOLON. Except for this one spot in the humble for loop:<\/p>\n<pre lang\"c\">\r\nfor ( x=0; x&lt;3; x++) \r\n  cout < < \"The value of X is:\" << x << endl;\r\n<\/pre>\n<p>The for loop begins with three expressions inside of the parenthesis.  The first is executed once, when the loop begins. Then the second is evaluated, and the loop will repeat until this expression evaluates to false.  The third is performed every time the program reaches the end of the loop. But there's no semicolon after that third expression.  <\/p>\n<p>In defense of C++, I think you can throw a semicolon in there like this:<\/p>\n<pre lang\"c\">\r\nfor ( x=0; x&lt;3; x++;) \r\n  cout < < \"The value of X is:\" << x << endl;\r\n<\/pre>\n<p>I'm pretty sure the compiler won't complain.  However, your fellow coders will. A lot. So don't do this unless you want to end up getting shivved in the break room. (I can't test this because I haven't installed a compiler since re-installing my OS. I didn't realize this until just now.  I think this is the longest I've been without a compiler since 1994 or so.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Rick recently asked: Off topic here Shamus, but I&#39;m curious. As a programmer and a writer does it bug you that writing convention has close quotes after the period at the end of a sentence? Vader explained &#8220;Luke, I am your father.&#8221; As a programmer it infuriates me that the quote reaches out past the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-15353","post","type-post","status-publish","format-standard","hentry","category-rants"],"_links":{"self":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/15353","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=15353"}],"version-history":[{"count":0,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=\/wp\/v2\/posts\/15353\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=15353"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=15353"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shamusyoung.com\/twentysidedtale\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=15353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}