<?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>Coursey Technologies, LLC</title>
	<atom:link href="http://www.courseytechnologies.com/press/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.courseytechnologies.com/press</link>
	<description>A site.  A blog.  More?  Hidden stuff.</description>
	<lastBuildDate>Wed, 16 Nov 2011 17:51:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Coded libraries:  macro or micro?</title>
		<link>http://www.courseytechnologies.com/press/2011/08/19/coded-libraries-macro-or-micro/</link>
		<comments>http://www.courseytechnologies.com/press/2011/08/19/coded-libraries-macro-or-micro/#comments</comments>
		<pubDate>Fri, 19 Aug 2011 22:42:09 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[General Comments]]></category>

		<guid isPermaLink="false">http://www.courseytechnologies.com/press/?p=29</guid>
		<description><![CDATA[I am currently working with a PHP-based shopping cart on a client&#8217;s website.  The cart, as a whole, is fantastic.  It&#8217;s fully featured with load of options and configuration modules.  It supports nearly every conceivable payment option and has built-in controls for defining a site&#8217;s appearance. The problem with it is, it&#8217;s slow.  Depending on [...]]]></description>
			<content:encoded><![CDATA[<p>I am currently working with a PHP-based shopping cart on a client&#8217;s website.  The cart, as a whole, is fantastic.  It&#8217;s fully featured with load of options and configuration modules.  It supports nearly every conceivable payment option and has built-in controls for defining a site&#8217;s appearance.</p>
<p>The problem with it is, it&#8217;s slow.  Depending on the web server&#8217;s load, I have measured it taking upwards of 1.6 minutes to render a single page inside the cart.  On off-peak hours, the pages render on average of 4 seconds each.</p>
<p>Upon investigation, I believe I&#8217;ve found the culprit.</p>
<p><span id="more-29"></span></p>
<p>During the course of my debugging various problems, I have spoken with the cart maker&#8217;s tech support and gleaned some interesting information.  One quote in particular stuck in my mind:</p>
<blockquote><p>Yes, we&#8217;re aware the cart can be a bit on the slow side.  As we grew the code and added every feature we can think of, it became rather&#8230;  large.  If you can find a way to speed everything up, we&#8217;d really appreciate that.</p></blockquote>
<p>This is a typical problem of what&#8217;s known as <a title="bloatware" href="http://en.wikipedia.org/wiki/Bloatware" target="_blank">bloatware</a>.  This is where very possible feature is added without true regard to what everyone is needing.  The issue at hand is how the code was implemented.</p>
<p>This particular cart presents the site developers with a very full API for implementing the cart&#8217;s code.  How do you inherit the code and make it available to your script?  That&#8217;s very simple.  With the following line at the top of your PHP page:</p>
<p><pre><script type="syntaxhighlighter" class="brush: php">
include ( &#039;store/init.php&#039; );
</script></pre></p>
<p>This looks very easy, yes?  Correct.  The drawback to this is, it&#8217;s too easy.</p>
<p>The cart I&#8217;m working with (sorry, but I don&#8217;t feel like pointing fingers) requires that one line and you get every feature available in their API, ranging from SSL, PEAR, RSA, AJAX, cache, email, wish list, database, HTML forms, and cookie features.  The list goes on and on.  In fact, that one required include statement moves through a list and then includes a grand total of 317 files.  Those are only the ones reported back to the internal debugger.  Yes, it has that, too.</p>
<p>Let&#8217;s say you just want to display how many items you have in the shopping cart.  How is it displayed?  Simple, by making a call to ShoppingCartProductsQuantity().  Continue the assumption, though.  Perhaps that&#8217;s all you want displayed on a certain page?  It&#8217;s still that single function call and you still have the availability of the hundreds of other calls at your disposal.</p>
<p>It appears some people have gotten the idea that computers are fast enough that we can throw whatever we want at them.  We don&#8217;t have to think carefully about what we&#8217;re writing, because the computer will handle it anyway.  That&#8217;s completely untrue, especially when writing code for the web.</p>
<p>Unless you have a dedicated host to server your web pages, you are sharing the machine with several other clients all at the same time.  Some of the citizens of the web server are great.  They make sure their code is fully patched with current versions and there is nothing errant running around.  The web server population also has miscreants or those who just aren&#8217;t attentive to their code.  I have seen web farms put up notices that some of their machines are being taken offline to remove some &#8220;bad code&#8221;.  Some of the inhabitants were running old code that had been hacked and had unknowingly launched a <a href="http://en.wikipedia.org/wiki/Ddos#Distributed_attack" target="_blank">DDOS</a> against a target.</p>
<p>While there is no way we, as developers in our own space, can protect the server against what someone else is doing, there are techniques we can use to make our code more responsive.</p>
<p>Thus comes in part of this article&#8217;s title: micro or macro?</p>
<p>I recently explained the way the shopping cart was working and how I would suggest it be designed.</p>
<p>Imagine you are handed an encyclopedia.  Someone asks you, &#8220;Give me the definition of &#8216;dog&#8217;.&#8221;  You would flip through the encyclopedia, find dog, write down the results, and hand it over.</p>
<p>Now, imagine you were handed a large stack of flash cards.  Someone asks you, &#8220;Give me the definition of &#8216;dog&#8217;.&#8221;  You would flip through the cards, locate the &#8220;dog&#8221; card, extract it, write down the answer, and hand it over.</p>
<p>See the difference?  This shopping cart is the &#8220;encyclopedia.&#8221;  You always have every definition available even if you aren&#8217;t using them.  This is macrocode: a piece of code written from the perspective of the whole code body.</p>
<p>A much better way would be to design the &#8220;flash card&#8221;.  Or, write it as microcode: designing the code from inside the whole code body.</p>
<p>Instead of a single line providing your program with every possible option, break things apart.  Perhaps you only need the above mentioned &#8220;how many items in a cart?&#8221;  Great.  Put the following line in your code:</p>
<p><pre><script type="syntaxhighlighter" class="brush: php">
include ( &quot;store/api/CartContents.php&quot; );
</script></pre></p>
<p>The &#8220;CartContents.php&#8221; could be an API into only items inside the current cart.  Sure, that API could then inherit other items such as SSL or database, but it most likely wouldn&#8217;t need access to email or HTML forms functions.</p>
<p>As your code needs more features, include that piece of the library to expand what it has available.  Don&#8217;t just assume that you always have everything all at the same time.  If you do, then you&#8217;re just bloating your code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.courseytechnologies.com/press/2011/08/19/coded-libraries-macro-or-micro/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What should you expect from here?</title>
		<link>http://www.courseytechnologies.com/press/2011/08/16/what-should-you-expect-from-here/</link>
		<comments>http://www.courseytechnologies.com/press/2011/08/16/what-should-you-expect-from-here/#comments</comments>
		<pubDate>Wed, 17 Aug 2011 04:52:05 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[General Comments]]></category>

		<guid isPermaLink="false">http://www.courseytechnologies.com/press/?p=7</guid>
		<description><![CDATA[Don&#8217;t expect this site to say anything directly about the clients I&#8217;m working with. My personal views are just that &#8211; personal. What you can expect are my views on technologies, techniques, futures, and general observations on the computing world around me. Currently, I&#8217;m working inside a site where a previous developer made some fairly [...]]]></description>
			<content:encoded><![CDATA[<p>Don&#8217;t expect this site to say anything directly about the clients I&#8217;m working with.  My personal views are just that &#8211; personal.  What you can expect are my views on technologies, techniques, futures, and general observations on the computing world around me.</p>
<p>Currently, I&#8217;m working inside a site where a previous developer made some fairly poor choices.  I&#8217;ve been adjusting code to make the frakkin thing work right.  It&#8217;s not the host.  It&#8217;s the shopping cart.</p>
<p>I wrote a quick test script in PHP to perform 10 tests of 4,000 database operations.  Across the tests, I get a result of about 1.6 seconds for the 4,000 operations.  I&#8217;d consider the host pretty good for that.  In fact, my own host company averages 5.4 seconds for the same test.</p>
<p><span id="more-7"></span>What&#8217;s annoying me about the cart?  The amount of time it takes to load.</p>
<p>Ok.  I&#8217;ve ruled out that the server is to blame.  I&#8217;ve ruled out the database is overworked.  There have been a few page loads of this cart that run up to 1.6 minutes.  It&#8217;s amazing.  Really.</p>
<p>I&#8217;ve contacted the cart&#8217;s vendor and their only suggestion for speeding everything up is to move web hosts.  They would gladly host the site for my customer for a measly $20/mo.  There was no mention of how to speed up the cart on a server that&#8217;s not theirs.</p>
<p>So&#8230;  the logic is, if the host has any sort of load on it, the cart will be slow.  Move it to a really really fast computer with nearly zero load (i.e., nobody is doing anything at all on it), then the cart should be fast enough.</p>
<p>Yes, that&#8217;s true.  It will.  I&#8217;m testing the cart at midnight and it is nice and fast.  During peak hours, however, it gets bogged down because of how much processing it&#8217;s doing in the background.</p>
<p>Did I say midnight?  Oops.  Time to log.  I&#8217;ll write some more tomorrow about how this cart was made.  For programmers, the key phrases are &#8220;macro vs micro.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.courseytechnologies.com/press/2011/08/16/what-should-you-expect-from-here/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Where am I?</title>
		<link>http://www.courseytechnologies.com/press/2011/08/16/hello-world/</link>
		<comments>http://www.courseytechnologies.com/press/2011/08/16/hello-world/#comments</comments>
		<pubDate>Wed, 17 Aug 2011 03:56:31 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[General Comments]]></category>

		<guid isPermaLink="false">http://www.courseytechnologies.com/press/?p=1</guid>
		<description><![CDATA[Ahh&#8230;  the Internet.  Or, the Interwebs, as a relative mistakenly said.  It&#8217;s a great place to get lost.  I remember back when it was just getting started.  Wow.  I feel old now. Ok.  This is a general blog for me, my company, and stuff I see going on around me in the computing environments. This [...]]]></description>
			<content:encoded><![CDATA[<p>Ahh&#8230;  the Internet.  Or, the Interwebs, as a relative mistakenly said.  It&#8217;s a great place to get lost.  I remember back when it was just getting started.  Wow.  I feel old now.</p>
<p>Ok.  This is a general blog for me, my company, and stuff I see going on around me in the computing environments.</p>
<p>This article should be entitled &#8220;who are you?&#8221;  Well, I&#8217;m the guy that runs this site.  The guy that peddles his time.  The guy that loves to write code.  I&#8217;m the geek you see peeking over the website pages, wondering why things aren&#8217;t working the way they&#8217;re supposed to.</p>
<p>Yes, this is one of those typical, &#8220;hey, let&#8217;s get started&#8221; posts.  It&#8217;s pretty generic and I&#8217;ll try to keep things light-hearted.  If you check back, I&#8217;d really appreciate the visitors.  If you want to hire me to write code, I&#8217;d really REALLY appreciate it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.courseytechnologies.com/press/2011/08/16/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

