<?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>The Scott Preston Blog &#187; Programming</title>
	<atom:link href="http://www.scottpreston.com/articles/category/programming/feed" rel="self" type="application/rss+xml" />
	<link>http://www.scottpreston.com</link>
	<description>Rambles about computing and other things in Columbus, Ohio.</description>
	<lastBuildDate>Wed, 28 Jul 2010 12:17:56 +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>Creating Your Own PHP Framework?</title>
		<link>http://www.scottpreston.com/articles/1074.php</link>
		<comments>http://www.scottpreston.com/articles/1074.php#comments</comments>
		<pubDate>Mon, 12 Jul 2010 04:08:06 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.scottpreston.com/?p=1074</guid>
		<description><![CDATA[I spent the past few days fighting over the following battle, do I either use an existing PHP Framework or Build One.
I&#8217;ve currently been using my Model 1.5 Framework (ScottWork) for sometime, but have been using CodeIgniter on a few client projects and dabbling with some of the leading PHP Frameworks like Zend, Symfony, DooPHP, [...]]]></description>
			<content:encoded><![CDATA[<p>I spent the past few days fighting over the following battle, do I either use an existing PHP Framework or Build One.</p>
<p>I&#8217;ve currently been using my Model 1.5 Framework (ScottWork) for sometime, but have been using CodeIgniter on a few client projects and dabbling with some of the leading PHP Frameworks like Zend, Symfony, DooPHP, Yii and CakePHP.</p>
<p>All of this MVC stuff of course got me thinking, what if I want to get other developers to code for me? What if I want to get other developers to maintain my apps/code? What if&#8230;?</p>
<p>So I write my own MVC framework here&#8217;s a summary if it&#8217;s main components:</p>
<ul>
<li><strong>mod_rewrite and routing of request</strong> &#8211; This is basically the nice thing like removing ? and &amp; from your URL so it looks pretty AND automatic routing of URLs to controllers-&gt;methods().</li>
<li><strong>Controllers </strong>- This is basically taking your request, and channeling it into some OO paradigm that allows you to &#8220;act&#8221; on your request in an object oriented way, then route your way to a &#8220;view&#8221;. It also contains all your logic and calls to your Model.</li>
<li><strong>Models </strong>- This allows you to talk to a database and controls your interaction with that database.</li>
<li><strong>Views </strong>- This presents your data combined/calculated/manipulated/read or otherwise transacted in your Controller.</li>
<li><strong>Helpers </strong>- This is a bunch of pre-built functionality designed to make the framework easier to use and code less.</li>
</ul>
<p>Here&#8217;s my opinion of those main components after comparing them to my Model 1.5 framework (scottwork).</p>
<ul>
<li><strong>mod_rewrite and routing of request</strong> &#8211; I see a lot of uses for mod_rewrite but the routing of request to some kind of controller/object oriented thingy is really a waste of time. Why have one huge controller with a bunch of methods in it, when you can just write a simple script designed to process the input of a page? It&#8217;s small, modular which means easy to maintain, there&#8217;s no object to create, or routes to manage. The easiest thing about not using some kind of route manager is that you can create a new page that reads data, by just adding the page, no controller/route/setting data to be read by the page later, it&#8217;s all right there, one php page. <strong><em>Vertict: mod_rewrite <span style="color: #339966;">(yes)</span>, routing <span style="color: #ff0000;">(no)</span>.</em></strong></li>
<li><strong>Controllers </strong>- You don&#8217;t need an object to call other pages, most frameworks just use the good-old include() statement, or they wrap it inside some output buffering, but essentially it&#8217;s an include. What I do in my framework &#8220;scottwork&#8221; is to create a processing page (it does not have any HTML) which is essentially the same contents of a controller method, but it&#8217;s in one file that&#8217;s only job is to process the data from the one page. <em><strong>Vertict: controllers<span style="color: #ff0000;"> (no)</span></strong></em></li>
<li><strong>Models </strong>- I use ADODB and a generated model based on that library. The model is good-old-fashion prepared statements with CRUD operations and basic validation to so that you can insert/update/delete and read-by certain fields. I extends the generated file with a child DAO that allows me to override CRUD operations or do new operations specific to my app. <em><strong>Vertict: models <span style="color: #339966;">(yes)</span></strong></em></li>
<li><strong>Views </strong>- This is completely ridiculous in MVC, the bindings and coupling between Controllers and Views is much worse than just having separate files with single methods. Plus for read-only pages, you just need to create your view, no controller-&gt;render_view() non-sense. <em><strong>Vertict: views <span style="color: #ff0000;">(no)</span></strong></em></li>
<li><strong>Helpers </strong>- This is a bunch of pre-built functionality  designed to make the framework easier to use and code less. <em><strong>Vertict: helpers <span style="color: #339966;">(yes)</span></strong></em></li>
</ul>
<h4>In Summary:</h4>
<p>You could use a framework or spend time writing your own MVC framework as I have done. Some people like OO, some people like the order/structure a framework provides. Personally I don&#8217;t like spending lots of time coding, so I generate most of my stuff. I also don&#8217;t like spending time figuring out a framework&#8217;s shortcomings or finding bugs in a framework. I believe in writing small testable, programs/scripts (web pages) that do one thing and do them well.</p>
<p>Some interesting reading:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Second-system_effect">Second System Effect</a> &#8211; The tendency to take something small and elegant, and make an elephant out of it.</li>
<li><a href="http://en.wikipedia.org/wiki/Unix_philosophy">Unix Philosophy</a> &#8211; Write programs that do one thing, and do it well.</li>
<li><a href="http://www.nealford.com">Neal Ford</a> &#8211; Essence vs. Ceremony Talk (no link to presentation)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.scottpreston.com/articles/1074.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Three Programmer Archetypes &#8211; What&#8217;s yours?</title>
		<link>http://www.scottpreston.com/articles/1059.php</link>
		<comments>http://www.scottpreston.com/articles/1059.php#comments</comments>
		<pubDate>Tue, 18 May 2010 13:01:39 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.scottpreston.com/?p=1059</guid>
		<description><![CDATA[I was at the Columbus Ruby Brigade Meeting last night and having forgot my laptop, I started to take traditional notes on the first lightning talk. It occurred to me at some point during the talk that there&#8217;s really 3 kinds of programmers and the kind of programmer really has to do with what they [...]]]></description>
			<content:encoded><![CDATA[<p>I was at the <a href="http://www.columbusrb.com" target="_blank">Columbus Ruby Brigade</a> Meeting last night and having forgot my laptop, I started to take traditional notes on the first lightning talk. It occurred to me at some point during the talk that there&#8217;s really 3 kinds of programmers and the kind of programmer really has to do with what they love and where they play. Usually I&#8217;ve seen programmers major in one and minor in the other, or  sometimes there&#8217;s no minor, just a major. First, here&#8217;s the 3 types:</p>
<ol>
<li><strong>Language Fundamentalist</strong> &#8211; These are the types that love the ins and outs of a language, compiler optimization, how memory is managed, they can explain why a certain language is great or sucks.</li>
<li><strong>Language Craftsman</strong> &#8211; These are the types that love a certain language, they can tell you the ins and outs of that language&#8217;s core API but they are resistant to changing an language once they&#8217;ve become adept and skilled at it.</li>
<li><strong>Language Minimalist</strong> &#8211; These are the types that do as little with a language as possible, they might work with a defined content management system like Joomla or WordPress or if they built a system it might consist of an open source system with 5-10 frameworks or other scripts used to get the job done.</li>
</ol>
<p>Now based on what type you are you usually dabble/play in some of the following areas:</p>
<p><strong>The Language Fundamentalist<br />
</strong></p>
<ul>
<li>Different Languages</li>
<li>Abstraction Patterns</li>
<li>Algorithms</li>
<li>Compilers</li>
</ul>
<p><strong>The Language Craftsman</strong></p>
<ul>
<li>Language X APIs</li>
<li>Frameworks of Language X (they can tell you just about everyone pros/cons of each)</li>
<li>Next versions of language X</li>
<li>How language X is better than all the rest.</li>
</ul>
<p><strong>The Language Minimalist</strong></p>
<ul>
<li>Ins-Outs of how to customize a few different systems</li>
<li>Learning newer better or next versions of similar or same systems</li>
<li>How to integrate these systems with other ones</li>
</ul>
<p>Whether or not these three are all inclusive or accurate, I&#8217;m not sure since I am neither a psychologist or a sociologist, but I am a programmer and have seen these kinds of programmers.</p>
<p>Personally I&#8217;ve majored in Craftsmanship with a minor in Fundamentalism, I don&#8217;t usually care about compilers unless they are preventing me from doing something, I also don&#8217;t care for most frameworks as they are someone elses often poor attempt at abstraction or simplification.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scottpreston.com/articles/1059.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Created New Blog &#8211; Progtivity.Com</title>
		<link>http://www.scottpreston.com/articles/1050.php</link>
		<comments>http://www.scottpreston.com/articles/1050.php#comments</comments>
		<pubDate>Wed, 05 May 2010 17:35:42 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.scottpreston.com/?p=1050</guid>
		<description><![CDATA[I just created a new blog, ProgTivity.com. The blog is mix of economic theory, zen, and programming. It&#8217;s about the art of programming productively.
Most people today don&#8217;t realize the art of being productive, everything is so rushed and fast, it actually takes time to be meaningful and productive.
I hope you enjoy the blog! Now go [...]]]></description>
			<content:encoded><![CDATA[<p>I just created a new blog, <a href="http://www.progtivity.com/">ProgTivity.com</a>. The blog is mix of economic theory, zen, and programming. It&#8217;s about the art of programming productively.</p>
<p>Most people today don&#8217;t realize the art of being productive, everything is so rushed and fast, it actually takes time to be meaningful and productive.</p>
<p>I hope you enjoy the blog! Now <a href="http://www.progtivity.com/">go visit</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scottpreston.com/articles/1050.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scott&#8217;s Bots &#8211; Back to custom code.</title>
		<link>http://www.scottpreston.com/articles/1014.php</link>
		<comments>http://www.scottpreston.com/articles/1014.php#comments</comments>
		<pubDate>Mon, 01 Feb 2010 21:51:53 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Robotics]]></category>

		<guid isPermaLink="false">http://www.scottpreston.com/?p=1014</guid>
		<description><![CDATA[I enjoy WordPress for ScottPreston.Com, but for Scott&#8217;s Bots.Com, I&#8217;ve decided to go with my own custom version of the web site.
The reason is that I wanted to do too many things with the site and was forced to look for so many so-so plug-ins. So rather than do that I just coded what I [...]]]></description>
			<content:encoded><![CDATA[<p>I enjoy WordPress for ScottPreston.Com, but for <a href="http://www.scottsbots.com">Scott&#8217;s Bots.Com</a>, I&#8217;ve decided to go with my own custom version of the web site.</p>
<p>The reason is that I wanted to do too many things with the site and was forced to look for so many so-so plug-ins. So rather than do that I just coded what I needed and so far so good, it actually give&#8217;s me some practice with my PHP skills, which I enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scottpreston.com/articles/1014.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programmer Productivity</title>
		<link>http://www.scottpreston.com/articles/1007.php</link>
		<comments>http://www.scottpreston.com/articles/1007.php#comments</comments>
		<pubDate>Tue, 26 Jan 2010 20:47:45 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.scottpreston.com/articles/1007.php</guid>
		<description><![CDATA[What makes a programmer productive?

There are lots of ideas about this and I have a few of my own. I have read some interesting articles and books on Pareto&#8217;s Law (The 80/20 Rule) and am finding that most productivity comes from just a few things.

3 Most Effective


The Language – The language you choose to do [...]]]></description>
			<content:encoded><![CDATA[<p>What makes a programmer productive?
</p>
<p>There are lots of ideas about this and I have a few of my own. I have read some interesting articles and books on Pareto&#8217;s Law (The 80/20 Rule) and am finding that most productivity comes from just a few things.
</p>
<p><strong>3 Most Effective<br />
</strong></p>
<ol>
<li><strong>The Language</strong> – The language you choose to do most of your coding is directly proportional to the efficiency of your programming (lines and quality).
</li>
<li><strong>The Libraries/Frameworks/Resources Available</strong> – Depending on what you are programming, re-inventing the wheel is wasted effort.
</li>
<li><strong>The Programming Environment</strong> – Text Editors, PC/Mac/Linux, Number of Monitors, Other Tools, Fast Internet Connection.
</li>
</ol>
<p><strong>3 Least Effective<br />
</strong></p>
<ol>
<li><strong>Development Methodology</strong> – This only matters when projects are not well thought out and people don&#8217;t know what they want programmed. But for the programmer that knows what he wants to code, it does not matter.
</li>
<li><strong>Unit Testing</strong> – I have friends that will roll their eyes at this statement, but I&#8217;ve written so many lines of code with no to little defects and I&#8217;ve not written one unit test or test case. In fact writing unit testing and doing testing on obvious stuff was the most wasted weeks I&#8217;ve ever spent.
</li>
<li><strong>Anything that makes code more maintainable</strong> – Often you will hear about rules that are good for creating maintainable code, some pattern, avoiding some anti-pattern, lines of code in a method, or size of a class file, etc. These all sound good, but the fact is only a small percentage of code is ever re-used, so stop trying to make 100% of it reusable.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.scottpreston.com/articles/1007.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows, Apache, PHP, MySQL and libmysql.dll</title>
		<link>http://www.scottpreston.com/articles/885.php</link>
		<comments>http://www.scottpreston.com/articles/885.php#comments</comments>
		<pubDate>Wed, 06 Jan 2010 17:21:18 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.scottpreston.com/articles/885.php</guid>
		<description><![CDATA[It seems like everytime I install a WAMP (Windows, Apache, PHP, MySQL) environment and I install php via the .zip file, I run into the same problems viewing PHPMyAdmin because it say&#039;s &#8220;Cannot load mysql extension.&#8221; So I did this to help me remember and hopefully help you out.
Configure php.ini

add this to httpd.conf &#8220;PHPIniDir &#8220;C:/php/php.ini&#8221;"
un-comment [...]]]></description>
			<content:encoded><![CDATA[<p>It seems like everytime I install a WAMP (Windows, Apache, PHP, MySQL) environment and I install php via the .zip file, I run into the same problems viewing PHPMyAdmin because it say&#039;s &#8220;Cannot load <a href="http://php.net/mysql" target="_blank"><em>mysql</em></a> extension.&#8221; So I did this to help me remember and hopefully help you out.</p>
<p><strong>Configure php.ini</strong></p>
<ol>
<li>add this to httpd.conf &#8220;PHPIniDir &#8220;C:/php/php.ini&#8221;"</li>
<li>un-comment this line: extension=php_mysql.dll</li>
</ol>
<p><strong>Copy libmysql.dll</strong></p>
<ol>
<li>Add your php folder to the path, for this example: c:\php</li>
<li>Open Command Prompt. Win+R, type cmd</li>
<li>net stop &#8220;apache2.2&#8243;</li>
<li>copy c:\php\libmysql.dll c:\windows\system32</li>
<li>net start &#8220;apache2.2&#8243;</li>
</ol>
<p>Now your PHPMyAdmin or other program should work as expected.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scottpreston.com/articles/885.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse PermGen Space Out Of Memory Errors</title>
		<link>http://www.scottpreston.com/articles/876.php</link>
		<comments>http://www.scottpreston.com/articles/876.php#comments</comments>
		<pubDate>Wed, 02 Dec 2009 18:50:50 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.scottpreston.com/articles/876.php</guid>
		<description><![CDATA[I thought I would make a quick post on this as it&#039;s been plauging me for some time. To fix this problem I opened my eclipse.ini and pasted the following:
-vm
%JAVA_HOME%\jre\bin\javaw.exe
I also made some adjustments to the VMARGS.
-vmargs-Xms512m-Xmx1024m-XX:MaxPermSize=128m
Update (12/21/2009)
The launcher in Eclipse is rather tricky. You need to make sure your .exe is named eclipse.exe. You [...]]]></description>
			<content:encoded><![CDATA[<p>I thought I would make a quick post on this as it&#039;s been plauging me for some time. To fix this problem I opened my eclipse.ini and pasted the following:</p>
<p>-vm</p>
<p>%JAVA_HOME%\jre\bin\javaw.exe</p>
<p>I also made some adjustments to the VMARGS.</p>
<p><span style="font-family: courier new,courier;"><strong>-vmargs<br />-Xms512m<br />-Xmx1024m<br />-XX:MaxPermSize=128m</strong></span></p>
<p>Update (12/21/2009)</p>
<p>The launcher in Eclipse is rather tricky. You need to make sure your .exe is named eclipse.exe. You should also launch from the directory or via batch file with the following contents.</p>
<p><span style="font-family: courier new,courier;"><strong>cd C:\Programs\Eclipse\java<br />start eclipse.exe</strong></span></p>
<p>The reason for this is because the eclipse launcher uses the name of the exe to read the .ini. The launcher also is not able to find the .ini if you use it from a shortcut or a launcher like Launchy.</p>
<p>Hope this helps fix any problems!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scottpreston.com/articles/876.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
