<?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"
	>
<channel>
	<title>Comments on: It&#8217;s &#8220;onBar&#8221; or &#8220;foo&#8221;, not &#8220;slotFoo&#8221;.</title>
	<atom:link href="http://frinring.wordpress.com/2006/11/10/its-onbar-or-foo-not-slotfoo/feed/" rel="self" type="application/rss+xml" />
	<link>http://frinring.wordpress.com/2006/11/10/its-onbar-or-foo-not-slotfoo/</link>
	<description>Thoughts about developing systems in software</description>
	<pubDate>Wed, 20 Aug 2008 03:59:37 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
		<item>
		<title>By: Aurélien Gâteau</title>
		<link>http://frinring.wordpress.com/2006/11/10/its-onbar-or-foo-not-slotfoo/#comment-263</link>
		<dc:creator>Aurélien Gâteau</dc:creator>
		<pubDate>Fri, 10 Nov 2006 11:07:10 +0000</pubDate>
		<guid isPermaLink="false">http://frinring.wordpress.com/2006/11/10/its-onbar-or-foo-not-slotfoo/#comment-263</guid>
		<description>I personally highly dislike when people name their functions like the signal they are connected to. To me a function name should describe an action[1]. 'slotChanged()' or 'onChanged()' look like an action triggered as a result of a 'changed()' signal. Naming the function 'changed()' is just weird.

Still, the best solution  IMO is to name the function after what it does, rather than after what it is connected to, but it's not always convenient.

[1] Except accessors of course</description>
		<content:encoded><![CDATA[<p>I personally highly dislike when people name their functions like the signal they are connected to. To me a function name should describe an action[1]. &#8217;slotChanged()&#8217; or &#8216;onChanged()&#8217; look like an action triggered as a result of a &#8216;changed()&#8217; signal. Naming the function &#8216;changed()&#8217; is just weird.</p>
<p>Still, the best solution  IMO is to name the function after what it does, rather than after what it is connected to, but it&#8217;s not always convenient.</p>
<p>[1] Except accessors of course</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Smith</title>
		<link>http://frinring.wordpress.com/2006/11/10/its-onbar-or-foo-not-slotfoo/#comment-262</link>
		<dc:creator>Matt Smith</dc:creator>
		<pubDate>Fri, 10 Nov 2006 10:54:18 +0000</pubDate>
		<guid isPermaLink="false">http://frinring.wordpress.com/2006/11/10/its-onbar-or-foo-not-slotfoo/#comment-262</guid>
		<description>The "on" convention definitely does match English usage; "on doing X" means the same as "when X is/was done".  From my experience of learning other languages (German and Arabic), prepositions often don't stay the same from one language to another.

I don't use the particular notation you mention (I sometimes put "// slot" at the end of the opening line), but I do use Hungarian notation when naming Qt widgets (but not primitives), simply as a reminder to me when returning to the application after not looking at it for a while; I also find that "pbOk" is more succinct than "OkButton".  The only snag is when two widgets have similar initials (like check-box and combo-box).</description>
		<content:encoded><![CDATA[<p>The &#8220;on&#8221; convention definitely does match English usage; &#8220;on doing X&#8221; means the same as &#8220;when X is/was done&#8221;.  From my experience of learning other languages (German and Arabic), prepositions often don&#8217;t stay the same from one language to another.</p>
<p>I don&#8217;t use the particular notation you mention (I sometimes put &#8220;// slot&#8221; at the end of the opening line), but I do use Hungarian notation when naming Qt widgets (but not primitives), simply as a reminder to me when returning to the application after not looking at it for a while; I also find that &#8220;pbOk&#8221; is more succinct than &#8220;OkButton&#8221;.  The only snag is when two widgets have similar initials (like check-box and combo-box).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Diederik</title>
		<link>http://frinring.wordpress.com/2006/11/10/its-onbar-or-foo-not-slotfoo/#comment-261</link>
		<dc:creator>Diederik</dc:creator>
		<pubDate>Fri, 10 Nov 2006 09:28:16 +0000</pubDate>
		<guid isPermaLink="false">http://frinring.wordpress.com/2006/11/10/its-onbar-or-foo-not-slotfoo/#comment-261</guid>
		<description>I think the "on" prefix is ugly as h*ll. Perhaps it's because I'm not a native speaker, but it doesn't give me the sense of an event handler at all.

I tend to use normal function names for public slots (because it's indeed ugly), and prefix methods with "slot" when they are private event handlers. It's some indication the method will be called automatically from some point, because you won't see a function call anywhere.

Sort naming don't interest me. I'm used to use readable names, even if they are long. Like like acronyms, it works counter productive when you see the code again a few weeks later. ;-) (granted "on" is not a acronym, but the argument it's 2 letters less to type is not really important to me)</description>
		<content:encoded><![CDATA[<p>I think the &#8220;on&#8221; prefix is ugly as h*ll. Perhaps it&#8217;s because I&#8217;m not a native speaker, but it doesn&#8217;t give me the sense of an event handler at all.</p>
<p>I tend to use normal function names for public slots (because it&#8217;s indeed ugly), and prefix methods with &#8220;slot&#8221; when they are private event handlers. It&#8217;s some indication the method will be called automatically from some point, because you won&#8217;t see a function call anywhere.</p>
<p>Sort naming don&#8217;t interest me. I&#8217;m used to use readable names, even if they are long. Like like acronyms, it works counter productive when you see the code again a few weeks later. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> (granted &#8220;on&#8221; is not a acronym, but the argument it&#8217;s 2 letters less to type is not really important to me)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mattr</title>
		<link>http://frinring.wordpress.com/2006/11/10/its-onbar-or-foo-not-slotfoo/#comment-254</link>
		<dc:creator>mattr</dc:creator>
		<pubDate>Fri, 10 Nov 2006 03:43:58 +0000</pubDate>
		<guid isPermaLink="false">http://frinring.wordpress.com/2006/11/10/its-onbar-or-foo-not-slotfoo/#comment-254</guid>
		<description>nope, sorry not convinced. the 'onBar' naming convention you suggest is used on windows and frankly it's just as ugly here as it is there. Function names should be descriptive enough that we shouldn't have to resort to silly prefixes for things whether they're slots or not (since slots can be called without being triggered by a signal)</description>
		<content:encoded><![CDATA[<p>nope, sorry not convinced. the &#8216;onBar&#8217; naming convention you suggest is used on windows and frankly it&#8217;s just as ugly here as it is there. Function names should be descriptive enough that we shouldn&#8217;t have to resort to silly prefixes for things whether they&#8217;re slots or not (since slots can be called without being triggered by a signal)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jml</title>
		<link>http://frinring.wordpress.com/2006/11/10/its-onbar-or-foo-not-slotfoo/#comment-253</link>
		<dc:creator>jml</dc:creator>
		<pubDate>Fri, 10 Nov 2006 01:53:35 +0000</pubDate>
		<guid isPermaLink="false">http://frinring.wordpress.com/2006/11/10/its-onbar-or-foo-not-slotfoo/#comment-253</guid>
		<description>"connect( object, SIGNAL(bar()), SLOT(onBar()) );" -- you got that backwards, I think :)</description>
		<content:encoded><![CDATA[<p>&#8220;connect( object, SIGNAL(bar()), SLOT(onBar()) );&#8221; &#8212; you got that backwards, I think <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
</channel>
</rss>
