<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	
	>
<channel>
	<title>
	Comments on: Replacing an Else-if Sequence With a Ternary Operator	</title>
	<atom:link href="https://www.fluentcpp.com/2018/02/27/replace-else-if-ternary-operator/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.fluentcpp.com/2018/02/27/replace-else-if-ternary-operator/</link>
	<description>Jonathan Boccara&#039;s blog</description>
	<lastBuildDate>Fri, 01 Jun 2018 07:54:00 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.3</generator>
	<item>
		<title>
		By: jft		</title>
		<link>https://www.fluentcpp.com/2018/02/27/replace-else-if-ternary-operator/#comment-1030</link>

		<dc:creator><![CDATA[jft]]></dc:creator>
		<pubDate>Fri, 01 Jun 2018 07:54:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1720#comment-1030</guid>

					<description><![CDATA[&quot;One limitation to this technique compared to the else-if sequence is 
that there can’t be more that one statement for each conditional.&quot;

This is not quite true as multiple statements per conditional can be separated by a comma. Consider
a &#062; b ? c = d, e = f : c = f, e = d;]]></description>
			<content:encoded><![CDATA[<p>&#8220;One limitation to this technique compared to the else-if sequence is<br />
that there can’t be more that one statement for each conditional.&#8221;</p>
<p>This is not quite true as multiple statements per conditional can be separated by a comma. Consider<br />
a &gt; b ? c = d, e = f : c = f, e = d;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Liquidify		</title>
		<link>https://www.fluentcpp.com/2018/02/27/replace-else-if-ternary-operator/#comment-867</link>

		<dc:creator><![CDATA[Liquidify]]></dc:creator>
		<pubDate>Fri, 16 Mar 2018 19:14:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1720#comment-867</guid>

					<description><![CDATA[Considering wildly varying tab vs space usage and general inability fo people to indent consistently, I can&#039;t think of a single place that this would be better than a series of if and else if statements where the condition and response is on 1 line. 

This method is not more readable than 

    if (...) { displayedChar = ... }
    if (...) { displayedChar = ... }

    ...


... in any circumstance except to a select group of people.  And the if sequence will format correct for anyone without multi-line issues in just about any IDE.


You are awesome, but this seems like an answer in search of a problem.]]></description>
			<content:encoded><![CDATA[<p>Considering wildly varying tab vs space usage and general inability fo people to indent consistently, I can&#8217;t think of a single place that this would be better than a series of if and else if statements where the condition and response is on 1 line. </p>
<p>This method is not more readable than </p>
<p>    if (&#8230;) { displayedChar = &#8230; }<br />
    if (&#8230;) { displayedChar = &#8230; }</p>
<p>    &#8230;</p>
<p>&#8230; in any circumstance except to a select group of people.  And the if sequence will format correct for anyone without multi-line issues in just about any IDE.</p>
<p>You are awesome, but this seems like an answer in search of a problem.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Bryan Ewbank		</title>
		<link>https://www.fluentcpp.com/2018/02/27/replace-else-if-ternary-operator/#comment-844</link>

		<dc:creator><![CDATA[Bryan Ewbank]]></dc:creator>
		<pubDate>Fri, 02 Mar 2018 14:08:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1720#comment-844</guid>

					<description><![CDATA[To better reflect the spec, use a function.

char displayedChar() {
    if (x + y &#062;= 30)    return &#039;.&#039;;
    if (x + y &#062;= 25)    return &#039;/&#039;;
    if (x + y &#062;= 20)    return &#039;o&#039;;
    if (x - 3*y &#062; 0)    return &#039;&#124;&#039;;
    if (x - y &#062; 0)      return &#039;\&#039;;
    return &#039;_&#039;;
}]]></description>
			<content:encoded><![CDATA[<p>To better reflect the spec, use a function.</p>
<p>char displayedChar() {<br />
    if (x + y &gt;= 30)    return &#8216;.&#8217;;<br />
    if (x + y &gt;= 25)    return &#8216;/&#8217;;<br />
    if (x + y &gt;= 20)    return &#8216;o&#8217;;<br />
    if (x &#8211; 3*y &gt; 0)    return &#8216;|&#8217;;<br />
    if (x &#8211; y &gt; 0)      return &#8216;\&#8217;;<br />
    return &#8216;_&#8217;;<br />
}</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Aymen Schehaider		</title>
		<link>https://www.fluentcpp.com/2018/02/27/replace-else-if-ternary-operator/#comment-842</link>

		<dc:creator><![CDATA[Aymen Schehaider]]></dc:creator>
		<pubDate>Wed, 28 Feb 2018 10:46:00 +0000</pubDate>
		<guid isPermaLink="false">https://www.fluentcpp.com/?p=1720#comment-842</guid>

					<description><![CDATA[Agree for the cuteness of it. But as you mentioned, maybe using it with functions rather than simple cond is better (regarding chenges)]]></description>
			<content:encoded><![CDATA[<p>Agree for the cuteness of it. But as you mentioned, maybe using it with functions rather than simple cond is better (regarding chenges)</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
