<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" 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:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Way of Ninja</title>
	
	<link>http://restuta.net</link>
	<description>Anton Vinogradenko's blog</description>
	<lastBuildDate>Fri, 27 Apr 2012 20:53:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/WayOfNinja" /><feedburner:info uri="wayofninja" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>GitExtensions from Git Bash</title>
		<link>http://feedproxy.google.com/~r/WayOfNinja/~3/xDlO2NxZF1c/</link>
		<comments>http://restuta.net/version-control/git-extensions-from-git-bash/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 22:31:42 +0000</pubDate>
		<dc:creator>Restuta</dc:creator>
				<category><![CDATA[version-control]]></category>
		<category><![CDATA[DVCS]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[git-extensions]]></category>
		<category><![CDATA[powershell]]></category>

		<guid isPermaLink="false">http://restuta.net/?p=328</guid>
		<description><![CDATA[If you failed (because I am) to use Git bash all the time just to look cool and geeky, the following article will help you to add GitExtensions support. So you will be able  to call them right from your Git bash or posh-git. So my daily usage looks like the following: #will open diff [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;"><img class="alignleft" title="cmd_gui" src="http://content.screencast.com/users/Restuta/folders/Jing/media/b980bdb9-9057-467d-bed5-da08bee5f5bc/2012-04-04_1316.png" alt="" width="571" height="276" /></p>
<p style="text-align: left;">If you failed <span style="color: #888888;">(because I am)</span> to use Git bash <strong>all the time</strong> just to look cool and geeky, the <a href="http://danrigby.com/2012/03/22/how-to-launch-git-extensions-from-git-bash-on-windows/comment-page-1/">following article</a> will help you to add <a href="http://code.google.com/p/gitextensions/">GitExtensions</a> support. So you will be able  to call them right from your Git bash or <a href="https://github.com/dahlbyk/posh-git ">posh-git</a>.</p>
<p>So my daily usage looks like the following:</p>
<blockquote><p><span style="color: #888888;">#will open diff dialog</span></p>
<p>git ex viewdiff</p>
<p><span style="color: #888888;">#will open commit dialog</span></p>
<p>git ex commit</p>
<p><span style="color: #888888;">#will open GitExtensions start page</span></p>
<p>git ex</p></blockquote>
<p><strong>UPDATE</strong></p>
<p>You can use the following PowerShell script to do all the stuff for you:</p>
<p><script src="https://gist.github.com/2512835.js?file=setup-git-ex.ps1"></script></p>
<img src="http://feeds.feedburner.com/~r/WayOfNinja/~4/xDlO2NxZF1c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://restuta.net/version-control/git-extensions-from-git-bash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://restuta.net/version-control/git-extensions-from-git-bash/</feedburner:origLink></item>
		<item>
		<title>svn-hg-git</title>
		<link>http://feedproxy.google.com/~r/WayOfNinja/~3/yNOn4tavwJM/</link>
		<comments>http://restuta.net/version-control/svn-hg-git/#comments</comments>
		<pubDate>Sat, 25 Feb 2012 02:02:32 +0000</pubDate>
		<dc:creator>Restuta</dc:creator>
				<category><![CDATA[version-control]]></category>
		<category><![CDATA[DVCS]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[hg]]></category>
		<category><![CDATA[mercurial]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://restuta.net/?p=300</guid>
		<description><![CDATA[Some time ago I was looking for those command equivalents: table { border-collapse: collapse; border-spacing: 0; font: 14px/20px Helvetica, Arial, sans-serif; color: #555; } tbody { display: table-row-group; vertical-align: middle; border-color: inherit; } td{ width: 200px !important; height: 23px !important; } tr { display: table-row; vertical-align: inherit; border-color: inherit; height: 23px !important; } caption, th [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago I was looking for those command equivalents:</p>
<style type="text/css">
table {
 border-collapse: collapse;
 border-spacing: 0;
font: 14px/20px Helvetica, Arial, sans-serif;
color: #555;
 }
tbody {
display: table-row-group;
vertical-align: middle;
border-color: inherit;
}
td{
width: 200px !important;
height: 23px !important;
}
tr {
display: table-row;
vertical-align: inherit;
border-color: inherit;
height: 23px !important;
}
caption, th {
text-align: left;
margin: 14px 0 0;
color: #036;
font-weight: bold;
}
</style>
<table style="width: 600px;">
<tbody>
<tr style="border-bottom: 1px solid black;">
<th>
<h4 style="font-size: 17px; line-height: 25px;"><strong>Subversion (SVN)</strong></h4>
</th>
<th>
<h4 style="font-size: 17px; line-height: 25px;">Mercurial (Hg)</h4>
</th>
<th>
<h4 style="font-size: 17px; line-height: 25px;"><strong>Git</strong></h4>
</th>
</tr>
<tr style="border-bottom: 1px solid lightgrey;">
<td>svn add</td>
<td><strong>hg add</strong></td>
<td><strong>git add</strong></td>
</tr>
<tr style="border-bottom: 1px solid lightgrey;">
<td>svn blame</td>
<td><strong>hg blame</strong></td>
<td><strong>git blame</strong></td>
</tr>
<tr style="border-bottom: 1px solid lightgrey;">
<td>svn cat</td>
<td><strong>hg cat</strong></td>
<td>git show</td>
</tr>
<tr style="border-bottom: 1px solid lightgrey;">
<td>svn checkout</td>
<td>hg clone</td>
<td>git clone</td>
</tr>
<tr style="border-bottom: 1px solid lightgrey;">
<td>svn commit</td>
<td>hg commit ; hg push</td>
<td>git commit -a ; git push</td>
</tr>
<tr style="border-bottom: 1px solid lightgrey;">
<td>svn delete/remove</td>
<td><strong>hg remove</strong></td>
<td>git rm</td>
</tr>
<tr style="border-bottom: 1px solid lightgrey;">
<td>svn diff</td>
<td><strong>hg diff</strong></td>
<td><strong>git diff</strong>, git diff –cached</td>
</tr>
<tr style="border-bottom: 1px solid lightgrey;">
<td>svn help</td>
<td><strong>hg help</strong></td>
<td><strong>git help</strong></td>
</tr>
<tr style="border-bottom: 1px solid lightgrey;">
<td>svn log</td>
<td><strong>hg log</strong></td>
<td><strong>git log</strong></td>
</tr>
<tr style="border-bottom: 1px solid lightgrey;">
<td>svn revert</td>
<td><strong>hg revert</strong></td>
<td>git checkout -f</td>
</tr>
<tr style="border-bottom: 1px solid lightgrey;">
<td>svn status</td>
<td><strong>hg status</strong></td>
<td><strong>git status</strong></td>
</tr>
<tr style="border-bottom: 1px solid lightgrey;">
<td>svn update</td>
<td>hg pull –update</td>
<td>git pull</td>
</tr>
<tr>
<td>svn move/rename</td>
<td><strong>hg move/rename</strong></td>
<td>git mv</td>
</tr>
</tbody>
</table>
<img src="http://feeds.feedburner.com/~r/WayOfNinja/~4/yNOn4tavwJM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://restuta.net/version-control/svn-hg-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://restuta.net/version-control/svn-hg-git/</feedburner:origLink></item>
		<item>
		<title>How to get shelving working in TortoiseHg 2.0</title>
		<link>http://feedproxy.google.com/~r/WayOfNinja/~3/lS_U6vr9ilA/</link>
		<comments>http://restuta.net/development/hot-to-get-shelving-working-in-tortoisehg2/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 11:11:00 +0000</pubDate>
		<dc:creator>Restuta</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[DVCS]]></category>
		<category><![CDATA[hg]]></category>
		<category><![CDATA[mercutial]]></category>
		<category><![CDATA[tortoise]]></category>

		<guid isPermaLink="false">http://restuta.net/?p=237</guid>
		<description><![CDATA[Our team has recently updated to TortoiseHg 2.0 and everybody were frustrated with the update that came with it regarding shelving. Sometimes you simply can’t unshelve your files, while keep receiving the following message “1 out of 1 hunks FAILED”: Solution If you are aware of what I am talking about here is the quick [...]]]></description>
			<content:encoded><![CDATA[<p>Our team has recently updated to TortoiseHg 2.0 and everybody were frustrated with the update that came with it regarding shelving. Sometimes you simply can’t unshelve your files, while keep receiving the following message <em>“1 out of 1 hunks FAILED”</em>:</p>
<p><a href="http://restuta.net/images/How-to-get-shelving-working-in-Tortois.0_C37F/image.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://restuta.net/images/How-to-get-shelving-working-in-Tortois.0_C37F/image_thumb.png" width="582" height="315" /></a></p>
<h2>Solution</h2>
<p>If you are aware of what I am talking about here is the quick fix for you:</p>
<p>Add following lines</p>
<blockquote><p>[patch]</p>
<p>eol = auto</p>
</blockquote>
<p>into the next file</p>
<blockquote><p><strong>%userprofile%\mercurial.ini</strong></p>
</blockquote>
<p>Enjoy!</p>
<h2>Why it happens?</h2>
<p>It’s because of EOL handling problems when running mecutial under Windows, this line enables patch to fix it.</p>
<img src="http://feeds.feedburner.com/~r/WayOfNinja/~4/lS_U6vr9ilA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://restuta.net/development/hot-to-get-shelving-working-in-tortoisehg2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://restuta.net/development/hot-to-get-shelving-working-in-tortoisehg2/</feedburner:origLink></item>
		<item>
		<title>Контрацепция для разработчиков</title>
		<link>http://feedproxy.google.com/~r/WayOfNinja/~3/PeLi6EjHhC4/</link>
		<comments>http://restuta.net/public-activity/contraception-for-developers-slides/#comments</comments>
		<pubDate>Fri, 28 Jan 2011 10:48:50 +0000</pubDate>
		<dc:creator>Restuta</dc:creator>
				<category><![CDATA[public-activity]]></category>
		<category><![CDATA[russian]]></category>
		<category><![CDATA[uneta]]></category>
		<category><![CDATA[на русском]]></category>

		<guid isPermaLink="false">http://restuta.net/?p=217</guid>
		<description><![CDATA[Вот слайды с моего выступления в клубе харьковских разработчиков UNETA. Жду фидбека от участников, больше всего интересует, что было плохо =) Контрацепция для разработчиков View more presentations from Restuta.]]></description>
			<content:encoded><![CDATA[<div id="__ss_6732313" style="width: 425px;">Вот слайды с моего выступления в клубе харьковских разработчиков <a href="http://www.uneta.com.ua/">UNETA</a>. Жду фидбека от участников, больше всего интересует, что было плохо =)</div>
<div style="width: 425px;"><strong><a title="Контрацепция для разработчиков" href="http://www.slideshare.net/Restuta/ss-6732313">Контрацепция для разработчиков</a></strong><object id="__sse6732313" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=main-2011-110128043825-phpapp01&amp;stripped_title=ss-6732313&amp;userName=Restuta" /><param name="name" value="__sse6732313" /><param name="allowfullscreen" value="true" /><embed id="__sse6732313" type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=main-2011-110128043825-phpapp01&amp;stripped_title=ss-6732313&amp;userName=Restuta" name="__sse6732313" allowscriptaccess="always" allowfullscreen="true"></embed></object></div>
<div id="__ss_6732313" style="width: 425px;">
<div style="padding: 5px 0 12px;">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/Restuta">Restuta</a>.</div>
</div>
<img src="http://feeds.feedburner.com/~r/WayOfNinja/~4/PeLi6EjHhC4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://restuta.net/public-activity/contraception-for-developers-slides/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://restuta.net/public-activity/contraception-for-developers-slides/</feedburner:origLink></item>
		<item>
		<title>DISQUS comment system</title>
		<link>http://feedproxy.google.com/~r/WayOfNinja/~3/vFnIxJcM2TE/</link>
		<comments>http://restuta.net/debug/disqus-comment-system/#comments</comments>
		<pubDate>Tue, 18 Jan 2011 21:48:14 +0000</pubDate>
		<dc:creator>Restuta</dc:creator>
				<category><![CDATA[debug]]></category>
		<category><![CDATA[comments]]></category>

		<guid isPermaLink="false">http://restuta.net/?p=209</guid>
		<description><![CDATA[Hitting F5…. As you can understand this post is for debugging of the new comment system. And I’ve picked you as a helper tool =) Let’s add some comments and test it together.]]></description>
			<content:encoded><![CDATA[<p>Hitting F5…. </p>
<p><a href="http://restuta.net/images/Disquscommentsystem_14C6E/logo.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="logo" border="0" alt="logo" src="http://restuta.net/images/Disquscommentsystem_14C6E/logo_thumb.png" width="143" height="55" /></a> </p>
<p>As you can understand this post is for debugging of the new comment system. And I’ve picked you as a helper tool =) Let’s add some comments and test it together.</p>
<img src="http://feeds.feedburner.com/~r/WayOfNinja/~4/vFnIxJcM2TE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://restuta.net/debug/disqus-comment-system/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		<feedburner:origLink>http://restuta.net/debug/disqus-comment-system/</feedburner:origLink></item>
		<item>
		<title>Why programmers often tend to overcomplicate everything?</title>
		<link>http://feedproxy.google.com/~r/WayOfNinja/~3/KLKj8rwSzXU/</link>
		<comments>http://restuta.net/development/why-programmers-overcomplicate-everything/#comments</comments>
		<pubDate>Wed, 15 Dec 2010 09:22:19 +0000</pubDate>
		<dc:creator>Restuta</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[thoughts]]></category>

		<guid isPermaLink="false">http://restuta.net/?p=178</guid>
		<description><![CDATA[The answer is simple: Our mind always wants complex tasks. That&#8217;s why we subconsciously always looking for this complexity. And this is where things become interesting. Its often a challenge for programmer to prevent himself from overarchitecting and overcomplicating solutions. It can become a real problem for smart guys. As far as I am smart [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" src="/images/Programmers-Complicate/Ninja-pounce.jpg" alt="" width="232" height="175" />The answer is simple:</p>
<p><em><span style="color: #000000;">Our mind always wants complex tasks.</span></em></p>
<p>That&#8217;s why we subconsciously always looking for this complexity. And this is where things become interesting. Its often a challenge for programmer to prevent himself from overarchitecting and overcomplicating solutions. It can become a real problem for smart guys. As far as I am smart =) this is a real challenge for me too.</p>
<p><strong>What should we do?</strong></p>
<p>I propose a simple solution &#8211; convince yourself  that keeping thing as simple as possible is a bigger challenge than making them complex. Following the <a href="http://en.wikipedia.org/wiki/KISS_principle">KISS </a>(&#8220;<strong>Keep it simple, Stupid!</strong>&#8220;) principle is a very difficult task <strong>itself. </strong></p>
<p><em>It is very easy to make things complex when you are smart, but it is unbelievable hard to keep them simple.</em></p>
<img src="http://feeds.feedburner.com/~r/WayOfNinja/~4/KLKj8rwSzXU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://restuta.net/development/why-programmers-overcomplicate-everything/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://restuta.net/development/why-programmers-overcomplicate-everything/</feedburner:origLink></item>
		<item>
		<title>Why JavaScript is doing this to us?</title>
		<link>http://feedproxy.google.com/~r/WayOfNinja/~3/OkWKRQgp4Kw/</link>
		<comments>http://restuta.net/development/why-javascript-is-doing-this-to-us/#comments</comments>
		<pubDate>Thu, 18 Nov 2010 00:04:50 +0000</pubDate>
		<dc:creator>Restuta</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[gotcha]]></category>
		<category><![CDATA[javacript]]></category>

		<guid isPermaLink="false">http://restuta.net/?p=165</guid>
		<description><![CDATA[There are two bracing techniques/styles in&#160;&#160;&#160;&#160;&#160; c-like languages: Foo() { }&#160; Foo() { } I’ve seen both used in C# and in JavaScript, but it was always interesting why last one is much more popular in JavaScript and first one in C# and C++. Now I have the answer: Putting braces on the same line [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://restuta.net/images/WhyJavaScript_9B99/ninjawithnunchaku.jpg"><img style="border-right-width: 0px; margin: 0px 10px 0px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ninja-with-nunchaku" border="0" alt="ninja-with-nunchaku" align="left" src="http://restuta.net/images/WhyJavaScript_9B99/ninjawithnunchaku_thumb.jpg" width="242" height="242" /></a> There are two bracing techniques/styles in&#160;&#160;&#160;&#160;&#160; c-like languages:</p>
<p><strong>Foo</strong>()     <br />{ </p>
<p>}&#160; <br /><strong>Foo</strong>() { </p>
<p>}</p>
<p>I’ve seen both used in C# and in JavaScript, but it was always interesting why last one is much more popular in JavaScript and first one in C# and C++. Now I have the answer:</p>
<p><em>Putting braces on the same line after statement prevents from doing silly JavaScript mistakes, possible thanks to ECMASrcipt standard.</em></p>
<p>It states the following:</p>
<blockquote><p>Certain ECMAScript statements (empty statement, variable statement, expression statement, do-while statement, continue statement, break statement, return statement, and throw statement) must be terminated with semicolons. Such semicolons may always appear explicitly in the source text.<strong> For convenience</strong>, however, such semicolons may be omitted from the source text in certain situations. These situations are described by saying that semicolons are automatically inserted into the source code token stream in those situations.</p>
</blockquote>
<p>And a little demo of what they mean:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:da475fcf-4283-4181-b590-b93caf75654c" class="wlWriterEditableSmartContent">
<pre name="code" class="js:nocontrols">function FooA() {
	return
	{
		x: 8
	};
};

function FooB() {
	return{
		x: 8
	};
};

function Bar() {
	alert(FooA().x);
	alert(FooB().x);
}</pre>
</div>
<p>When calling <em>Bar()</em> function you will see “undefined” and then “8” . This happens because <em>JavaScript</em> is too smart and put semicolon after first <em>return</em> statement (predicting your intent, that is actually should be a marketing slogan), so your anonymous object declaration will never be executed. Why? Here is a little intriguing pause and some dummy text that takes a little more time to read… And finally the answer is: “For convenience”, as told us by ECMA. Enjoy and don’t forget to feel convenient =)</p>
<img src="http://feeds.feedburner.com/~r/WayOfNinja/~4/OkWKRQgp4Kw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://restuta.net/development/why-javascript-is-doing-this-to-us/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://restuta.net/development/why-javascript-is-doing-this-to-us/</feedburner:origLink></item>
		<item>
		<title>Making Boolean parameters readable</title>
		<link>http://feedproxy.google.com/~r/WayOfNinja/~3/DKdQvf1-BZM/</link>
		<comments>http://restuta.net/clean-code/making-boolean-parameters-readable/#comments</comments>
		<pubDate>Mon, 27 Sep 2010 20:33:00 +0000</pubDate>
		<dc:creator>Restuta</dc:creator>
				<category><![CDATA[clean-code]]></category>
		<category><![CDATA[beginners]]></category>
		<category><![CDATA[best-practices]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[readability]]></category>

		<guid isPermaLink="false">http://restuta.net/?p=142</guid>
		<description><![CDATA[Recently I was watching a video from Uncle Bob (aka Robert Martin) about craftsmanship and ethics in which he was saying the following: Do not pass boolean parameters to a method or I&#8217;ll find you! Why? Cos you probably won&#8217;t understand following lines of code: this.DeleteCustomer(true); //what does it mean "true"? //or even more triky [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was watching a <a href="http://www.infoq.com/presentations/craftmanship-ethics" target="_blank">video</a> from <a href="http://www.objectmentor.com/omTeam/martin_r.html">Uncle Bob</a> (aka Robert Martin) about craftsmanship and ethics in which he was saying the following:</p>
<blockquote><p>Do not pass boolean parameters to a method or <b>I&#8217;ll find you</b>!</p>
</blockquote>
<p>Why? Cos you probably won&#8217;t understand following lines of code:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:cac17b8e-22a1-4ed2-943d-33960db1a6b3" class="wlWriterEditableSmartContent">
<pre name="code" class="c#:nogutter:nocontrols">this.DeleteCustomer(true); //what does it mean "true"?
//or even more triky
this.HiglightText(true, false, false);</pre>
</div>
<p>So while looking on above method calls you will need to hover your mouse or press some hotkeys to get information about signature and actual meaning of parameters. And it works only if you are watching you code through IDE. Boring isn&#8217;t it?</p>
<p>Lets assume that first method has the following signature:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:6d5270db-b9b4-44af-8e37-95a1bf9814b9" class="wlWriterEditableSmartContent">
<pre name="code" class="c#:nogutter:nocontrols">public void DeleteCustomer(bool onlyMarkAsDeleted);</pre>
</div>
<p>Instead of doing this I prefer split this method on two, where each one is more explicit:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:fdb38d37-2c78-4cae-b7d3-38aa14292190" class="wlWriterEditableSmartContent">
<pre name="code" class="c#:nogutter:nocontrols">this.DeleteCustomer();
this.MarkCustomerAsDeleted();</pre>
</div>
<p>This is possible only if you own the code, so you are able to perform such refactoring. In other case I prefer to go with one of the following ways:</p>
<p><em><strong>Define a local variable with a meaningful name and make value assignment right in method call:</strong></em></p>
</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:36d7f52d-5381-4598-86f7-2e05536735bf" class="wlWriterEditableSmartContent">
<pre name="code" class="c#:nogutter:nocontrols">bool onlyMarkAsDeleted;
this.DeleteCustomer(onlyMarkAsDeleted = true);
//for the "false" case
this.DeleteCustomer(onlyMarkAsDeleted = false);</pre>
</div>
<p><strong>Disadvantage:</strong> It can be not obvious how it works if you see this for the first time. You just can forget that a result of Boolean value assignment is also a Boolean equal to value assigned.</p>
<p><strong><em>Define a local variable with a meaningful name and make value assignment before method call:</em></strong></p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:e42f9eb1-d9b5-48b3-ba3d-57c6236fb012" class="wlWriterEditableSmartContent">
<pre name="code" class="c#:nogutter:nocontrols">bool andMarkAsDeleted = true;
this.DeleteCustomer(andMarkAsDeleted);
//for the "false" case
bool doNotMarkAsDeleted = false;
this.DeleteCustomer(doNotMarkAsDeleted);
</pre>
</div>
<p><strong>Disadvantage:</strong> This approach requires more care in choosing variable names, this can go tricky sometime.</p>
<p>I think both are a lot more readable and will save a lot of time in future. Surely .NET 4 Rocks with named arguments:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:812469c5-0cb0-4c63-8c15-c81123a09de7:0e608d15-b3df-4d51-b8e9-a4e90f508de3" class="wlWriterEditableSmartContent">
<pre name="code" class="c#:nogutter:nocontrols">this.DeleteCustomer(onlyMarkAsDeleted: true)</pre>
</div>
<p><strong><font size="3">Please, follow these rules or I’ll send your home address to Uncle Bob =)</font></strong></p>
<img src="http://feeds.feedburner.com/~r/WayOfNinja/~4/DKdQvf1-BZM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://restuta.net/clean-code/making-boolean-parameters-readable/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://restuta.net/clean-code/making-boolean-parameters-readable/</feedburner:origLink></item>
		<item>
		<title>Где захостить OpenSource проект?</title>
		<link>http://feedproxy.google.com/~r/WayOfNinja/~3/iz6yO2q3dLM/</link>
		<comments>http://restuta.net/project-hosting/where-is-to-host-open-source-project/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 21:07:00 +0000</pubDate>
		<dc:creator>Restuta</dc:creator>
				<category><![CDATA[project hosting]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[links-catalog]]></category>
		<category><![CDATA[open-source]]></category>

		<guid isPermaLink="false">http://restuta.net/project-hosting/%d0%b3%d0%b4%d0%b5-%d0%b7%d0%b0%d1%85%d0%be%d1%81%d1%82%d0%b8%d1%82%d1%8c-opensource-%d0%bf%d1%80%d0%be%d0%b5%d0%ba%d1%82/</guid>
		<description><![CDATA[Недавно я задался таким вопросом, сделал в твиттере опрос, попробовал по результатам Google Code, Source Forge и Assembla, остановился на последней. Хотелось как всегда систему с блекджеком и шлюхами SVN (нет я не моральный урод, чтобы не юзать Git, есть причины для SVN), приличным объёмом под репозиторий, встроенным BugTracker, Wiki, удобным интерфейсом (гугл код на [...]]]></description>
			<content:encoded><![CDATA[<p>Недавно я задался таким вопросом, сделал в твиттере опрос, попробовал по результатам <strong>Google Code</strong>, <strong>Source Forge</strong> и <strong>Assembla</strong>, остановился на последней. Хотелось как всегда систему с <strike>блекджеком и шлюхами</strike> SVN (нет я не моральный урод, чтобы не юзать Git, есть причины для SVN), приличным объёмом под репозиторий, встроенным BugTracker, Wiki, удобным интерфейсом (гугл код на этом и зафейлился), возможно Project Management плюшками и конечно всё бесплатно =)&#160; </p>
<p>Сегодня вот нашёл очень полезный ресурс <a title="http://www.svnhostingcomparison.com/" href="http://www.svnhostingcomparison.com/">http://www.svnhostingcomparison.com/</a>, он предоставляет детальное сравнение огромного количества систем для хостинга ваших проектов. Вот скрин с примером того, что он умеет:</p>
<p><a href="http://restuta.net/images/OpenSource_1DD/LFevOe1250ONugTWs3L4tA1.jpg"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="LFevOe1250ONugTWs3L4tA[1]" border="0" alt="LFevOe1250ONugTWs3L4tA[1]" src="http://restuta.net/images/OpenSource_1DD/LFevOe1250ONugTWs3L4tA1_thumb.jpg" width="599" height="373" /></a> </p>
<p>А потом я немножко погуглил и прозрел, как много есть всевозможных сравнениий систем для хостинга, публикую <em>только</em> <em>полезные </em>ссылки, выбирайте на здоровье. </p>
<ul>
<li>как всегда детальная и полезная <a href="http://en.wikipedia.org/wiki/Comparison_of_open_source_software_hosting_facilities" target="_blank">статья в Wiki</a> </li>
<li><a href="http://stackoverflow.com/questions/10490/best-open-source-project-hosting-site" target="_blank">не менее полезный вопрос на stackoverflow</a> </li>
<li><a href="http://www.ibiblio.org/fosphost/exhost.htm" target="_blank">скучный ресурс с убогим интерфейсом</a> </li>
<li><a href="http://www.straw-dogs.co.uk/09/20/6-free-svn-project-hosting-services/" target="_blank">более-менее нормальный обзор 10-ти ресурсов</a> </li>
<li><a href="http://projecthostingsolutions.portfolio.md/project-hosting-comparison-assembla-vs-unfuddle.html" target="_blank">сравнение Assebla &amp; Unfuddle</a> </li>
</ul>
<img src="http://feeds.feedburner.com/~r/WayOfNinja/~4/iz6yO2q3dLM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://restuta.net/project-hosting/where-is-to-host-open-source-project/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://restuta.net/project-hosting/where-is-to-host-open-source-project/</feedburner:origLink></item>
		<item>
		<title>CLR via C# 3</title>
		<link>http://feedproxy.google.com/~r/WayOfNinja/~3/3eiLI9uiZ6c/</link>
		<comments>http://restuta.net/books/clr-via-csharp-3/#comments</comments>
		<pubDate>Sun, 20 Jun 2010 10:22:00 +0000</pubDate>
		<dc:creator>Restuta</dc:creator>
				<category><![CDATA[books]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[.net 4.0]]></category>
		<category><![CDATA[first-hand]]></category>

		<guid isPermaLink="false">http://restuta.net/?p=72</guid>
		<description><![CDATA[Недавно приехала с амазона, хоть книга и в мягкой обложке, но качество не сравнить с нашими изданиями – приятная бумага и хорошая типографика. Третье издание включает в себя множество изменений, которые охватывают тонкости работы 4-го фреймворка, а также бонусные главы посвящённые управлению потоками. Джефри Рихтер давно мечтал написать отдельную книгу по многопоточности, но теперь это [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://restuta.net/images/CLRviaC3_D35C/image.png"><img style="border-right-width: 0px; margin: 0px 10px 0px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" align="left" src="http://restuta.net/images/CLRviaC3_D35C/image_thumb.png" width="202" height="244" /></a></p>
<p>Недавно приехала с <a href="http://www.amazon.com/CLR-via-C-Third-Pro-Developer/dp/0735627045/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1264116090&amp;sr=8-1">амазона</a>, хоть книга и в мягкой обложке, но качество не сравнить с нашими изданиями – приятная бумага и хорошая типографика. Третье издание включает в себя <a href="http://www.wintellect.com/CS/blogs/jeffreyr/archive/2009/11/01/what-s-new-in-clr-via-c-3rd-edition-as-compared-to-the-2nd-edition.aspx">множество изменений</a>, которые охватывают тонкости работы 4-го фреймворка, а также бонусные главы посвящённые управлению потоками. <a href="http://www.wintellect.com/cs/blogs/jeffreyr/default.aspx"><em>Джефри Рихтер</em></a> давно мечтал написать отдельную книгу по многопоточности, но теперь это часть <em>CLR via C# 3</em>.</p>
<p>Читать книгу в оригинале гораздо приятнее и понятнее, на многие вещи смотришь по-другому, авторские формулировки гораздо легче воспринимаются, чем перевод. Да и ждать русского издания ещё долго, <strong>must have</strong> для каждого дотнетчика.</p>
<p>Первое, что я прочитал &#8211; было предисловие от <strong>Кристин Трейс</strong><em>,</em> жены Джефри и оно настолько меня впечатлило, что я решил попросить разрешение у автора перевести его:</p>
<blockquote><p>Hi team and Jeff,    </p>
<p>My name is Anton Vinogradenko, I am from Ukraine. I&#8217;ve just gotten your book (CLR via C# 3rd) from Amazon and I&#8217;m very impressed with its Foreword, so I want to ask you to translate it into Russian and post on my recently opened blog (<a href="http://restuta.net">http://restuta.net</a>). Thanks! </p></blockquote>
<p>И получил ответ:</p>
<blockquote><p>Jeffrey Richter (Wintellect LLC) to me    </p>
<p>Sure, feel free to translate and post it. Send me a link after you&#8217;ve done it &#8211; I&#8217;ll forward it to my wife &#8211; she&#8217;ll love it! </p></blockquote>
<p>С большим удовольствием скоро опубликую для вас это замечательное вступление.</p>
<img src="http://feeds.feedburner.com/~r/WayOfNinja/~4/3eiLI9uiZ6c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://restuta.net/books/clr-via-csharp-3/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://restuta.net/books/clr-via-csharp-3/</feedburner:origLink></item>
	</channel>
</rss>

