<?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/"
		>
<channel>
	<title>Comments for Ahmet YILDIRIM</title>
	<atom:link href="http://mclightning.com/comments/feed" rel="self" type="application/rss+xml" />
	<link>http://mclightning.com</link>
	<description>blogging::in quest of Innovation</description>
	<lastBuildDate>Sat, 18 Feb 2012 16:04:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>Comment on GlassLayer : web app. to design &amp; purchase plates online by erhan</title>
		<link>http://mclightning.com/glasslayer-web-app-to-design-purchase-plates-online/uncategorized/comment-page-1#comment-2168</link>
		<dc:creator>erhan</dc:creator>
		<pubDate>Sat, 18 Feb 2012 16:04:21 +0000</pubDate>
		<guid isPermaLink="false">http://mclightning.com/?p=712#comment-2168</guid>
		<description>i remember this application, improved so much since then. good work :)</description>
		<content:encoded><![CDATA[<p>i remember this application, improved so much since then. good work :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on NarDuino! by Avinash</title>
		<link>http://mclightning.com/narduino/comment-page-1#comment-1934</link>
		<dc:creator>Avinash</dc:creator>
		<pubDate>Wed, 18 Jan 2012 22:31:44 +0000</pubDate>
		<guid isPermaLink="false">http://mclightning.com/?page_id=170#comment-1934</guid>
		<description>you&#039;re my inspiration for learning python .. thanks

looking forward to play with arduino 

btw, I&#039;ve met u on http://stackoverflow.com sometime ago .. :)</description>
		<content:encoded><![CDATA[<p>you&#8217;re my inspiration for learning python .. thanks</p>
<p>looking forward to play with arduino </p>
<p>btw, I&#8217;ve met u on <a href="http://stackoverflow.com" rel="nofollow">http://stackoverflow.com</a> sometime ago .. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Javascript Closures by admin</title>
		<link>http://mclightning.com/javascript-closures/uncategorized/comment-page-1#comment-1862</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Tue, 10 Jan 2012 12:08:22 +0000</pubDate>
		<guid isPermaLink="false">http://mclightning.com/?p=697#comment-1862</guid>
		<description>@Volkan Özçelik
Actually i used &quot;obj&quot; namespace and javascript&#039;s own object oriented approach above just to demonstrate the use of closures.
In my actual project , i use Classy.JS library which is very similar to OOP approach of Python , actually inspired by python.
In Classy.JS
You define classes as :
var NewClass = Class.$extend({
__init__:function()
{

}
});
and declare object as follows:
var Object = new NewClass();

so you cant use NewClass or Object namespace in Classy.JS , if you use - and i did use in the past before i knew closures - that makes it impossible to declare more than one instance of same class in one document. :)</description>
		<content:encoded><![CDATA[<p>@Volkan Özçelik<br />
Actually i used &#8220;obj&#8221; namespace and javascript&#8217;s own object oriented approach above just to demonstrate the use of closures.<br />
In my actual project , i use Classy.JS library which is very similar to OOP approach of Python , actually inspired by python.<br />
In Classy.JS<br />
You define classes as :<br />
var NewClass = Class.$extend({<br />
__init__:function()<br />
{</p>
<p>}<br />
});<br />
and declare object as follows:<br />
var Object = new NewClass();</p>
<p>so you cant use NewClass or Object namespace in Classy.JS , if you use &#8211; and i did use in the past before i knew closures &#8211; that makes it impossible to declare more than one instance of same class in one document. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Javascript Closures by Ben Aluan</title>
		<link>http://mclightning.com/javascript-closures/uncategorized/comment-page-1#comment-1641</link>
		<dc:creator>Ben Aluan</dc:creator>
		<pubDate>Fri, 30 Dec 2011 14:22:57 +0000</pubDate>
		<guid isPermaLink="false">http://mclightning.com/?p=697#comment-1641</guid>
		<description>It would be better if you watch the indentions too.</description>
		<content:encoded><![CDATA[<p>It would be better if you watch the indentions too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Javascript Closures by itoctopus</title>
		<link>http://mclightning.com/javascript-closures/uncategorized/comment-page-1#comment-1571</link>
		<dc:creator>itoctopus</dc:creator>
		<pubDate>Tue, 27 Dec 2011 18:51:40 +0000</pubDate>
		<guid isPermaLink="false">http://mclightning.com/?p=697#comment-1571</guid>
		<description>Hi Ahmet,

A very introduction to closures, it&#039;s very easy to understand, even for beginners in AJAX.</description>
		<content:encoded><![CDATA[<p>Hi Ahmet,</p>
<p>A very introduction to closures, it&#8217;s very easy to understand, even for beginners in AJAX.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Javascript Closures by Volkan Özçelik</title>
		<link>http://mclightning.com/javascript-closures/uncategorized/comment-page-1#comment-1548</link>
		<dc:creator>Volkan Özçelik</dc:creator>
		<pubDate>Mon, 26 Dec 2011 19:19:10 +0000</pubDate>
		<guid isPermaLink="false">http://mclightning.com/?p=697#comment-1548</guid>
		<description>Hi Ahmet,

JavaScript is a prototypal language in an of itself.
 
Many gurus (including Douglas Crockford himself) have admitted that it had been a philosophical mistake having been used JavaScript in an object oriented fashion.
-- it&#039;s against its nature.

Coming to your example. Each function in JavaScript is &quot;by definition&quot; a closure that closes over the global window object. Since you define a static global namespace &quot;obj&quot;; it is perfectly and utterly legitimate to refer to this namespace within your code base.

Optimization without measurement is not an optimization; and the depth of execution scope is hardly ever a problem in your example, but it&#039;s worth to mention that  defining a closure within another closure, or dynamically binding context using .bind, and using this within a loop increase the depth of execution scope. This may result in a slower running JavaScript code. 

So instead of making things overly-convoluted, the below may saner a better approach -- your mileage may vary of course.

var obj = {
	counter:1,
	
	set: function() {
		var self = window.obj;

               //besides using a good old for loop instead of $.each will be a lot faster.
		$(&#039;li&#039;).each(function(){
			$(this).html(self.counter);
		});
	}
};

The above code is not against any object-oriented programming practices.
 
These three links may be some pointers to the right direction:

&quot;Everything You Need To Know About JavaScript Functions (and more)&quot;
http://o2js.com/2011/11/05/functional-programming-in-javascript/

&quot;Functions and Closures in JavaScript&quot;
http://o2js.com/2011/04/26/functions-and-closures-in-javascript/

&quot;The JavaScript Module Pattern&quot;
http://o2js.com/2011/04/24/the-module-pattern/

hope that helps,
Volkan</description>
		<content:encoded><![CDATA[<p>Hi Ahmet,</p>
<p>JavaScript is a prototypal language in an of itself.</p>
<p>Many gurus (including Douglas Crockford himself) have admitted that it had been a philosophical mistake having been used JavaScript in an object oriented fashion.<br />
&#8211; it&#8217;s against its nature.</p>
<p>Coming to your example. Each function in JavaScript is &#8220;by definition&#8221; a closure that closes over the global window object. Since you define a static global namespace &#8220;obj&#8221;; it is perfectly and utterly legitimate to refer to this namespace within your code base.</p>
<p>Optimization without measurement is not an optimization; and the depth of execution scope is hardly ever a problem in your example, but it&#8217;s worth to mention that  defining a closure within another closure, or dynamically binding context using .bind, and using this within a loop increase the depth of execution scope. This may result in a slower running JavaScript code. </p>
<p>So instead of making things overly-convoluted, the below may saner a better approach &#8212; your mileage may vary of course.</p>
<p>var obj = {<br />
	counter:1,</p>
<p>	set: function() {<br />
		var self = window.obj;</p>
<p>               //besides using a good old for loop instead of $.each will be a lot faster.<br />
		$(&#8216;li&#8217;).each(function(){<br />
			$(this).html(self.counter);<br />
		});<br />
	}<br />
};</p>
<p>The above code is not against any object-oriented programming practices.</p>
<p>These three links may be some pointers to the right direction:</p>
<p>&#8220;Everything You Need To Know About JavaScript Functions (and more)&#8221;<br />
<a href="http://o2js.com/2011/11/05/functional-programming-in-javascript/" rel="nofollow">http://o2js.com/2011/11/05/functional-programming-in-javascript/</a></p>
<p>&#8220;Functions and Closures in JavaScript&#8221;<br />
<a href="http://o2js.com/2011/04/26/functions-and-closures-in-javascript/" rel="nofollow">http://o2js.com/2011/04/26/functions-and-closures-in-javascript/</a></p>
<p>&#8220;The JavaScript Module Pattern&#8221;<br />
<a href="http://o2js.com/2011/04/24/the-module-pattern/" rel="nofollow">http://o2js.com/2011/04/24/the-module-pattern/</a></p>
<p>hope that helps,<br />
Volkan</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on About Me by Entrepreneur</title>
		<link>http://mclightning.com/about-2/comment-page-1#comment-1493</link>
		<dc:creator>Entrepreneur</dc:creator>
		<pubDate>Sat, 24 Dec 2011 13:48:21 +0000</pubDate>
		<guid isPermaLink="false">http://mclightning.webrex.org/?page_id=2#comment-1493</guid>
		<description>A great Blog... :)</description>
		<content:encoded><![CDATA[<p>A great Blog&#8230; :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on OBWIous &#8211; Opensource Bluetooth Watch Initiative by yogesh bansal</title>
		<link>http://mclightning.com/innowatch-opensource-bluetooth-watch-initiative/announcements/comment-page-1#comment-882</link>
		<dc:creator>yogesh bansal</dc:creator>
		<pubDate>Wed, 24 Aug 2011 12:36:00 +0000</pubDate>
		<guid isPermaLink="false">http://mclightning.com/?p=579#comment-882</guid>
		<description>good work but can you please help me out by telling how you have made it. I am doing engineering and new to these things and i want to submit my project on this. please mail me as soon as possible on lovingjanu1709@gmail.com</description>
		<content:encoded><![CDATA[<p>good work but can you please help me out by telling how you have made it. I am doing engineering and new to these things and i want to submit my project on this. please mail me as soon as possible on <a href="mailto:lovingjanu1709@gmail.com">lovingjanu1709@gmail.com</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on OBWIous &#8211; Opensource Bluetooth Watch Initiative by Matt</title>
		<link>http://mclightning.com/innowatch-opensource-bluetooth-watch-initiative/announcements/comment-page-1#comment-881</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Tue, 23 Aug 2011 20:00:56 +0000</pubDate>
		<guid isPermaLink="false">http://mclightning.com/?p=579#comment-881</guid>
		<description>Ahmet-

Saw your article on hack a day. You won&#039;t believe it, but I&#039;m in the process of building almost the same thing with almost the same parts list!

The main application I&#039;m working on for mine is a feature that will cause the watch to notify me whenever it loses contact with my phone (Android). That way I will never leave my phone behind at a restaurant, when I leave for work, etc.

Keep up the good work!</description>
		<content:encoded><![CDATA[<p>Ahmet-</p>
<p>Saw your article on hack a day. You won&#8217;t believe it, but I&#8217;m in the process of building almost the same thing with almost the same parts list!</p>
<p>The main application I&#8217;m working on for mine is a feature that will cause the watch to notify me whenever it loses contact with my phone (Android). That way I will never leave my phone behind at a restaurant, when I leave for work, etc.</p>
<p>Keep up the good work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on OBWIous &#8211; Opensource Bluetooth Watch Initiative by Bluetooth wristwatch based on an Arduino &#124; You&#039;ve been blogged!</title>
		<link>http://mclightning.com/innowatch-opensource-bluetooth-watch-initiative/announcements/comment-page-1#comment-879</link>
		<dc:creator>Bluetooth wristwatch based on an Arduino &#124; You&#039;ve been blogged!</dc:creator>
		<pubDate>Tue, 23 Aug 2011 17:24:17 +0000</pubDate>
		<guid isPermaLink="false">http://mclightning.com/?p=579#comment-879</guid>
		<description>[...] still a little bit burned over the fact that these watches sold out so fast, [Ahmet] sent in his Open Source Bluetooth Watch and we&#8217;re thinking this could eventually be a decent [...]</description>
		<content:encoded><![CDATA[<p>[...] still a little bit burned over the fact that these watches sold out so fast, [Ahmet] sent in his Open Source Bluetooth Watch and we&#8217;re thinking this could eventually be a decent [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

