<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9 Forums - Coffeehouse - Top &quot;Malicious&quot; Features</title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Forums/rss"></atom:link>
	<image>
		<url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
		<title>Channel 9 Forums - Coffeehouse - Top &quot;Malicious&quot; Features</title>
		<link>http://channel9.msdn.com/Forums</link>
	</image>
	<description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
	<link>http://channel9.msdn.com/Forums</link>
	<language>en</language>
	<pubDate>Sun, 26 May 2013 04:52:34 GMT</pubDate>
	<lastBuildDate>Sun, 26 May 2013 04:52:34 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<c9:totalResults>25</c9:totalResults>
	<c9:pageCount>-25</c9:pageCount>
	<c9:pageSize>-1</c9:pageSize>
	<item>
		<title>Coffeehouse - Top &quot;Malicious&quot; Features</title>
		<description><![CDATA[<p>People often talk what features are missing from their language of choice but what about vice versa?&nbsp;So here's a fun and subjective question, at the turn of the year (thought up during a hang-over, so bear with me):</p><ul><li><em>What do you think are the most malicious programming language features ever invented?</em> </li></ul><p>Go ahead and be creative and controversial in your interpretation of what a malicious programming language feature is, e.g.&nbsp;unproductive,&nbsp;unsafe,&nbsp;insecure,&nbsp;incomprehensible,&nbsp;ambiguous,&nbsp;unpredictable,&nbsp;verbose,&nbsp;slow, superfluous, complex, unimplementable, etc.</p><p>Some random possible more-or-less boring candidates:</p><ul><li>goto [control-flow, low-level] (suitable for low-level language, but perhaps not high-level ones - or perhaps only for a low-level named subset) </li><li>null [data-modeling, correctness] (imprecise types leading to undesired run-time value propagation) </li></ul><p>and some perhaps more controversial candidates for good/bad measure:</p><ul><li>checked exceptions [control-flow] (superfluous exception handling) </li><li>unchecked exceptions [control-flow] (missing exception handling; mitigated by good tools) </li><li>method overloading [ambiguity] </li><li>excessive <a href="http://stackoverflow.com/questions/7615214/in-javascript-why-is-0-equal-to-false-but-not-false-by-itself">i</a>mplicit type coercions&nbsp;(and equality comparison) (e.g. <a href="http://stackoverflow.com/questions/7615214/in-javascript-why-is-0-equal-to-false-but-not-false-by-itself">javascript truth table</a>) </li></ul><p>This is realizing of course that a feature might be considered undesired in one language whilst not so in another, depending on what the language objectives are. There may be candidates might &quot;interact&quot; poorly with one group of features but not another.</p><p>In recent times the notion of language ergonomics has also been proposed to describe and justify language design.</p><p><a href="http://stackoverflow.com/questions/1995113/strangest-language-feature">Some inspiration</a>.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/504f9a754e8d4dfe8f86a129017c645c#504f9a754e8d4dfe8f86a129017c645c</link>
		<pubDate>Sun, 16 Dec 2012 23:04:57 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/504f9a754e8d4dfe8f86a129017c645c#504f9a754e8d4dfe8f86a129017c645c</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>25</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Top &quot;Malicious&quot; Features</title>
		<description><![CDATA[<p>I don't know if I could include parts of the .Net framework into this. But, the&nbsp;ICloneable interface is really bad.</p><p>-Josh</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/321d07a705eb48e2bbd8a12a0034cb36#321d07a705eb48e2bbd8a12a0034cb36</link>
		<pubDate>Mon, 17 Dec 2012 03:12:12 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/321d07a705eb48e2bbd8a12a0034cb36#321d07a705eb48e2bbd8a12a0034cb36</guid>
		<dc:creator>Joshua Ross</dc:creator>
		<slash:comments>25</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Jsoh/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Top &quot;Malicious&quot; Features</title>
		<description><![CDATA[<p><span dir="auto">HRESULT</span></p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/3cead0217d4e484f8b4ea12a0038d079#3cead0217d4e484f8b4ea12a0038d079</link>
		<pubDate>Mon, 17 Dec 2012 03:26:51 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/3cead0217d4e484f8b4ea12a0038d079#3cead0217d4e484f8b4ea12a0038d079</guid>
		<dc:creator>Proton2</dc:creator>
		<slash:comments>25</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Proton2/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Top &quot;Malicious&quot; Features</title>
		<description><![CDATA[<p>I don't know why, but, I get true after</p><p>var temp = double.parse(&quot;0&quot;);</p><p>(temp == double.NaN)</p><p>I haven't spend extra on this. So, this may not be a real case.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/efecb961dde94df4a3eba12a005acbc8#efecb961dde94df4a3eba12a005acbc8</link>
		<pubDate>Mon, 17 Dec 2012 05:30:34 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/efecb961dde94df4a3eba12a005acbc8#efecb961dde94df4a3eba12a005acbc8</guid>
		<dc:creator>magicalclick</dc:creator>
		<slash:comments>25</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/magicalclick/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Top &quot;Malicious&quot; Features</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Top-Malicious-Features/3cead0217d4e484f8b4ea12a0038d079">3 hours&nbsp;ago</a>, <a href="/Niners/Proton2">Proton2</a> wrote</p><p><span dir="auto">HRESULT</span></p><p></p></div></blockquote>That's not a language feature<p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/401d96c5dce44c8eae86a12a0077f375#401d96c5dce44c8eae86a12a0077f375</link>
		<pubDate>Mon, 17 Dec 2012 07:16:43 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/401d96c5dce44c8eae86a12a0077f375#401d96c5dce44c8eae86a12a0077f375</guid>
		<dc:creator>Ion Todirel</dc:creator>
		<slash:comments>25</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Ion Todirel/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Top &quot;Malicious&quot; Features</title>
		<description><![CDATA[<p>weak type systems, non-optional-GC, error codes</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/3618d711338245929793a12a0078aa1e#3618d711338245929793a12a0078aa1e</link>
		<pubDate>Mon, 17 Dec 2012 07:19:19 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/3618d711338245929793a12a0078aa1e#3618d711338245929793a12a0078aa1e</guid>
		<dc:creator>Ion Todirel</dc:creator>
		<slash:comments>25</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Ion Todirel/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Top &quot;Malicious&quot; Features</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Top-Malicious-Features/401d96c5dce44c8eae86a12a0077f375">16 minutes&nbsp;ago</a>, <a href="/Niners/Ion%20Todirel">Ion Todirel</a> wrote</p><p>*snip*That's not a language feature </p></div></blockquote><p></p><p>&nbsp;</p><p>True dat. Exceptions are though.</p><p>&nbsp;</p><p>&quot;In .NET, HRESULT/IErrorInfo error codes are translated into CLR exceptions when transitioning from native to managed code; and CLR exceptions are translated to HRESULT/IErrorInfo error codes when transitioning from managed to native <a title="Component Object Model" href="/wiki/Component_Object_Model">COM</a> code.&quot;</p><p>How about:</p><p>Parentheses. Especially in Lisp.</p><p>example:&nbsp;</p><p>&nbsp;</p><p>&nbsp;&nbsp; (<strong>defun</strong> factorial (x)</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (<strong>if</strong> (<strong>eql</strong> x 0)</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (* x (factorial (- x 1))))) <u>))</u></p><p><u></u>&nbsp;</p><p><u></u>&nbsp;</p><p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/eccde2e191274362a1ada12a0081c5a1#eccde2e191274362a1ada12a0081c5a1</link>
		<pubDate>Mon, 17 Dec 2012 07:52:29 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/eccde2e191274362a1ada12a0081c5a1#eccde2e191274362a1ada12a0081c5a1</guid>
		<dc:creator>Proton2</dc:creator>
		<slash:comments>25</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Proton2/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Top &quot;Malicious&quot; Features</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Top-Malicious-Features#ceccde2e191274362a1ada12a0081c5a1">Proton2</a>: What's wrong with parentheses? Deep nesting on the other hand...</p><p>-Josh</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/26cb034d8fc84d3cb064a12a00992847#26cb034d8fc84d3cb064a12a00992847</link>
		<pubDate>Mon, 17 Dec 2012 09:17:37 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/26cb034d8fc84d3cb064a12a00992847#26cb034d8fc84d3cb064a12a00992847</guid>
		<dc:creator>Joshua Ross</dc:creator>
		<slash:comments>25</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Jsoh/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Top &quot;Malicious&quot; Features</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Top-Malicious-Features#ceccde2e191274362a1ada12a0081c5a1">Proton2</a>: Actually you might as well add the whole of Lisp. Reverse Polish notation? What kind of sadist creates a language based on that?</p><p>Herbie</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/1ce1aacef6464dc3ad1ea12a009ab48e#1ce1aacef6464dc3ad1ea12a009ab48e</link>
		<pubDate>Mon, 17 Dec 2012 09:23:15 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/1ce1aacef6464dc3ad1ea12a009ab48e#1ce1aacef6464dc3ad1ea12a009ab48e</guid>
		<dc:creator>Herbie Smith</dc:creator>
		<slash:comments>25</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Dr Herbie/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Top &quot;Malicious&quot; Features</title>
		<description><![CDATA[<p>Reading HRESULTs is like playing that internet sensation game, The Sith Sense backwards. Lord Sith, is my result a success or failure?</p><p>-Josh</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/bf37597ede5244899ec1a12a009dd4ee#bf37597ede5244899ec1a12a009dd4ee</link>
		<pubDate>Mon, 17 Dec 2012 09:34:38 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/bf37597ede5244899ec1a12a009dd4ee#bf37597ede5244899ec1a12a009dd4ee</guid>
		<dc:creator>Joshua Ross</dc:creator>
		<slash:comments>25</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Jsoh/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Top &quot;Malicious&quot; Features</title>
		<description><![CDATA[<p>Not a language but a framework feature, but jQuery's inArray() method is the most idiotic thing I've ever seen. It returns -1 if the value is not in the array, and the value's index if it is.</p><p>Despite the method name suggesting that a boolean is returned, and javascript treating nonzero as true*, if you want to know if a value is <em>in</em> the <em>array</em>, you have to test if the result is not equal to -1, which is one of the least intuitive things I've ever come across.</p><p>Also, since its function is exactly the same as Array.IndexOf() and since&nbsp;<em>the index is what it is actually returning,</em>&nbsp;why didn't they just call it IndexOf()?</p><p>&nbsp;</p><p>&nbsp;</p><p>*more or less. The fact alone that these kinds of caveats are necessary makes loose typing my top malicious language feature. <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-4.gif?v=c9' alt='Tongue Out' /></p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/f623c74a56d04032adcba12a00b48f1e#f623c74a56d04032adcba12a00b48f1e</link>
		<pubDate>Mon, 17 Dec 2012 10:57:23 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/f623c74a56d04032adcba12a00b48f1e#f623c74a56d04032adcba12a00b48f1e</guid>
		<dc:creator>Bas</dc:creator>
		<slash:comments>25</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Bas/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Top &quot;Malicious&quot; Features</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Top-Malicious-Features/1ce1aacef6464dc3ad1ea12a009ab48e">1 hour&nbsp;ago</a>, <a href="/Niners/Dr%20Herbie">Dr Herbie</a> wrote</p><p>@<a href="/Forums/Coffeehouse/Top-Malicious-Features#ceccde2e191274362a1ada12a0081c5a1">Proton2</a>: Actually you might as well add the whole of Lisp. Reverse Polish notation? What kind of sadist creates a language based on that?</p><p>Herbie</p><p></p></div></blockquote><p></p><p>Lots of stack-machine languages are based on Reverse Polish Notation, including Forth, MSIL, HP's RPN. But there's nothing reverse about Lisp.</p><p>@<a href="/Forums/Coffeehouse/Top-Malicious-Features#ceccde2e191274362a1ada12a0081c5a1">Proton2</a>: before IDEs started providing substantial help with that, it was common to use a &quot;final square bracket&quot; that closed any open parenthesis left.</p><p>(cons a (cons b (cons (c nil)]</p><p>Slightly more dangerous than a having a live piranha in your pocket, but it was a life saver.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/f4f7c60352d84eb786d0a12a00b6e6b6#f4f7c60352d84eb786d0a12a00b6e6b6</link>
		<pubDate>Mon, 17 Dec 2012 11:05:55 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/f4f7c60352d84eb786d0a12a00b6e6b6#f4f7c60352d84eb786d0a12a00b6e6b6</guid>
		<dc:creator>Blue Ink</dc:creator>
		<slash:comments>25</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Blue Ink/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Top &quot;Malicious&quot; Features</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Top-Malicious-Features#cf4f7c60352d84eb786d0a12a00b6e6b6">Blue Ink</a>: Ah, I think I was thinking of RPL! &nbsp;</p><p>Herbie</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/7e23a4b1af37470dae77a12a00b7e39e#7e23a4b1af37470dae77a12a00b7e39e</link>
		<pubDate>Mon, 17 Dec 2012 11:09:31 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/7e23a4b1af37470dae77a12a00b7e39e#7e23a4b1af37470dae77a12a00b7e39e</guid>
		<dc:creator>Herbie Smith</dc:creator>
		<slash:comments>25</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Dr Herbie/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Top &quot;Malicious&quot; Features</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Top-Malicious-Features/3cead0217d4e484f8b4ea12a0038d079">8 hours&nbsp;ago</a>, <a href="/Niners/Proton2">Proton2</a> wrote</p><p>HRESULT</p><p></p></div></blockquote><p></p><p>That's a bit unfair. The Win32 apis were built with needing to propagate errors across different language barriers (i.e. so you could create MyAwesomeProgram in VB or Pascal or Fortran rather than being forced to use C/C&#43;&#43; in order to interoperate with the Microsoft libraries written in C/C&#43;&#43;).</p><p>You can't unwind an exception over someone else's code (because you don't know how they are compiled), so you can't use exceptions, heap-pointer based exceptions (like C&#43;&#43;) are also bad because it restricts what you can throw (i.e. you can't throw an out-of-memory exception if you'd need to allocate an OOM exception to throw one)</p><p>You also can't intern stuff like Java and C# because you don't have a common runtime (because some of the code in the process is Win32 C/C&#43;&#43;, some is MyAwesomeProgram.vb and a third party component it is using is in delphi pascal, all interacting with a lovely frontend written in flash).</p><p>So sadly Microsoft only has one thing left: A global enum of all possible errors, i.e. HRESULTs.</p><p>Basically what I'm saying is that HRESULTs are dirty, but that's because they're intended for crossing language or API boundaries. Microsoft never intended or expected you to use them internally. They expected you to write code like this:</p><p>MyAwesomeVoid MyAwesomeFunc(AwesomeParam1 awesomeParams...)<br>{</p><p>&nbsp; SuperDoubleAwesomePinvoke(awesomeParams);</p><p>}</p><p>And your runtime would do something like:</p><p>void CallOut( std::vector&lt;AwesomeStuff&gt; awesomes )<br>{<br>&nbsp; IEnumerable&lt;void*&gt; nativePtrs = map(awesomes =&gt; native);<br>&nbsp; HRESULT hr = Win32Api(nativePtrs);<br>&nbsp; if(hr != S_OK) <br>&nbsp; &nbsp; AwesomeThrow( HRToAwesomeException(hr));<br>}</p><p>In fact, that is pretty much exactly what C#/VB.Net is doing under the hood.</p><p>It's not the fault of HRESULTs that they are crappy. It's the fault of developers for daring to attempt writing code in anything other than the glorious language of C/C&#43;&#43;. If all developers could agree to only ever use C&#43;&#43;, I'm sure Microsoft would be happy to dump HRESULTs and move to std::exceptions <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif?v=c9' alt='Smiley' /></p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/b8eac08b61b742169681a12a00cf87a4#b8eac08b61b742169681a12a00cf87a4</link>
		<pubDate>Mon, 17 Dec 2012 12:35:35 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/b8eac08b61b742169681a12a00cf87a4#b8eac08b61b742169681a12a00cf87a4</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>25</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Top &quot;Malicious&quot; Features</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Top-Malicious-Features/b8eac08b61b742169681a12a00cf87a4">1 hour&nbsp;ago</a>, <a href="/Niners/evildictaitor">evildictait​or</a> wrote</p><p>It's not the fault of HRESULTs that they are crappy. It's the fault of developers for daring to attempt writing code in anything other than the glorious language of C/C&#43;&#43;. If all developers could agree to only ever use C&#43;&#43;, I'm sure Microsoft would be happy to dump HRESULTs and move to std::exceptions <img src="http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif?v=c9" alt="Smiley"></p><p></p></div></blockquote><p></p><p>Actually, HRESULTs are a COM thing, not Win32. And COM has very strong roots in Visual Basic, not C/C&#43;&#43;.</p><p>Also, Win32 itself was designed for C, and was created before C&#43;&#43; finished the standardization process, so C&#43;&#43; exceptions were never an option. C&#43;&#43; exceptions are also relatively expensive, and most high-performance C&#43;&#43; code bases do not use them.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/3cfea226776a4a10aa62a12a00e6cb01#3cfea226776a4a10aa62a12a00e6cb01</link>
		<pubDate>Mon, 17 Dec 2012 14:00:17 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/3cfea226776a4a10aa62a12a00e6cb01#3cfea226776a4a10aa62a12a00e6cb01</guid>
		<dc:creator>Sven Groot</dc:creator>
		<slash:comments>25</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Sven Groot/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Top &quot;Malicious&quot; Features</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Top-Malicious-Features#c3cfea226776a4a10aa62a12a00e6cb01">Sven Groot</a>: Yes.</p><p>Further, WinRT (which is COM&#43;&#43; and one could argue where Microsoft is moving at the client app layer...) <em>is</em> exception-based (HRESULTS are used only at the lowest layer...). The problem is not the language, evildictaitor... COM is a foreign object model to C&#43;&#43; (this is why we created C&#43;&#43;/CX: we don't want C&#43;&#43; developers to have to use HRESULTS in their WinRT apps/components....).</p><p>HRESULT has nothing to do with C&#43;&#43;, as you well know...<br><br>In terms of exceptions versus error codes, that's a religious debate more than it is a technical one (modern exceptions aren't <em>that</em> expensive and of course the price of using exceptions&nbsp;is always related to <em>what</em> you're doing and <em>where/how </em>you're using them....).<br><br>C</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/1e1a4ece7fbc44bd926da12a017d548f#1e1a4ece7fbc44bd926da12a017d548f</link>
		<pubDate>Mon, 17 Dec 2012 23:08:22 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/1e1a4ece7fbc44bd926da12a017d548f#1e1a4ece7fbc44bd926da12a017d548f</guid>
		<dc:creator>Charles</dc:creator>
		<slash:comments>25</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Charles/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Top &quot;Malicious&quot; Features</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Top-Malicious-Features#c504f9a754e8d4dfe8f86a129017c645c">exoteric</a>: you can't blame programming constructs for malicious behavior - you blame malicious programmers (attackers)&nbsp;and programmers who don't design security into their programming logic/patterns/design/architecture. That said, obviously, direct access to memory and unbounded data structures has led to many, many bad things, but then again, bad people do bad things - the developers who coded the holes aren't malicious or bad programmers (generally...), they just didn't/don't place enough&nbsp;emphasis on&nbsp;security, as&nbsp;they do, say, for&nbsp;performance and reliability...<br><br>I'd say it's really more about bad programming <em>behavior</em> (writing&nbsp;exploitable code on the one hand, then doing evil things&nbsp;with the&nbsp;holes on the other)&nbsp;than it is about bad programming language features used to write unsafe code that is then exploited by malicious developers for nefarious reasons...</p><p>C</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/91564afb8cd845c99f78a12b000edd2a#91564afb8cd845c99f78a12b000edd2a</link>
		<pubDate>Tue, 18 Dec 2012 00:54:07 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/91564afb8cd845c99f78a12b000edd2a#91564afb8cd845c99f78a12b000edd2a</guid>
		<dc:creator>Charles</dc:creator>
		<slash:comments>25</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Charles/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Top &quot;Malicious&quot; Features</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Top-Malicious-Features#c1e1a4ece7fbc44bd926da12a017d548f">Charles</a>: Do you mean COM&#43; (you have COM&#43;&#43;) ?</p><p>----</p><p>The first articles about COM&#43; that I read:</p><center><strong><a href="http://www.microsoft.com/msj/1197/default.aspx">November&nbsp; 1997</a></strong></center><center><a href="http://www.microsoft.com/msj/default.asp"><img src="http://www.microsoft.com/msj/images/msjheader02.gif" alt="Microsoft Systems Journal Homepage" width="399" height="33" border="0"></a></center><hr width="300"><center><table width="380"><tbody><tr><td><center><strong>Object-Oriented Software Development Made Simple with COM&#43; Runtime Services</strong></center></td></tr></tbody></table></center><p>&nbsp;</p><p><a href="http://www.microsoft.com/msj/1197/complus.aspx">http://www.microsoft.com/msj/1197/complus.aspx</a></p><center><strong><a href="http://www.microsoft.com/msj/1297/default.aspx">December&nbsp;&nbsp; 1997</a></strong></center><center><a href="http://www.microsoft.com/msj/default.asp"><img src="http://www.microsoft.com/msj/images/msjheader02.gif" alt="Microsoft Systems Journal Homepage" width="399" height="33" border="0"></a></center><hr width="300"><center><table width="380"><tbody><tr><td><center><strong>The COM&#43; Programming Model Makes it Easy to Write Components in Any Language </strong></center></td></tr></tbody></table></center><p>&nbsp;</p><p><a href="http://www.microsoft.com/msj/1297/complus2/complus2.aspx">http://www.microsoft.com/msj/1297/complus2/complus2.aspx</a></p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/411d2e3834c24936a307a12b00358667#411d2e3834c24936a307a12b00358667</link>
		<pubDate>Tue, 18 Dec 2012 03:14:52 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/411d2e3834c24936a307a12b00358667#411d2e3834c24936a307a12b00358667</guid>
		<dc:creator>Proton2</dc:creator>
		<slash:comments>25</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Proton2/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Top &quot;Malicious&quot; Features</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Top-Malicious-Features/b8eac08b61b742169681a12a00cf87a4">18 hours&nbsp;ago</a>, <a href="/Niners/evildictaitor">evildictait​or</a> wrote</p><p>*snip*</p><p>That's a bit unfair. The Win32 apis were built with needing to propagate errors across different language barriers (i.e. so you could create MyAwesomeProgram in VB or Pascal or Fortran rather than being forced to use C/C&#43;&#43; in order to interoperate with the Microsoft libraries written in C/C&#43;&#43;).</p><p>You can't unwind an exception over someone else's code (because you don't know how they are compiled), so you can't use exceptions, heap-pointer based exceptions (like C&#43;&#43;) are also bad because it restricts what you can throw (i.e. you can't throw an out-of-memory exception if you'd need to allocate an OOM exception to throw one)</p><p>You also can't intern stuff like Java and C# because you don't have a common runtime (because some of the code in the process is Win32 C/C&#43;&#43;, some is MyAwesomeProgram.vb and a third party component it is using is in delphi pascal, all interacting with a lovely frontend written in flash).</p><p>So sadly Microsoft only has one thing left: A global enum of all possible errors, i.e. HRESULTs.</p><p>Basically what I'm saying is that HRESULTs are dirty, but that's because they're intended for crossing language or API boundaries. Microsoft never intended or expected you to use them internally. They expected you to write code like this:</p><p>MyAwesomeVoid MyAwesomeFunc(AwesomeParam1 awesomeParams...)<br>{</p><p>&nbsp; SuperDoubleAwesomePinvoke(awesomeParams);</p><p>}</p><p>And your runtime would do something like:</p><p>void CallOut( std::vector&lt;AwesomeStuff&gt; awesomes )<br>{<br>&nbsp; IEnumerable&lt;void*&gt; nativePtrs = map(awesomes =&gt; native);<br>&nbsp; HRESULT hr = Win32Api(nativePtrs);<br>&nbsp; if(hr != S_OK) <br>&nbsp; &nbsp; AwesomeThrow( HRToAwesomeException(hr));<br>}</p><p>In fact, that is pretty much exactly what C#/VB.Net is doing under the hood.</p><p>It's not the fault of HRESULTs that they are crappy. It's the fault of developers for daring to attempt writing code in anything other than <strong>the glorious language of C/C&#43;&#43;</strong>. If all developers could agree to only ever use C&#43;&#43;, I'm sure Microsoft would be happy to dump HRESULTs and move to std::exceptions <img src="/styles/images/1998/shim.gif" alt="Smiley"></p><p></p></div></blockquote>&#43;1 exactly this, friend<p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/0c6dcd53f44043d492e5a12b006dfef5#0c6dcd53f44043d492e5a12b006dfef5</link>
		<pubDate>Tue, 18 Dec 2012 06:40:28 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/0c6dcd53f44043d492e5a12b006dfef5#0c6dcd53f44043d492e5a12b006dfef5</guid>
		<dc:creator>Ion Todirel</dc:creator>
		<slash:comments>25</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Ion Todirel/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Top &quot;Malicious&quot; Features</title>
		<description><![CDATA[<p></p><blockquote><div class="quoteText"><p></p><p><a class="permalink" title="Post Permalink" href="/Forums/Coffeehouse/Top-Malicious-Features/91564afb8cd845c99f78a12b000edd2a">7 hours&nbsp;ago</a>, <a href="/Niners/Charles">Charles</a> wrote</p><p>@<a href="/Forums/Coffeehouse/Top-Malicious-Features#c504f9a754e8d4dfe8f86a129017c645c">exoteric</a>: you can't blame programming constructs for malicious behavior - you blame malicious programmers (attackers)&nbsp;and programmers who don't design security into their programming logic/patterns/design/architecture. That said, obviously, direct access to memory and unbounded data structures has led to many, many bad things, but then again, bad people do bad things - the developers who coded the holes aren't malicious or bad programmers (generally...), they just didn't/don't place enough&nbsp;emphasis on&nbsp;security, as&nbsp;they do, say, for&nbsp;performance and reliability...<br><br>I'd say it's really more about bad programming <em>behavior</em> (writing&nbsp;exploitable code on the one hand, then doing evil things&nbsp;with the&nbsp;holes on the other)&nbsp;than it is about bad programming language features used to write unsafe code that is then exploited by malicious developers for nefarious reasons...</p><p>C</p><p></p></div></blockquote><p></p><p>That's why malicious is in quotes in the title and this thread is about what causes problems in practice, when being used by human beings, and not about what works in theory, if programmers were as reliable as computers. &nbsp;<img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-5.gif?v=c9' alt='Wink' /></p><p>The entire first post should be read to understand that.</p><p>No one tool serves all purposes but if a tool is involved in many incidents, when used by its intended users, perhaps that observation is worthy of reflection.</p><p>The post is meant to inspire a discussion about &nbsp;language design and on what features cause problems in the wild - an entirely pragmatic view. API design might be relevant insofar as it shows significant pitfalls of the language, as commonly used, in this sense.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/636b0befa75f4735a91aa12b0089335b#636b0befa75f4735a91aa12b0089335b</link>
		<pubDate>Tue, 18 Dec 2012 08:19:31 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/636b0befa75f4735a91aa12b0089335b#636b0befa75f4735a91aa12b0089335b</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>25</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Top &quot;Malicious&quot; Features</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Top-Malicious-Features#c636b0befa75f4735a91aa12b0089335b">exoteric</a>: Well, I was just replying to the comment stream&nbsp;on the thread.... Seems this discussion has headed in a somewhat different direction than you intended.<br>C</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/d86296a09d574f749b45a12d000e2ea8#d86296a09d574f749b45a12d000e2ea8</link>
		<pubDate>Thu, 20 Dec 2012 00:51:38 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/d86296a09d574f749b45a12d000e2ea8#d86296a09d574f749b45a12d000e2ea8</guid>
		<dc:creator>Charles</dc:creator>
		<slash:comments>25</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Charles/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Top &quot;Malicious&quot; Features</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Top-Malicious-Features#cd86296a09d574f749b45a12d000e2ea8">Charles</a>: True. Most of the comments have been off-topic to some degree. I don't think it's an easy topic though.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/0541fe3d980348dda9a7a12d0137c624#0541fe3d980348dda9a7a12d0137c624</link>
		<pubDate>Thu, 20 Dec 2012 18:55:08 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/0541fe3d980348dda9a7a12d0137c624#0541fe3d980348dda9a7a12d0137c624</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>25</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Top &quot;Malicious&quot; Features</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Top-Malicious-Features#c0541fe3d980348dda9a7a12d0137c624">exoteric</a>: plenty of landmines out there, but C/C&#43;&#43; macros take the cake,&nbsp;at least in my books.</p><p>The funny thing is that if I had to pick the single most influential feature of C/C&#43;&#43; that allowed it to survive for so long, I would probably pick macros, again.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/11d8d16b94a94d9f9bfea12d014a9197#11d8d16b94a94d9f9bfea12d014a9197</link>
		<pubDate>Thu, 20 Dec 2012 20:03:33 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/11d8d16b94a94d9f9bfea12d014a9197#11d8d16b94a94d9f9bfea12d014a9197</guid>
		<dc:creator>Blue Ink</dc:creator>
		<slash:comments>25</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Blue Ink/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Top &quot;Malicious&quot; Features</title>
		<description><![CDATA[<p>The &quot;<strong>with</strong>&quot; keyword in Delphi.</p><p>It allows evil code like this:</p><p>SomeObject.SomeProperty := 'Value1';<br>SomeOtherObject.SomeProperty := 'Value2';<br>with SomeObject, SomeOtherObject do&nbsp; <br>begin<br>&nbsp;&nbsp;&nbsp; SomeProperty := 'Who Knows which one is being set!';<br>&nbsp;&nbsp;&nbsp; // 50&#43; lines of code using the Objects without needing the actual object.<br>end</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/7b496ca891fd42d9aeaba12d014d328f#7b496ca891fd42d9aeaba12d014d328f</link>
		<pubDate>Thu, 20 Dec 2012 20:13:08 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/7b496ca891fd42d9aeaba12d014d328f#7b496ca891fd42d9aeaba12d014d328f</guid>
		<dc:creator>Stephen Schaff</dc:creator>
		<slash:comments>25</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Vaccano/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Coffeehouse - Top &quot;Malicious&quot; Features</title>
		<description><![CDATA[<p>@<a href="/Forums/Coffeehouse/Top-Malicious-Features#c11d8d16b94a94d9f9bfea12d014a9197">Blue Ink</a>: That's interesting. Macros form a pure functional programming language, right? A pure substitution system.</p><p>@<a href="/Forums/Coffeehouse/Top-Malicious-Features#c7b496ca891fd42d9aeaba12d014d328f">Vaccano</a>: That's a great example. I work in a language that has the WITH statement and while it looks nice on the surface because it can remove a little repetition it puts a burden of semantic analysis on the programmer - in particular with nested WITH statements. The cons outweigh the pros in my opinion.</p><p>Some people even prefix their variables in a certain way to clarify their scope; a practice that should be left to the compiler services behind the editor doing semantic analysis of the code. Hungarian notation should not be a naming practice but a service-assisted view of the code.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/130257ac8d6244c0a567a12d01728b7b#130257ac8d6244c0a567a12d01728b7b</link>
		<pubDate>Thu, 20 Dec 2012 22:29:06 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/Coffeehouse/Top-Malicious-Features/130257ac8d6244c0a567a12d01728b7b#130257ac8d6244c0a567a12d01728b7b</guid>
		<dc:creator>Bent Rasmussen</dc:creator>
		<slash:comments>25</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/exoteric/Discussions/RSS</wfw:commentRss>
	</item>
</channel>
</rss>