<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>.simplicity &#187; Discussion</title>
	<atom:link href="http://www.dotsimplicity.net/category/discussion/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dotsimplicity.net</link>
	<description>Simple, reliable, simplicity. A software discussion blog</description>
	<lastBuildDate>Sun, 04 Jul 2010 09:44:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Plug-ins: Scripts and Shared Libraries</title>
		<link>http://www.dotsimplicity.net/2009/05/plug-ins-scripts-and-shared-libraries/</link>
		<comments>http://www.dotsimplicity.net/2009/05/plug-ins-scripts-and-shared-libraries/#comments</comments>
		<pubDate>Tue, 26 May 2009 22:14:42 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Discussion]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[plug-in]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[shared library]]></category>

		<guid isPermaLink="false">http://www.dotsimplicity.net/?p=285</guid>
		<description><![CDATA[In a heated discussion earlier this night, Michael and I battled our way through the chat about what we preferred for plug-ins, scripts or shared libraries. I fought for shared libraries since he&#8217;d taken the position of script defender already, and we came to a few points concerning the differences between scripts and shared libraries. [...]]]></description>
			<content:encoded><![CDATA[<p>In a heated discussion earlier this night, Michael and I battled our way through the chat about what we preferred for plug-ins, scripts or shared libraries. I fought for shared libraries since he&#8217;d taken the position of script defender already, and we came to a few points concerning the differences between scripts and shared libraries. More after the break. </p>
<p><span id="more-285"></span></p>
<h2>When the need arises</h2>
<p>A side note: since &#8220;shared libraries&#8221; was quite long to type each time, I abbreviated it to &#8220;SL&#8221;.</p>
<p>A plug-in is needed when you wish to alter the implementation of a specific part of an already compiled program. A script, as well as a SL, is simply a module which you can fit inside an already compiled program to work with that program, so they are excellent for use as a plug-in. Changing from one version of the plug-in to another would be like changing the tire of a bike: you don&#8217;t need to take the whole bike apart to replace a part of it. The same goes for programs: you don&#8217;t want to compile the whole program to alter a small part. Most IDE&#8217;s take care of this pretty nicely, take my C++ IDE Code::Blocks for instance. The IDE automatically generates a makefile and can recompile in such a way that whenever I change a implementation file, but not the header, the only steps it needs to do again are compiling that small source file and re-linking it to main. Here&#8217;s an example of the output Code::Blocks shows me when first compiling the main program with a header and an implementation for that header, and then changing the header.</p>
<pre>Compiling: main.cpp
Compiling: foo.cpp
Linking console executable: bin\Release\TMP.exe</pre>
<p>And after changing foo.cpp:</p>
<pre>Compiling: foo.cpp
Linking console executable: bin\Release\TMP.exe</pre>
<p>As you can see the most basic option is to simply get the source, compile it once (from scratch) and after that you can alter whatever you want at basically the same cost as scripts/SLs, even slightly less since the program does not have any glue-code for loading (and interpreting) SLs (and scripts). So why doesn&#8217;t everyone do this?</p>
<p>Well, most people don&#8217;t have a fast computer, compiling a big program can take a lot of time, but that&#8217;s a one-time investment so shouldn&#8217;t be a biggie.</p>
<p>What could be a biggie is not being able to compile the thing! Closed-source, yeah that won&#8217;t work. Some weird compiler costing a bunch and the program only compiles on that one? That neither.</p>
<p>To circumvent these problems, you can build your code that calls something from outside the program, such as a script or a SL!</p>
<h2>Differences</h2>
<p>So what&#8217;s the big difference between a script and a SL? Most differences come with a downside or a benefit (or both, as it depends on what you&#8217;re striving for).</p>
<h3>Interpreted vs. Compiled</h3>
<p>Scripts are interpreted at runtime, this gives them a bit of overhead at first, but this overhead should be negligible on the next passes due to the script being compiled once and thereafter being retrieved from the cache (most of the time). Further discussion about the speed and memory usage of interpreted code versus compiled code will be kept to a minimum.</p>
<h3>Deployment time</h3>
<p>SLs would take a bit longer to deploy. Change a script in any editor, save it and you&#8217;re done. To recompile a SL, I open up my project file, change the code, compile, and then I&#8217;m done. Compiling can take a few seconds and is largely dependent on the size and complexity of the code (for C(++) at least). </p>
<h3>Code Access</h3>
<p>A big advantage of SLs (in the same language, or closely related such as C and C++) is the ease of merging the module with the main program. Give the code the right headers, and you can do anything you could do in the main program. This is pretty hard to do in most scripting languages, often consisting of macros and other code that only exists to glue the script and the program together.</p>
<h3>Languages</h3>
<p>Scripts are obviously in a different language, but SLs don&#8217;t need to be. However, if SLs are in a different language, you need to learn how to compile it in such a way that the compiled code can be called from your main program&#8217;s compiled code, make sure it matches the calling convention, variable types, etc. When you want to change or add a scripting language (so that your program can use it) you need to add that functionality in your main program… It doesn&#8217;t really differ a lot in difficulty I think. However, most scripting languages are more oriented on ease-of-writing than on speed, as opposed to compiled languages. Therefore, it depends on what you want with this specific plug-in.</p>
<h3>Portability</h3>
<p>With more and more people &#8220;fighting the good fight&#8221; everyday, more people are going Linux. Therefore in general people give a bit more if their program runs on more platforms. When writing a script, most of the time you&#8217;re done for each platform: the APIs you used belong to the script, not to the platform, as is the case with compiled languages. Making compiled languages portable is a bit harder, since you are then dependent on another library such as Boost, or on some other kind of construct in your source. Preprocessor directive #ifdef works well for small algorithms in my opinion.</p>
<h3>List-it</h3>
<p>Lets whip up a quick list of benefits and downsides of the options</p>
<ul>
<li>Scripts</li>
<ul>
<li>Benefits</li>
<ul>
<li>Low deployment time</li>
<li>Potentially faster due to JIT compiling can take advantage of variables known at runtime.</li>
<li>More portable in general.</li>
</ul>
<li>Downsides</li>
<ul>
<li>Needs a library that ships along with your app (separate or statically linked, doesn&#8217;t matter), given that the library (in the right version) isn&#8217;t already available on the system.</li>
<li>Needs some &#8220;glue&#8221;-code for exposing the program&#8217;s data to the script, so you can access the program&#8217;s variable from the script.</li>
<li>Needs to be recompiled each time the program is launched, given that the interpreter doesn&#8217;t store a cache of course.</li>
</ul>
</ul>
<li>Shared Libraries</li>
<ul>
<li>Benefits</li>
<ul>
<li>Can really act like a part of the program, or at least easier then mixing compiled code with interpreted code.</li>
<li>Potentially faster due to compiler can make expensive optimizations. It&#8217;s okay for a compiler to take a bit longer to compile a SL than for a script interpreter.</li>
<li>SLs can be closed source whereas scripts obviously cannot be as easily (need to be obfuscated/repacked in some way). Some people may not find this a benefit, but I do, the choice to go open or closed shouldn&#8217;t depend on whether the code is easy to hide or not.</li>
</ul>
<li>Downsides</li>
<ul>
<li>Longer deployment time, but shouldn&#8217;t be really different.</li>
<li>User can&#8217;t really check what the library is doing, it could be &#8220;bad&#8221; code, such as a virus.</li>
</ul>
</ul>
</ul>
<p>So there you have it! A neat list, if I say it myself, with benefits and downsides of the options. I tried to make it as complete as possible but feel free to leave a comment if you think you can add something. For large programs, I think I&#8217;ll go for SLs at first, then for scripts to end up with a hybrid solution. For example: if you want to use a lot of internal classes of your C++ program, it&#8217;s way easier to go for a SL. On the other hand, if you want to be able to quickly see what different code has for effect, go for a script. If you want both you&#8217;re fsked and still have to make a choice. A good and well known example of a hybrid program is Blender: compiled in C, C++ and Python, it uses quite a lot SLs and also has support for Python scripts.</p>
<p>I hope you enjoyed reading the article, I sure did writing it. Thanks go to Maurice Bos of BosByte and Michael of <a href="http://www.dotsimplicity.net">this great site</a> for correcting and in general improving this article. Stay tuned for more articles, there&#8217;s a small abstraction tutorial coming up!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dotsimplicity.net/2009/05/plug-ins-scripts-and-shared-libraries/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Open Source Handhelds</title>
		<link>http://www.dotsimplicity.net/2009/01/open-source-handhelds/</link>
		<comments>http://www.dotsimplicity.net/2009/01/open-source-handhelds/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 22:23:44 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Discussion]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Eee]]></category>
		<category><![CDATA[GP2X]]></category>
		<category><![CDATA[Pandora]]></category>

		<guid isPermaLink="false">http://www.dotsimplicity.net/?p=90</guid>
		<description><![CDATA[Michael says:
Recently I had a discussion with Nick about open source handhelds. Reason for this discussion was the upcoming release of the GP2X Wiz. As with many other things it looks like we disagreed with each other about the GP2X.
Nick argued that these kind of handhelds are slowly becoming obsolete as small notebooks such as [...]]]></description>
			<content:encoded><![CDATA[<h3>Michael says:</h3>
<p>Recently I had a discussion with Nick about open source handhelds. Reason for this discussion was the upcoming release of the GP2X Wiz. As with many other things it looks like we disagreed with each other about the GP2X.</p>
<p>Nick argued that these kind of handhelds are slowly becoming obsolete as small notebooks such as the Asus Eee PC are becoming increasingly more affordable. Considering this fact he called devices such as GP2X pure luxury. I understand why he feels this way. After all, why wouldn&#8217;t one buy an Eee PC for a little bit more money? Although, I don&#8217;t think you can compare the GP2X with an Eee PC. The GP2X is in a completely different market than the Eee PC. The GP2X is just a simple game/media handheld.  It doesn&#8217;t claim to be more than that.</p>
<p>If you consider that the GP2X is a game/media handheld, it becomes a lot more interesting. Especially the fact that the GP2X is open source is interesting. This makes it a lot easier for developers, especially unproven developers, to develop applications for this handheld. I think this is a great way for hobbyist developers to get into handheld game development. This would be a lot harder if only the Nintendo DS and PSP were around; those platforms are very closed. So, it&#8217;s very good that there is an open alternative.</p>
<p>But the GP2X isn&#8217;t the only open source handheld out there. Besides the GP2X there is also the Pandora. Ironcally, Nick&#8217;s argument seems to apply completely to this device. Unlike the GP2X the Pandora isn&#8217;t only a gaming handheld. In fact, it offers a complete OS. It&#8217;s also a whole lot stronger than the GP2X. Unfortunately, the Pandora doesn&#8217;t really attract me. I&#8217;m not looking for a handheld that has the same functionality as a simple notebook. If I wanted something like that I would buy an Eee PC. No, I want something simple. Besides that I don&#8217;t really like the control scheme of the Pandora.</p>
<dl class="wp-caption alignright" style="width: 272px;">
<dt class="wp-caption-dt"><img title="GP2X" src="http://www.trustedreviews.com/images/article/inline/3229-1.jpg" alt="Playing sessions look painful." width="262" height="187" /></dt>
</dl>
<h3>Nick says:</h3>
<p>Just look at the thing! It&#8217;s so small&#8230; Okay, so maybe it isn&#8217;t really obsolete, at least it&#8217;s not my cup of tea. The eee would be a way cooler handheld, but it won&#8217;t really be an handheld. You can just put in your controller and play any game for example. Combine that with the huge offer of games that are already available through Ubuntu&#8217;s apt-get and you have a wicked gaming console. Kinda like that mini PS1 there used to be, but with a long batterylife and a high resolution screen too.  I don&#8217;t see people in the train playing on their handheld, I see people in the train with their laptops. So yeah, in that way, it&#8217;s quite obsolete. When will you play this and actually have a better experience then you would with an eee and a nice controller? Maybe in the back of the car/bus/public transport, but I am more of a music listener when traveling and if I really want to play a game, my handheld is my phone.</p>
<p>I think Michael and I actually agree over that the Pandora is rather useless. Just buy an eee.</p>
<p>Picture to the right is a GP2X by the way, not the GP2X Wiz which admittedly looks more comfy. Maybe just as comfy as the PSP or DS, but those aren&#8217;t exactly comfy now are they?</p>
<p>I fired up my gameboy (the first, big, gray one) recently and played Castle Chess. Wicked soundtrack. Don&#8217;t tell anyone.</p>
<p>&#8212;</p>
Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.
]]></content:encoded>
			<wfw:commentRss>http://www.dotsimplicity.net/2009/01/open-source-handhelds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vote no! Or don&#8217;t vote really, don&#8217;t care.</title>
		<link>http://www.dotsimplicity.net/2009/01/vote-no-or-dont-vote-really-dont-care/</link>
		<comments>http://www.dotsimplicity.net/2009/01/vote-no-or-dont-vote-really-dont-care/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 21:06:59 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Discussion]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.dotsimplicity.net/?p=50</guid>
		<description><![CDATA[Nick's thoughts on WordPress]]></description>
			<content:encoded><![CDATA[<p>Yeah that&#8217;s right. I don&#8217;t care. Oooooh sidebar, how neat. It has links to recent comments. Okay that&#8217;s a neat feature. WYSIWYG editor is for pussies though, hehe. Nah okay, that&#8217;s also convenient, fine. I don&#8217;t like it because it doens&#8217;t represent us. It isn&#8217;t .simplicity code. It&#8217;s 6MB worth of tons and tons of nice features that we don&#8217;t need and never will need. I don&#8217;t believe this admin panel, polls, a user system and some functions, the so called &#8220;Widgets&#8221;, need 6MB of PHP code. With that said, it shouldn&#8217;t be on .SIMPLICITY. It&#8217;s in the name you see, we promote simple software, and WordPress is just not simple.</p>
<p>Does that mean it&#8217;s not neat&#8230; No. It has XML-RPC, which is without a doubt really cool. Amongst that, the admin panel isn&#8217;t bad, it has a lot of nice functions, etc. etc.</p>
<p>I just don&#8217;t think it belongs within the &#8220;Simple&#8221; software. So if we use it, please be advised. WordPress code is <strong>NOT</strong> simple. It <strong>is</strong> very user friendly and neat.</p>
<p>Now, one last thing: fatal logic error on previous post: Michael thinks we can&#8217;t deside about what engine to use, which is probably correct, but then he (and only he) decides the users can vote for it. Well I&#8217;ll just be an ass and say I won&#8217;t let the users choose, so we can&#8217;t decide on that either. Done.</p>
<p>But fine whatever, we&#8217;ll stick with the 6MB gigantic monsterosity called WordPress for putting TEXT on a webpage. And the &#8220;Add New Category&#8221; is convienent. And we&#8217;ll be busy with other stuff anyway. Like visiting girlfriends. And punishing unwilling colleagues for not working on the all important coilgun project.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dotsimplicity.net/2009/01/vote-no-or-dont-vote-really-dont-care/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress or not?</title>
		<link>http://www.dotsimplicity.net/2009/01/wordpress-or-not/</link>
		<comments>http://www.dotsimplicity.net/2009/01/wordpress-or-not/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 12:02:00 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Discussion]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.dotsimplicity.net/?p=46</guid>
		<description><![CDATA[You might have noticed that .simplicity has changed a bit. The reason for this change is the fact that we&#8217;ve switched to WordPress. Or rather, I switched .simplicity to WordPress. I was getting increasingly tired of SimpleLog. It felt outdated and missed several handy features. With WordPress we now have a drafting system, WYSIWYG posting, [...]]]></description>
			<content:encoded><![CDATA[<p>You might have noticed that .simplicity has changed a bit. The reason for this change is the fact that we&#8217;ve switched to WordPress. Or rather, I switched .simplicity to WordPress. I was getting increasingly tired of SimpleLog. It felt outdated and missed several handy features. With WordPress we now have a drafting system, WYSIWYG posting, a user system, nested comments, polls and a modular sidebar. In my opinion these features benefit the readers of .simplicity. Besides that WordPress makes maintaining the site a lot easier. With WordPress it&#8217;s also extremely easy to add new features as many things have already been created by the open-source community. If we would be using SimpleLog we would have to create all these things from scratch. This is something I simply don&#8217;t want to spend my time on; I rather work on my posts and projects.</p>
<p lang="en-US">Unfortunately, Nick doesn&#8217;t really like WordPress. While I prefer WordPress, he prefers SimpleLog. He told me that SimpleLog&#8217;s admin panel was a lot better than WordPress. And the few features he did like he wanted to write for SimpleLog. Interesting he didn&#8217;t like WordPress widgets. That while he asked for modularity when we started .simplicity.</p>
<p lang="en-US">But it looks like we won&#8217;t be able to make a decision on the blogging engine together. So I&#8217;ll leave the decision up to the readers of .simplicity.</p>
<p lang="en-US">&#8211; Michael</p>
<p lang="en-US">&#8212;</p>
Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.
]]></content:encoded>
			<wfw:commentRss>http://www.dotsimplicity.net/2009/01/wordpress-or-not/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

