<?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>haslo.ch - Guido's Blog &#187; scorchers</title>
	<atom:link href="http://www.haslo.ch/blog/tag/scorchers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.haslo.ch/blog</link>
	<description>We believe that people with passion can change the world for the better.</description>
	<lastBuildDate>Sun, 07 Mar 2010 17:58:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Dead Space: First Impressions</title>
		<link>http://www.haslo.ch/blog/dead-space-first-impressions/</link>
		<comments>http://www.haslo.ch/blog/dead-space-first-impressions/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 09:11:54 +0000</pubDate>
		<dc:creator>haslo</dc:creator>
				<category><![CDATA[Video Games]]></category>
		<category><![CDATA[drm]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[reviews]]></category>
		<category><![CDATA[scorchers]]></category>
		<category><![CDATA[video games]]></category>

		<guid isPermaLink="false">http://www.haslo.ch/blog/?p=2020</guid>
		<description><![CDATA[I had heard a lot of positive buzz about Dead Space, the new EA SciFi horror shooter, so my expectations were naturally high. When Steam finally had it (funny enough, I&#8217;m one of those odd folks who are up in arms against any form of too rigid DRM except when it&#8217;s Steam), and in English [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_2033" class="wp-caption alignright" style="width: 160px"><a href="http://www.haslo.ch/blog/wp-content/uploads/2009/01/deadspace.jpg"><img class="size-thumbnail wp-image-2033" title="Dead Space" src="http://www.haslo.ch/blog/wp-content/uploads/2009/01/deadspace-150x150.jpg" alt="Dead Space" width="150" height="150" /></a><p class="wp-caption-text">Dead Space</p></div>
<p>I had heard a lot of positive buzz about <a href="http://deadspace.ea.com/">Dead Space</a>, the new EA SciFi horror shooter, so my expectations were naturally high. When Steam finally had it (funny enough, I&#8217;m one of those odd folks who are up in arms against any form of too rigid DRM except when it&#8217;s Steam), and in English too (something that&#8217;s nigh impossible to get here in Switzerland in retail, but that&#8217;s another issue), I bought it.</p>
<p>So yesterday I tried to play it, with those high expectations, and with disastrous results. Those were my first impressions:</p>
<ul>
<li><strong>Odd strafing</strong> &#8230; When a game moves you forward with speed X when you press &#8220;W&#8221;, and moves you sideways with a speed close to X when you press &#8220;A&#8221;, you&#8217;d expect pressing both &#8220;W&#8221; and &#8220;A&#8221; would move you roughly in a 45° angle? Not in this game, here the angle is closer to 4.5°. That&#8217;s a common shooter standard that you chose not to implement there, and it is annoying.</li>
<li><strong>Aim mode</strong> &#8230; You can only shoot if you enter aim mode first, which displays those nice targeting dots, but which also slows down your mouse <em>a lot</em>. You know, EA, I do have this custom-built gaming rig with an <a href="http://www.logitech.com/index.cfm/mice_pointers/mice/devices/3053&amp;cl=us,en">insane-res laser mouse</a> and a <a href="http://www.razerzone.com/p-81-razer-mantis-professional-gaming-surface.aspx">huge mouse pad</a>, and I do play with low sensitivity. I can aim perfectly well without you slowing down my mouse &#8211; in fact, I can aim <em>way better</em> if you don&#8217;t keep changing my input. This is not a console. At least give me an option to change it.</li>
<li><strong>Mouse smoothing</strong> &#8230; Turning off VSync helped a bit, but the smoothing isn&#8217;t gone (with 50+ FPS). And there&#8217;s no option to switch it off. My mouse movements are rather smooth, thank you very much, and having them artificially smoothened further disconnects me from what&#8217;s happening on the screen. And <a href="http://www.giantbomb.com/pc/60-94/pc/60-94/dead-space-controls-pile-of-crap/35-114624/">I&#8217;m not alone</a> (although I wouldn&#8217;t use such strong language).</li>
<li><strong>Save function</strong> &#8230; There is none. I have no clue if the game is supposed to autosave or if there&#8217;s checkpoints and forced save spots or whatnot. And honestly, I don&#8217;t care. A PC game without a save function has to explain to me why it doesn&#8217;t have one, preferrably within the first minutes of play. And then the reason better be good, too (like the one in <a href="http://en.wikipedia.org/wiki/Prince_of_Persia:_The_Sands_of_Time">PoP: Sands of Time</a> was).</li>
<li><strong>Program crash</strong> &#8230; Right after shooting the first monster, my game crashed. Not just the game, the whole system halted. It managed to do something I didn&#8217;t know was possible: It put the video card into an error state where a soft reset didn&#8217;t help anymore (the BIOS then beeped &#8220;video card error&#8221;), a hard reset did luckily. I&#8217;m sorry, EA &#8230; is my run-of-the-mill 8800GT (<a href="http://store.steampowered.com/hwsurvey/videocard/">market share according to Valve</a>: 12%, <a href="http://www.nvidia.de/Download/index.aspx?lang=en">drivers</a> updated) too exotic for you?</li>
</ul>
<p>All in all, I can confidently conclude that something is wrong in the EA PC testing department. And I can even point to what it is: The ones testing PC games there are not actually PC gamers, but console gamers who have to test the PC version as well. No way those huge bloopers would have made it into the final obvious console port otherwise.</p>
<p>It&#8217;s just another game that alienates PC gamers by screwing with their conventions in favour of a game experience similar to the one on the console. In case you haven&#8217;t noticed: The demographics of PC players and console players might overlap, but have distinct histories and premises.</p>
<p>Now if you&#8217;ll excuse me, work first, and I&#8217;ll need some Quake Live (or possibly Left 4 Dead) this evening to calm down. Maybe I&#8217;ll give Dead Space another try afterward, the story seems to be great so far after all.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.haslo.ch/blog/dead-space-first-impressions/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Sarah Palin, the Accessorizer</title>
		<link>http://www.haslo.ch/blog/sarah-palin-the-accessorizer/</link>
		<comments>http://www.haslo.ch/blog/sarah-palin-the-accessorizer/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 13:01:19 +0000</pubDate>
		<dc:creator>haslo</dc:creator>
				<category><![CDATA[Politics]]></category>
		<category><![CDATA[america]]></category>
		<category><![CDATA[capitalism]]></category>
		<category><![CDATA[conspiracy theories]]></category>
		<category><![CDATA[real life]]></category>
		<category><![CDATA[scorchers]]></category>

		<guid isPermaLink="false">http://www.haslo.ch/blog/?p=1594</guid>
		<description><![CDATA[Apart from her being rather incompetent (&#8220;cramming a lot of information&#8221;, as if, she just doesn&#8217;t find her way around the notes others have prepared for her), Sarah Palin apparently really likes fashion. And hairdressers. And makeup.
According to financial disclosure records, the accessorizing began in early September and included bills from Saks Fifth Avenue in [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1596" class="wp-caption alignright" style="width: 160px"><a href="http://www.haslo.ch/blog/wp-content/uploads/2008/10/sarah_palin.jpg"><img class="size-thumbnail wp-image-1596" title="Sarah Palin (image source: Wikipedia)" src="http://www.haslo.ch/blog/wp-content/uploads/2008/10/sarah_palin-150x150.jpg" alt="Sarah Palin" width="150" height="150" /></a><p class="wp-caption-text">Sarah Palin</p></div>
<p>Apart from her being <a href="http://www.youtube.com/watch?v=L8__aXxXPVc">rather incompetent</a> (&#8220;cramming a lot of information&#8221;, as if, she just doesn&#8217;t find her way around the notes others have prepared for her), Sarah Palin apparently really likes fashion. And hairdressers. And makeup.</p>
<blockquote><p>According to financial disclosure records, the accessorizing began in early September and included bills from Saks Fifth Avenue in St. Louis and New York for a combined $49,425.74.</p>
<p>The records also document a couple of big-time shopping trips to Neiman Marcus in Minneapolis, including one $75,062.63 spree in early September.</p>
<p>The RNC also spent $4,716.49 on hair and makeup through September after reporting no such costs in August.</p></blockquote>
<p>Ah well. I refrained from posting about the US election so far, it&#8217;s just too hyped up even in European media, and the US voters seem to be <a href="http://pewresearch.org/databank/dailynumber/?NumberID=509">less informed by the day</a>, start being <a href="http://stupidevilbastard.com/index/seb/comments/al_jazeera_reveals_racism_at_sarah_palin_rallies/">openly and no longer covertly racist</a> again, but this is just silly.</p>
<p>Although, on second thought, maybe the money is better spent that way.</p>
<p>Via <a href="http://www.tou.ch/blog/2008/10/22/republikaner-haben-sarah-palin-kleider-fur-150000-dollar-gekauft/">tou.ch</a> (German).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.haslo.ch/blog/sarah-palin-the-accessorizer/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Stop RFID in Swiss Passports!</title>
		<link>http://www.haslo.ch/blog/stop-rfid-in-swiss-passports/</link>
		<comments>http://www.haslo.ch/blog/stop-rfid-in-swiss-passports/#comments</comments>
		<pubDate>Fri, 12 Sep 2008 11:43:29 +0000</pubDate>
		<dc:creator>haslo</dc:creator>
				<category><![CDATA[Politics]]></category>
		<category><![CDATA[america]]></category>
		<category><![CDATA[conspiracy theories]]></category>
		<category><![CDATA[green]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[scorchers]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[switzerland]]></category>
		<category><![CDATA[terrorism]]></category>

		<guid isPermaLink="false">http://www.haslo.ch/blog/?p=1114</guid>
		<description><![CDATA[The Swiss government has decided that our passports, like a few before ours, should store data on RFID chips. Meaning, the following data would be stored in that chip:

fingerprints
a digital photograph
all the data that&#8217;s also available in printed form (name, gender, date of birth, eye color, and so on)

All this data could then be read [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1128" class="wp-caption alignright" style="width: 160px"><a href="http://www.haslo.ch/blog/wp-content/uploads/2008/09/rfid_howitworks.jpg"><img class="size-thumbnail wp-image-1128" title="RFID - How It Works" src="http://www.haslo.ch/blog/wp-content/uploads/2008/09/rfid_howitworks-150x150.jpg" alt="RFID - How It Works" width="150" height="150" /></a><p class="wp-caption-text">RFID - How It Works</p></div>
<p>The Swiss government has decided that our passports, like a few before ours, should store data on RFID chips. Meaning, the following data would be stored in that chip:</p>
<ul>
<li>fingerprints</li>
<li>a digital photograph</li>
<li>all the data that&#8217;s also available in printed form (name, gender, date of birth, eye color, and so on)</li>
</ul>
<p>All this data could then be read out via electrical readers (as pictured in the diagram to the right, labels German).</p>
<p><strong>That in and of itself isn&#8217;t necessarily evil!</strong> The current proposal concerning regulations and technology lets it be implemented in ways that make it evil though. Let me lay out why that is.</p>
<h2>About RFID</h2>
<p>If you haven&#8217;t heard of RFID before, it&#8217;s high time you <a href="http://en.wikipedia.org/wiki/Radio-frequency_identification">read up at Wikipedia</a> &#8211; and even if you did, there&#8217;s quite intriguing things I haven&#8217;t read before in there too. Short version:</p>
<blockquote><p>An RFID tag is an object that can be applied to or incorporated into a product, animal, or person for the purpose of identification and tracking using radio waves. Some tags can be read from several meters away and beyond the line of sight of the reader.</p></blockquote>
<p>Additionally, the RFID chip can be passive &#8211; meaning, it has no energy source of its own and thus potentially lives forever. And as I&#8217;ll explain later more in-depth, you can&#8217;t track who obtains information from it. There are also active RFID chips, but since the ones used in passports are passive and there are no other fundamental differences beyond range between active and passive types, I&#8217;ll neglect active RFID chips for the rest of this post.</p>
<p>There are places where RFID chips make sense and most privacy concerns don&#8217;t apply (like race tracking, inventory systems, some kinds of animal tracking). But passports definitely aren&#8217;t one of them.</p>
<h2>The Referendum</h2>
<p><a href="http://freiheitskampagne.ch/"><img class="size-full wp-image-1129 alignleft" title="RFID Banner" src="http://www.haslo.ch/blog/wp-content/uploads/2008/09/rfid_banner.jpg" alt="RFID Banner" width="150" height="131" /></a>The referendum (a <a href="http://en.wikipedia.org/wiki/Referendum#Switzerland">federal facultative referendum</a>, that is) is carried from a surprisingly (in a very positive way) large number of independent political forces.</p>
<p>The referendum was launched because there is a vast number of unresolved issues that are introduced with biometric RFID passes (details see below).</p>
<p style="text-align: center;"><a href="http://freiheitskampagne.ch/"><strong>Here is the RFID referendum website</strong></a></p>
<p style="text-align: left;">If you&#8217;re Swiss, I strongly urge you to sign it <strong>within the next 10 days</strong>, if you haven&#8217;t already, and spread it among your friends and coworkers. Time is running out, the referendum only runs until September 22th, and apparently, over 30&#8242;000 more signatures are needed. <a href="http://freiheitskampagne.ch/Unterschriftenbogen5.pdf">Signature sheets are available on their site</a>.</p>
<p><span id="more-1114"></span></p>
<h2>Privacy</h2>
<p>It is not a coincidence that the RFID chip started out, originally, as an espionage device. Its passive nature and long life make it perfect for stealth placement and readout.</p>
<p>Accesses to the chip are not trackable, and while the chips in passports are protected by a metal mesh covering them that shields them against malicious scans, this (just like other things when it comes to RFID) doesn&#8217;t work as it should. Uncovered at the <a href="http://www.tgdaily.com/content/view/27899/113/">Blackhat 2006, a proof of concept showed</a>:</p>
<blockquote><p>The problem, according to Flexilis, is that the shielding does not fully protect passport against remote scans. Kevin Mahaffey from Flexilis says a medium powered scanner could detect a partially opened passport from four to six inches away. The theoretical maximum detection range is more than 10 feet, but Mahaffey said that would require a &#8220;huge amount of power.&#8221;</p></blockquote>
<p>So, when you have such a passport, you&#8217;re trackable, identifiable, by anyone who has access to that kind of technology. Which is just about anyone who&#8217;s determined enough.</p>
<p>Furthermore, even &#8220;legitimate&#8221; (as per the legal text) kinds of tracking can go way beyond what we&#8217;re comfortable with. Airline companies, other companies with special permissions, your own and foreign governments, can and may track your every move. And once enough companies have your data in their databases, it&#8217;s bound to be stolen and out in the open eventually &#8211; data leaks do happen.</p>
<p>If you&#8217;re in the fortunate position to understand German, the <a href="http://www.foebud.org/rfid">StopRFID pages of the FoeBuD e.V.</a> have way more info.</p>
<h2>Security</h2>
<p>There is a simple fact about RFID chips that no lobbyist will openly admit:</p>
<p style="text-align: center;"><strong>They are not secure.</strong></p>
<p>You may have heard of <a href="http://en.wikipedia.org/wiki/MythBusters">MythBusters</a>. It&#8217;s a Discovery Channel series that &#8230; busts myths. Often funny, like &#8220;can you surf on a wave created by a dynamite explosion&#8221;, but also stuff like &#8220;can you hack security fingerprint systems&#8221;. They tried to do an episode on RFID, and they were shut down by the industry. You draw the conclusions. References here: <a href="http://www.tomshardware.com/news/Mythbuster-RFID-HOPE,6313.html">tom&#8217;s hardware</a>, <a href="http://news.cnet.com/8301-13772_3-10030509-52.html?tag=newsEditorsPicksArea.0%22">cnet news</a>, <a href="http://consumerist.com/5043831/mythbusters-gagged-credit-card-companies-kill-episode-exposing-rfid-security-flaws">the consumerist</a>, all via <a href="http://www.schneier.com/blog/archives/2008/09/mythbusters_epi.html">Bruce Schneier</a>.</p>
<p>&#8220;But&#8221;, I hear you say, &#8220;they&#8217;re meant to be made secure!&#8221; Well &#8230; yes. Read for yourself, in the <a href="http://www.parlament.ch/ab/frameset/f/n/4804/273225/f_n_4804_273225_273453.htm">federal Swiss decree</a>:</p>
<blockquote><p>Der Datenchip ist gegen Fälschungen und unberechtigtes Lesen zu schützen. Der Bundesrat bestimmt die entsprechenden technischen Anforderungen.</p></blockquote>
<p>More or less, the chip is to be protected against malicious readouts, and details are to be determined by the executive.</p>
<p>But, there&#8217;s a problem with this: The same thing was meant to happen with the British passes&#8217; RFID chips. And what happened? They were hacked a couple weeks after they were released. <a href="http://www.guardian.co.uk/technology/2006/nov/17/news.homeaffairs">Read the details on The Guardian</a>:</p>
<blockquote><p>&#8220;The reader &#8211; I bought one for £250 &#8211; has to say hello to the chip and tell it that it is authorised to make contact. The key to that is in the date of birth, etc. Once they communicate, the conversation is encrypted, but I wrote some software in about 48 hours that made sense of it.&#8221;</p></blockquote>
<p>More info <a href="http://www.technewsworld.com/story/52270.html?wlc=1221216180">on TechNewsWorld</a>. Now, this was a white hat hacker. Who tells us that black hats have problems with what he achieved in 48 hours? We already know that it&#8217;s <a href="http://consumerist.com/369715/how-to-hack-a-rfid-credit-card-for-8">easy to access credit card numbers</a> like that, why should full blown identity theft be made as easy as the (too easy) credit card theft?</p>
<h2>Teleology</h2>
<p>As we know, the main reason for adding those RFID chips in the first place is that the US wants everybody to do so. In their <a href="http://travel.state.gov/visa/laws/telegrams/telegrams_1403.html">Enhanced Border Security and Visa Reform Act of 2002</a>, we find:</p>
<blockquote><p>Additionally, by October 26, 2004, in order for a country to remain eligible for participation in the visa waiver program its government must certify that it has a program to issue to its nationals machine-readable passports that are tamper-resistant and which incorporate biometric and authentication identifiers that satisfy the standards of the International Civil Aviation Organization (ICAO).</p></blockquote>
<p>Why is it that the US government wants everybody to use those RFID chips in the first place then? <a href="http://www.schneier.com/blog/archives/2004/10/rfid_passports.html">Bruce Schneier has, yet again, brilliant vista</a>:</p>
<blockquote><p>The Bush administration is deliberately choosing a less secure technology without justification. If there were a good offsetting reason to choose that technology over a contact chip, then the choice might make sense.</p>
<p>Unfortunately, there is only one possible reason: The administration wants surreptitious access themselves. It wants to be able to identify people in crowds. It wants to surreptitiously pick out the Americans, and pick out the foreigners. It wants to do the very thing that it insists, despite demonstrations to the contrary, can&#8217;t be done.</p></blockquote>
<p>This, of course, is speculation. I haven&#8217;t seen another reasonable explanation to date yet though.</p>
<p>The fun thing is that the US government keeps pursuing that course, despite even large independent bodies like the <a href="http://www.smartcardalliance.org/">Smart Card Alliance</a> (who actually represents RFID vendors, among others, and thus has it in their best economic interest that RFID chips are used) <a href="http://www.techworld.com/security/news/index.cfm?newsid=7513">warning them from privacy and security dangers</a>. If you have a long breath, you might want to read this <a href="http://www.dhs.gov/xlibrary/assets/privacy/privacy_advcom_rpt_rfid_draft.pdf">extensive report from May 2006</a>.</p>
<h2>The future</h2>
<p>Maybe some time in the future, the technology will be where it needs to be in order to make a private, secure chip that makes international travel easy without exposing its users to unnecessary risks. The proposed RFID chips certainly aren&#8217;t that technology.</p>
<p>Of course, even when we eventually do have the technology, other things like better tolerance and education would be more effective in preventing terrorism. But that&#8217;s an entirely different discussion.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.haslo.ch/blog/stop-rfid-in-swiss-passports/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>What&#8217;s Wrong With VBA? (3/3)</title>
		<link>http://www.haslo.ch/blog/whats-wrong-with-vba-33/</link>
		<comments>http://www.haslo.ch/blog/whats-wrong-with-vba-33/#comments</comments>
		<pubDate>Mon, 08 Sep 2008 17:27:48 +0000</pubDate>
		<dc:creator>haslo</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[scorchers]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[vb]]></category>

		<guid isPermaLink="false">http://www.haslo.ch/blog/?p=496</guid>
		<description><![CDATA[part 1 &#8211; part 2 &#8211; part 3
This is the third part of a three-part series, have a look at part 1 and part 2 first.
So let&#8217;s go on ahead and jump into the final bits of my troubles with MS Access and VBA as environment for medium and larger IT projects &#8211; basically, anything [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.haslo.ch/blog/whats-wrong-with-vba-13/">part 1</a> &#8211; <a href="http://www.haslo.ch/blog/whats-wrong-with-vba-23/">part 2</a> &#8211; <a href="http://www.haslo.ch/blog/whats-wrong-with-vba-33/">part 3</a></p>
<p>This is the third part of a three-part series, have a look at <a href="http://www.haslo.ch/blog/whats-wrong-with-vba-13/">part 1</a> and <a href="http://www.haslo.ch/blog/whats-wrong-with-vba-23/">part 2</a> first.</p>
<p>So let&#8217;s go on ahead and jump into the final bits of my troubles with MS Access and VBA as environment for medium and larger IT projects &#8211; basically, anything having 2 and up users.</p>
<h2>Syntax</h2>
<p>There are quite a few things that bother me about the VBA syntax. First of all: it&#8217;s inconsistent, even more so than the one of <a href="http://en.wikipedia.org/wiki/PHP">php</a> (where mainly <a href="http://www.tnx.nl/php.html#args">method signatures are inconsistent</a>), in several places. The most prominent of them are functions. Take these lines:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Dim</span> answer <span style="color: #000080;">As</span> VbMsgBoxResult
MsgBox <span style="color: #800000;">&quot;Hello World!&quot;</span>, vbOKOnly
answer = MsgBox(<span style="color: #800000;">&quot;Hello World?&quot;</span>, vbYesNo)</pre></div></div>

<p>Did you notice anything? Yes, indeed. Take note, the parentheses are forbidden in the first case, and mandatory in the second. Now assume that you have a function call that you suddenly need the answer from, whereas you didn&#8217;t need it earlier. Not only do you now have to write the assignment, but you also have to add parentheses to the function call. Way to spend productive time.</p>
<p>The same goes for &#8220;Set&#8221; and assignments to native data types and Objects: For Objects, it&#8217;s mandatory, for native types it&#8217;s forbidden. That goes even for Objects stored in a Variant variable &#8211; all Variants are not made equal, some will throw runtime errors when you assign stuff to them.<br />
<span id="more-496"></span><br />
Another annoying syntax bit is this one:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #008000;">' Won't work!
</span><span style="color: #000080;">Dim</span> someNumber <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span> = 5
<span style="color: #008000;">' Will work :-/
</span><span style="color: #000080;">Dim</span> someNumber <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>
someNumber = 5</pre></div></div>

<p>Yay, more <a href="http://en.wikipedia.org/wiki/Lines_of_code#Disadvantages">lines of code</a>, how great. But wait, I have more! What do you think this produces?</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Dim</span> firstVar, secondVar <span style="color: #000080;">As</span> <span style="color: #000080;">Double</span>
<span style="color: #000080;">Dim</span> thirdVar, fourthVar <span style="color: #000080;">As</span> <span style="color: #000080;">Object</span></pre></div></div>

<p>Yep, you guessed it. &#8220;firstVar&#8221; is a Variant, &#8220;secondVar&#8221; a Double, &#8220;thirdVar&#8221; a Variant, &#8220;fourthVar&#8221; an Object. Oh, you got it wrong? Don&#8217;t worry, it&#8217;s just that silly.</p>
<p>My final pet peeve with the syntax is its capitalization (and thus technically the IDE and not VBA itself). VBA is not per se case sensitive &#8211; and it expresses that through simple means: Whenever it encounters a variable, it tries to capitalize it the way it&#8217;s supposed to be, to make it clear that it&#8217;s the same.</p>
<p>Now, enter <a href="http://en.wikipedia.org/wiki/Scope_(programming)">scoping</a>, and intuitively named API bits. So you have a local variable called &#8220;currentItem&#8221; &#8230; what happens if you try to access the property &#8220;CurrentItem&#8221; in, say, an <a href="http://msdn.microsoft.com/en-us/library/aa210923(office.11).aspx">Inspector Object</a>? Right, it&#8217;s capitalized &#8220;currentItem&#8221;. It has nothing at all to do with my local variable, but the IDE is too stupid to notice.</p>
<p>Of course there&#8217;s other things amiss or strange, like the lack of a <a href="http://www.fmsinc.com/free/NewTips/NET/NETtip33.asp">side effect free ternary operator</a>, or the (nearly syntax) VBA developer gospel for the redundant <a href="http://en.wikipedia.org/wiki/Hungarian_notation">Hungarian notation</a> taken to <a href="http://www.joelonsoftware.com/articles/Wrong.html">wrong extremes</a>, but I&#8217;ll just stop here.</p>
<h2>MS Access</h2>
<p>I won&#8217;t even go into how I find Access 2007 to be much worse than its predecessors when it comes to usability, with longer mouse paths and more clicks per action, the <a href="http://office.microsoft.com/en-us/excel/HA101730521033.aspx">developer tab not showing by default</a>, and shortcuts no longer easily visible. Just so much: <strong>it&#8217;s annoying</strong>. I guess I still haven&#8217;t gotten used to the new, less quick, <a href="http://teaandbiscuits.org.uk/drupal/node/8">way of displaying shortcuts</a>, and often, object placements aren&#8217;t intuitive for me and I&#8217;m looking for things in the wrong tab.</p>
<p>What really bothers though is that Access has <strong>stability issues</strong>. Access is the only program so far that managed to crash on my development system. <a href="http://www.adobe.com/products/dreamweaver/">Dreamweaver MX 04</a> is quite an old make and has huge problems with Vista&#8217;s <a href="http://www.microsoft.com/windows/windows-vista/features/user-account-control.aspx">UAC</a>, but it doesn&#8217;t crash. Nor does any other tool. But Access, which happens to often corrupt databases when it does.</p>
<p>Even crashes aside, occasionally the <strong>database just corrupts</strong> like that, without any visible reason. Or it keeps code that you deleted, and keeps spitting error messages how that code isn&#8217;t valid &#8211; without you having any possibility to do anything about it, not even overwriting helps.</p>
<p>I hope you make backups every couple minutes, I certainly learned to. I haven&#8217;t found another reliable way to get those databases back into stable conditions.</p>
<p>Then, what&#8217;s one of the many responsibilities of a proper <a href="http://en.wikipedia.org/wiki/Database_management_system">DBMS</a>? <strong>Housekeeping</strong>! What does Access do? Provide you with &#8220;compact and repair&#8221;, which is user-initiated <em>only</em>. Well, I guess with huge databases that Access couldn&#8217;t handle anymore anyway, that would make sense, not having that an automated regular task.</p>
<p>Furthermore, every single user <strong>needs MS Access installed</strong> on his computer. Potentially a security risk, certainly not something that should be necessary. You don&#8217;t go and install an MS SQL Server on everybody&#8217;s machine. At least Microsoft consequently follows through, and their <a href="http://office.microsoft.com/en-us/access/HA011225981033.aspx">Access security FAQ</a> is all about how you can protect your computer from malicious Access macros, and not how you can secure your Access databases.</p>
<p>By the way, <strong>Access doesn&#8217;t scale</strong> &#8211; what else is new. <a href="http://databases.aspfaq.com/database/what-are-the-limitations-of-ms-access.html">Multiple users are a problem</a>, for larger databases (&gt;<a href="http://support.microsoft.com/kb/302524/">2GB</a>, but you&#8217;re hitting <a href="http://www.programmingado.net/a-381/Performance-testing-Access-MySQL-MSSQL.aspx">performance bottlenecks</a> way before that) you have to move to a proper backend &#8211; essentially, lugging around the whole DBMS part of your GUI windowing toolkit for naught afterwards.</p>
<p>It does at least have <a href="http://mcs.open.ac.uk/kgw9/interesting/AccessLocking.html">proper locking</a>, quite refined <a href="http://www.databasedev.co.uk/permissions.html">permissions</a>, and with Access 2007, <a href="http://databases.about.com/od/productinfo/a/encryption.htm">database encryption</a> (without which all the permission structures in the world are worth naught) as well.</p>
<h2>Other Things</h2>
<p>There&#8217;s a few other small things that I found incredibly annoying, coming from other languages like <a href="http://java.sun.com/">Java</a>, <a href="http://www.python.org/">Python</a> and my personal favourite, <a href="http://www.ruby-lang.org/en/">Ruby</a>.</p>
<p>For one, <a href="http://wesnerm.blogs.com/net_undocumented/2005/10/null_comparison.html"><strong>Null comparisons</strong> work in odd ways</a>, VBA uses <a href="http://en.wikipedia.org/wiki/Ternary_logic">ternary logic</a> (although admittedly, this is consistent with the way SQL handles Nulls).</p>
<p>The next minor thing are <strong>silly defaults</strong> &#8211; there are two lines every halfway serious programmer adds as a very first thing to every single bit of VBA code they write (and this goes so far that there&#8217;s option settings to add it automatically to every source bit):</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Option</span> <span style="color: #000080;">Explicit</span>
<span style="color: #000080;">Option</span> Compare Database</pre></div></div>

<p>The reason for this is simple: backwards compatibility. While VB6 (maybe earlier?) changed the default to the need for explicit variable declaration, VBA never did, and thus it&#8217;s still possible to mistype a simple variable and never find the error later on. And as for Compare Database &#8230; yeah sure, let&#8217;s compare stuff everywhere a bit differently, to make sure the database behaves completely unforeseeable.</p>
<p>Another one: <strong>No external source file support</strong>. If you want to use any library or other cool thingy you found on the net or elsewhere, you have to copy-paste the code into Access. Where it&#8217;s needed, that is, which of course means that if it&#8217;s needed anywhere else, you have to copy-paste it again. The only way around this are Access databases that allow you to copy-paste (oh, look, a pattern) the respective classes or modules as a whole. No, you can&#8217;t just link (with <a href="http://www.access-programmers.co.uk/forums/showthread.php?t=27139">very limited exceptions</a>). Hooray?</p>
<p>We&#8217;re not done yet: You <strong>can&#8217;t return an array</strong>! If you want a Function that returns an array, you have to define it as returning a Variant. If you do that, you can return arrays (since they&#8217;re a subtype of Variant), but will lose all meta information: Data type, size, everything. So if you want to return an array and its size, you have to do it via separate functions, or with a stateful returning object, or with a custom ADT.</p>
<p>Something that was rightfully pointed out to me (thanks Ste!) &#8211; why is it that VBA (and VB.NET, for that matter) distinguishes between <strong>Functions and Subs</strong>? There&#8217;s no fundamental difference, one returns something, the other doesn&#8217;t (so, essentially returns Nothing), but that&#8217;s it. Visual Studio goes so far to automatically change the keyword from Sub to Function when you return something.</p>
<h2>Conclusion</h2>
<p>I guess it&#8217;s apparent by now: I do think that it&#8217;s justifiable to say that VBA is outdated and should be dumped right now.</p>
<p>For Microsoft: There are good replacements, there&#8217;s no reasonable reason beyond &#8220;it was easier&#8221; to have Office 2007 use VBA still, and there&#8217;s certainly no reason to make the next version of MS Office still have VBA support &#8211; particularly if that means that there still won&#8217;t be native VB.NET support inside MS Office.</p>
<p>How delusional of me to think they&#8217;ll actually see this, though <img src='http://www.haslo.ch/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' title="Whats Wrong With VBA? (3/3)" /> </p>
<p>For anybody considering Access and VBA for their projects: Well, if you still want to, you can of course. Or get the free <a href="http://www.microsoft.com/express/vb/Default.aspx">Visual Studio Express for VB.NET</a> plus <a href="http://www.microsoft.com/express/sql/Default.aspx">SQL Server Express</a>, and stick to a Microsoft environment with a very similar but much more mature language, and a more performant database, for less money.</p>
<p>I still do work with VBA, when I really have to, but I think I laid out here why it&#8217;s a fact that I really only do so when there is no other way.</p>
<p style="text-align: center;"><a href="http://www.haslo.ch/blog/whats-wrong-with-vba-13/">part 1</a> &#8211; <a href="http://www.haslo.ch/blog/whats-wrong-with-vba-23/">part 2</a> &#8211; <a href="http://www.haslo.ch/blog/whats-wrong-with-vba-33/">part 3</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.haslo.ch/blog/whats-wrong-with-vba-33/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>What&#8217;s Wrong With VBA? (2/3)</title>
		<link>http://www.haslo.ch/blog/whats-wrong-with-vba-23/</link>
		<comments>http://www.haslo.ch/blog/whats-wrong-with-vba-23/#comments</comments>
		<pubDate>Sun, 07 Sep 2008 11:08:11 +0000</pubDate>
		<dc:creator>haslo</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[scorchers]]></category>
		<category><![CDATA[vb]]></category>

		<guid isPermaLink="false">http://www.haslo.ch/blog/?p=494</guid>
		<description><![CDATA[part 1 &#8211; part 2 &#8211; part 3
This is the second part of a three-part series, have a look at part 1 first if you haven&#8217;t read it yet.
Let&#8217;s just jump right in and continue the list of problems I have with VBA as a programming language for medium and larger MS Access projects.
Error Handling
The [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.haslo.ch/blog/whats-wrong-with-vba-13/">part 1</a> &#8211; <a href="http://www.haslo.ch/blog/whats-wrong-with-vba-23/">part 2</a> &#8211; <a href="http://www.haslo.ch/blog/whats-wrong-with-vba-33/">part 3</a></p>
<p>This is the second part of a three-part series, have a look at <a href="http://www.haslo.ch/blog/whats-wrong-with-vba-13/">part 1</a> first if you haven&#8217;t read it yet.</p>
<p>Let&#8217;s just jump right in and continue the list of problems I have with VBA as a programming language for medium and larger MS Access projects.</p>
<h2>Error Handling</h2>
<p>The modern paradigm for error handling is <a href="http://en.wikipedia.org/wiki/Exception_handling">exception handling</a>, but to VBA that doesn&#8217;t apply for a simple reason: VBA doesn&#8217;t have exceptions. Instead, it <a href="http://msdn.microsoft.com/en-us/library/5hsw66as(VS.80).aspx">has this</a>:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">On</span> <span style="color: #000080;">Error</span> <span style="color: #000080;">GoTo</span> ErrorHandler</pre></div></div>

<p>Yes, that&#8217;s a GoTo, and we all know <a href="http://xkcd.com/292/">those are evil</a>. Even worse than GoTo though is this line:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">On</span> <span style="color: #000080;">Error</span> <span style="color: #000080;">Resume</span> <span style="color: #000080;">Next</span></pre></div></div>

<p>Basically, &#8220;just ignore all the errors that happen now, they&#8217;re not important&#8221;. Ah, right. We can still check for error codes, so even this evil construct (<a href="http://www.developerfusion.co.uk/show/4325/">never ever</a> use this as default!) is occasionally necessary to avoid the spaghetti code that the GoTo alternative would produce, while providing reasonable feedback instead of the techy default Access warnings:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="vb" style="font-family:monospace;">DoCmd.SetWarnings <span style="color: #000080;">False</span>
<span style="color: #000080;">On</span> <span style="color: #000080;">Error</span> <span style="color: #000080;">Resume</span> <span style="color: #000080;">Next</span>
doSomethingUseful
<span style="color: #000080;">If</span> <span style="color: #000080;">Not</span> Err.Number = 0 <span style="color: #000080;">Then</span>
    MsgBox <span style="color: #800000;">&quot;Descriptive error message&quot;</span>, vbCritical, <span style="color: #800000;">&quot;Error&quot;</span>
<span style="color: #000080;">End</span> <span style="color: #000080;">If</span>
<span style="color: #000080;">On</span> <span style="color: #000080;">Error</span> <span style="color: #000080;">GoTo</span> 0
DoCmd.SetWarnings <span style="color: #000080;">True</span></pre></td></tr></table></div>

<p>What a silly contraption. In VB.NET, it&#8217;d look like this, and be way more flexible and expandable:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="vbnet" style="font-family:monospace;"><span style="color: #0600FF;">Try</span>
    doSomethingUseful<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #0600FF;">Catch</span> ex <span style="color: #FF8000;">As</span> Exception
    <span style="color: #0600FF;">MsgBox</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;Descriptive error message&quot;</span>, MsgBoxStyle.<span style="color: #0600FF;">Critical</span>, <span style="color: #808080;">&quot;Error&quot;</span><span style="color: #000000;">&#41;</span>
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Try</span></pre></td></tr></table></div>

<p><span id="more-494"></span>The current consensus among programmers is that <a href="http://david.tribble.com/text/goto.html">GoTo isn&#8217;t necessarily evil</a>, but it has to be used the right way. Myself, I have yet to see a case where I find GoTo to be better than its alternatives, but that&#8217;s subjective I guess. Excursus: I couldn&#8217;t resist solving the <a href="http://david.tribble.com/text/goto.html#conclusion">Last Example &#8211; Nontrivial Gotos</a> from that last link, with less C code and no GoTo and, in my opinion, clearer:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">int</span> parse<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>Token tok <span style="color: #339933;">=</span> gettoken<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> END<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>shift<span style="color: #009900;">&#40;</span>tok<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>reduce<span style="color: #009900;">&#40;</span>tok<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #b1b100;">return</span> ERROR<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">return</span> ACCEPT<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Anyway. VBA provides a GoTo, which is neutral, and it forces that GoTo upon programmers for error handling due to lack of alternatives, which is bad. <a href="http://cprogramming.com/tutorial/goto.html">Only C gets away with that</a>.</p>
<h2>The IDE</h2>
<p>The Access VBA <a href="http://en.wikipedia.org/wiki/Integrated_development_environment">IDE</a> basically consists of two parts (and thus technically isn&#8217;t really integrated, but we&#8217;ll let that slide): The in-Access editor (or layouter) for forms and reports, and the code editor for actual programming.</p>
<p>The layouter works quite well really, except that the one even in the free <a href="http://www.microsoft.com/Express/">Visual Studio Express</a> (which isn&#8217;t even the central part of that IDE, unlike in Access) is lightyears ahead, be it concerning auto-snaps or ease of use or number of clicks for anything. Microsoft doesn&#8217;t seem to use its internal synergies all that well.</p>
<p>The same then goes for the code editor, just worse: It hasn&#8217;t gotten an update in recent years, the one that shipped in Office 2007 is exactly the same as the one from Office 2003. Grievances are&#8230;</p>
<ul>
<li>Whenever you have a half-finished line, and switch line to write something somewhere else, you have an error message box pop up that you have to click away first &#8211; because it only checks errors when you leave a line, and has no other way to display them.</li>
<li>Class lookup is shaky, with new custom classes it often it only works after you exit and restart Access.</li>
<li>Even if it works it&#8217;s not completely reliable, working autocompletion is a rare positive surprise.</li>
<li>Debugging is pretty limited, often when there&#8217;s an error the IDE doesn&#8217;t even stop at the point where the error actually occurred but at some point further up the call stack.</li>
</ul>
<p>I can live with those shortcomings of course, but I really don&#8217;t see why Microsoft didn&#8217;t just use the Visual Studio IDE instead &#8211; it would not only have fixed those problems, but also have gained better searching capabilities, snippets, refactoring and wizards to go with it.</p>
<h2>Object Orientation</h2>
<p>VBA is object oriented! Yeah, to some extent: You can make classes, and there&#8217;s even <a href="http://www.developerfusion.co.uk/show/3965/3/">properties</a>. However, yet again there&#8217;s a bullet list of things that should be better:</p>
<ul>
<li>You can&#8217;t have parameters for your class constructors (the <a href="http://www.xtremevbtalk.com/showthread.php?t=224316">Class_Initialize Sub</a>), so initializing a class must be either with default values or through a separate &#8220;init&#8221; function that&#8217;s called after instantiation with &#8220;New&#8221;.</li>
<li>No real <a href="http://en.wikipedia.org/wiki/Inheritance_(computer_science)">inheritance</a>, you can just implement interfaces (and thus inherit method signatures, but no content or properties or anything) &#8211; considering there&#8217;s no compile time type checking anyway, I don&#8217;t see much purpose in that.</li>
<li>No <a href="http://en.wikipedia.org/wiki/Method_overloading">overloading</a>. Yes, you can have <a href="http://vbadud.blogspot.com/2007/04/optional-parameter-example.html">optional parameters</a>, but the same function name with different signatures won&#8217;t work (the language does support encapsulation though, so you can <a href="http://www.utteraccess.com/forums/showflat.php?Board=48&amp;Number=1252455&amp;Main=1252455">override functions in narrower namespaces</a>, but that&#8217;s not really overloading).</li>
<li>Objects are handled different from native data types. Not just &#8220;they are different&#8221;, but they have differing syntax too &#8211; an assignment to an object needs &#8220;Set&#8221;, one to a Variant must not have &#8220;Set&#8221;. So even though you can store an Object in a Variant, you&#8217;ll run into runtime errors if you do. Admittedly, Java shares similar problems, but at least it has <a href="http://java.sun.com/j2se/1.5.0/docs/guide/language/autoboxing.html">autoboxing</a> meanwhile.</li>
</ul>
<p>Some people also have a problem with VBA having both modules <em>and</em> classes &#8211; myself, I see that more pragmatically: There are cases when you&#8217;d make just static functions in a class anyway, or work just with a singleton, so why not pack those in a module instead? You can always change to a class structure later if it becomes necessary.<br />
<a name="community" /><br />
<h2>The Community</h2>
<p>Now this one is certainly controversial, and even more subjective than the rest of this post series. First off, there are quite a few great community sites full of dedicated and knowledgable authors, like the <a href="http://msdn.microsoft.com/en-us/vbasic/cc546545.aspx">MS VB forums</a>, <a href="http://www.databasedev.co.uk/">databasedev.co.uk</a>, <a href="http://www.vb-helper.com/index.html">VB Helper</a>, <a href="http://www.mvps.org/access/">The Access Web</a>, <a href="http://www.freevbcode.com/">FreeVBCode</a>, the <a href="http://www.tek-tips.com/threadminder.cfm?pid=707">TekTips VBA section</a> and the <a href="http://www.fmsinc.com/free/tips.html#TipsforAccess">FMS tips section</a>.</p>
<p>But what I&#8217;m talking about is the &#8220;Googlability&#8221; of problems.</p>
<p>If I don&#8217;t find a solution in a site I know (or sometimes while looking in one of those sites, with &#8220;site:foobar.com&#8221;), I just Google it (<a href="http://www.justfuckinggoogleit.com/">of course</a>) &#8211; problems do occur, and others must have had the same ones before. Now what happens if I do that for VBA problems?</p>
<p>I find trash.</p>
<p>This is for these three reasons, I guess:</p>
<ul>
<li>There isn&#8217;t so much a VBA community as 4 VBA communities: ASP VBA, Excel VBA, Word VBA, and finally also Access VBA (about in that order of prominence) &#8211; and then there&#8217;s the VB6 and VB.NET community too, with solutions that often don&#8217;t apply to VBA.<br />
So the search queries have to get more and more elaborate, adding &#8220;-asp&#8221; and &#8220;-excel&#8221; is common if you want to find anything &#8211; thus it takes longer until you find your solutions.</li>
<li>There are plenty of solution providers that might provide reasonable solutions, but cost money. Now, that&#8217;s a problem of mine I guess, but I don&#8217;t like giving my credit card info to some obscure website for a solution that might or might not work for me. Luckily, <a href="http://www.customizegoogle.com/">CustomizeGoogle</a> filters those out quite reliably, after I tell it to.</li>
<li>There are plenty of inexperienced users when it comes to VBA, way more so than with most other programming languages and other technologies I used so far (well, <a href="http://en.wikipedia.org/wiki/Python_(programming_language)">Python</a> and <a href="http://en.wikipedia.org/wiki/Ruby_(programming_language)">Ruby</a> tend to have geeky target audiences anyway, but the same applies to <a href="http://en.wikipedia.org/wiki/Java_(programming_language)">Java</a>). This means two things:
<ul>
<li>Often, questions are answered less than optimal by only slightly more knowledgable users than the ones asking the question, meaning the solution is either just wrong or not generic and thus doesn&#8217;t work in a slightly altered context.</li>
<li>Even more often, questions aren&#8217;t answered at all. The favourites here are the people later writing &#8220;nevermind, I found the solution&#8221;, without providing <em>what</em> that solution was that I could use now as well&#8230;</li>
</ul>
</li>
</ul>
<p>Keep in mind that I don&#8217;t have any problems with inexperienced users whatsoever, I&#8217;m regularly a newbie in yet another programming language I&#8217;m learning myself. And asking questions is a good thing anyway &#8211; it&#8217;s just that it seems like more experienced VBA programmers move on to VB.NET or something and thus VBA queries often disappear in the void, because there&#8217;s nobody experienced around to answer them.</p>
<p>That&#8217;s all for now, stay tuned for <a href="http://www.haslo.ch/blog/whats-wrong-with-vba-33/">part 3 with syntax, MS Access, other things and a conclusion</a>.</p>
<p style="text-align: center;"><a href="http://www.haslo.ch/blog/whats-wrong-with-vba-13/">part 1</a> &#8211; <a href="http://www.haslo.ch/blog/whats-wrong-with-vba-23/">part 2</a> &#8211; <a href="http://www.haslo.ch/blog/whats-wrong-with-vba-33/">part 3</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.haslo.ch/blog/whats-wrong-with-vba-23/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What&#8217;s Wrong With VBA? (1/3)</title>
		<link>http://www.haslo.ch/blog/whats-wrong-with-vba-13/</link>
		<comments>http://www.haslo.ch/blog/whats-wrong-with-vba-13/#comments</comments>
		<pubDate>Sat, 06 Sep 2008 13:56:11 +0000</pubDate>
		<dc:creator>haslo</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[scorchers]]></category>
		<category><![CDATA[vb]]></category>

		<guid isPermaLink="false">http://www.haslo.ch/blog/?p=267</guid>
		<description><![CDATA[part 1 &#8211; part 2 &#8211; part 3
Visual Basic for Applications &#8211; the legacy language that Microsoft apparently still won&#8217;t drop even in future Office updates, although they&#8217;re working on it, and certainly hasn&#8217;t dropped in Office 2007. The plague with a lobby. Why is it so bad, is it so bad at all?
This very [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.haslo.ch/blog/whats-wrong-with-vba-13/">part 1</a> &#8211; <a href="http://www.haslo.ch/blog/whats-wrong-with-vba-23/">part 2</a> &#8211; <a href="http://www.haslo.ch/blog/whats-wrong-with-vba-33/">part 3</a></p>
<p><a href="http://en.wikipedia.org/wiki/Visual_Basic_for_Applications">Visual Basic for Applications</a> &#8211; the legacy language that Microsoft apparently still won&#8217;t drop even in future Office updates, although they&#8217;re working on it, and certainly hasn&#8217;t dropped in Office 2007. The plague with a <a href="http://classicvb.org/petition/">lobby</a>. Why is it so bad, is it so bad at all?</p>
<p>This very subject here was, in fact, one of the things that made me think &#8220;I have to get a blog again&#8221; over those years when I didn&#8217;t have one &#8211; I so wanted to write it whenever I was forced to work with applications coded inside <a href="http://office.microsoft.com/en-us/access/">MS Access</a>, or when I coded them myself from scratch. I decided to make what started as a single post into a three part series, simply because there was so much content that one blog post couldn&#8217;t hold it all.</p>
<p>I won&#8217;t go into VBA for the rest of the Office suite too much, for tiny macro things it might even fit, what I&#8217;m talking about is medium (and larger) applications. And I will use the term &#8220;database&#8221; for the course of this article series for something it technically doesn&#8217;t strictly apply to, which is a MS Access application and actually an entire <a href="http://en.wikipedia.org/wiki/Database_management_system">DBMS</a>, plus GUI stuff and application logic, all mashed together.</p>
<p>So, what are all those things that bug me so much?<br />
<span id="more-267"></span></p>
<h2>Language Updates</h2>
<p>That&#8217;s possibly the biggest gripe of them all. Quoting the very <a href="http://msdn.microsoft.com/en-us/isv/bb190538.aspx">Microsoft VBA site</a>, at least MS makes their stance towards VBA perfectly clear:</p>
<blockquote><p>[...] As previously announced, Microsoft does not expect to make significant enhancements to VBA. [...]</p>
<p>As of July 1, 2007, Microsoft will no longer offer VBA distribution licenses to new customers. Existing VBA customers can still purchase additional VBA licenses from Summit Software and Microsoft for existing solutions.</p></blockquote>
<p>In other words, &#8220;we&#8217;re desparately trying to get rid of this mess&#8221;. Well, why wouldn&#8217;t they: VBA wasn&#8217;t updated for nearly 10 years now &#8211; while programming languages evolved around it, some very well-designed behemoths (for the time they were designed at) like <a href="http://en.wikipedia.org/wiki/C%2B%2B">C++</a> still stand their ground, many others have vanished and were replaced.</p>
<p>Yes, of course there&#8217;s always a demand for coders for older languages, just look at <a href="http://en.wikipedia.org/wiki/Cobol">COBOL</a>. If you like VBA, there&#8217;s plenty of legacy Access applications, and <a href="http://www.fmsinc.com/TPapers/genaccess/DBOD.asp">places where Access makes sense</a>, so you won&#8217;t be out of a job any time soon.</p>
<p>That doesn&#8217;t change that the language would be in desparate need of an update, wouldn&#8217;t the update already exist in the form of <a href="http://en.wikipedia.org/wiki/Visual_Basic_.NET">VB.NET</a> and, to a lesser extent, in <a href="http://en.wikipedia.org/wiki/C_Sharp_(programming_language)">C#</a>. Why Microsoft hasn&#8217;t at least added support for those inside MS Access in the course of introducing <a href="http://www.microsoft.com/NET/">.NET</a> is beyond me.</p>
<h2>The API</h2>
<p>What clearly does belong to the VBA API, particularly in our context of developing MS Access applications, is the windowing framework. While it has its very own problems that I&#8217;ll describe in the IDE chapter, it does what it&#8217;s supposed to do rather well: Forms, reports and components, with a nice drag-and-drop interface for tinkering interfaces. It doesn&#8217;t have the best performance out there, but for database applications that work, who makes that their top priority.</p>
<p>Beyond those widgets and happy drag-and-drop things, for the most part, the Application Programmer Interface of VBA can be described with a few simple words: It doesn&#8217;t exist. While VBA does make use of <a href="http://en.wikipedia.org/wiki/Data_Access_Objects">DAO</a> and <a href="http://en.wikipedia.org/wiki/ActiveX_Data_Objects">ADO</a> (not the way better <a href="http://en.wikipedia.org/wiki/ADO.NET">ADO.NET</a>, mind you), and the <a href="http://support.microsoft.com/kb/222101">Office object model</a> (which is actually more comfortable to use in VBA than in C#), everything that goes beyond that is out of bounds.</p>
<p>Let me illustrate by means of a symptomatic example.</p>
<p>Let&#8217;s assume you want a dynamically sized array, a Vector or ArrayList, that grows and shrinks as you add and remove items, preferrably useable as a <a href="http://en.wikipedia.org/wiki/Stack_(data_structure)">stack</a> or <a href="http://en.wikipedia.org/wiki/Queue_(data_structure)">queue</a> too by means of simple procedures. Now, in every other language that&#8217;s as simple as importing a bit of the API and then using said dynamic array. Not so in VBA, that bit of the API doesn&#8217;t exist (except if you count the <a href="http://msdn.microsoft.com/en-us/library/a1y8b3b3(VS.80).aspx">Collection</a> that has whooping 4 methods). There are &#8220;dynamically sized arrays&#8221; through lines like this one:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">ReDim</span> <span style="color: #000080;">Preserve</span> myArray(0 <span style="color: #000080;">To</span> arraySize)</pre></div></div>

<p>This does mean though that all the automatic growing and shrinking has to be added by hand, and push and pop don&#8217;t work at all. In short, you have to do everything yourself.</p>
<p>Which I did by the way, you can <a href="http://www.haslo.ch/blog/vba-vector-classes/">download my classes here</a>.</p>
<h2>Mangled Tiers</h2>
<p>Every non-trivial application, particularly multi-user applications, is best handled with <a href="http://en.wikipedia.org/wiki/Multitier_architecture">multiple tiers</a>: A database tier, a client/presentation tier, maybe an application server in between, that&#8217;s usually enough but can be extended. Less is bad, more is more complicated but depending on the application, necessary.</p>
<p>In MS Access, everything is &#8220;in the database&#8221; by default. Now,what does this mean? Basically, it&#8217;s a mess, and sorting things out properly is nearly impossible, whenever you update the database you also update the application and extending the user circle beyond, say, 1-2 users inevitably leads to problems (more on this later).</p>
<p>It is worth noting that these tiers can be somewhat simulated by using multiple databases for different purposes: You can easily have an &#8220;application&#8221; database that just does frontend work, and a &#8220;data&#8221; database. You can then create links from the &#8220;application&#8221; database to the &#8220;data&#8221; database, and have the frontend update independendly of the backend.</p>
<p>That&#8217;s common practice and makes sense, and comes close to true multi tier programming, although it still makes a mess of things because those links are hardcoded file paths and aren&#8217;t as easy to manage as they should be; the &#8220;data&#8221; database&#8217;s location has to be known on a file share, and every user needs write access to that share, which leads to obvious security inconsistencies and further problems that we&#8217;ll explore in the course of part 3.</p>
<p>The problem about paths being hardcoded can of course be solved by writing libraries that update paths, and the tier problem as a whole can to some extent be resolved by having data reside in an MS SQL (or other, through the rather dated <a href="http://en.wikipedia.org/wiki/Open_Database_Connectivity">ODBC</a>) database.</p>
<h2>What&#8217;s MVC?</h2>
<p>This problem is very similar to the last one concerning mangled tiers. Modern applications often use, for maintenance and development reasons, a <a href="http://en.wikipedia.org/wiki/Model-view-controller">Model-View-Controller</a> approach. Some languages and frameworks, like <a href="http://www.rubyonrails.org/">Ruby on Rails</a>, even make it really hard not to (which is good, considering the approach makes sense). Now, if you want to create a program that&#8217;s cleanly using that paradigm in VBA, you basically have to ignore all the structure there is and make a new one. The good news is that you can actually do that, of course, and VBA doesn&#8217;t stop you from doing it &#8211; it just doesn&#8217;t help you a bit.</p>
<p>It all starts out so nicely:</p>
<ul>
<li>The <strong>model</strong> is the database, tables and views can be accessed via DAO or ADO</li>
<li>The <strong>view</strong> is WYSIWYG-edited and stashed in Reports and Forms</li>
<li>Every Frame has its own class, akin to its very own <strong>controller</strong></li>
</ul>
<p>Regarding <strong>model</strong>s: Yes, in theory it&#8217;s nice like that. However, as soon as we start having things that go beyond tables and views, we&#8217;re screwed. That goes for simple things like tree view models (that are stored inside the tree view and not really accessible from the outside). You can make <a href="http://www.4guysfromrolla.com/webtech/011401-1.shtml">stand-alone recordsets</a> (aka RAM tables), you can even <a href="http://support.microsoft.com/kb/184397">disconnect recordsets</a> from their source, that&#8217;s good. But overall, the model is in the view and vice versa, splitting the two is hard and in some places impossible.</p>
<p>The <strong>view</strong> only in the WYSIWYG editor is a nice thought for simple things, but when you want to start exchanging components on the fly, you have to write your own view classes (or end in chaos, as many VBA projects do) anyway. Or, the alternative many VBA projects take, have invisible components that you make visible or visible depending on the mode the form currently is in &#8211; a maintenance nightmare. The best approach here is having subforms and exchanging those, that actually works really well too and is my favourite approach. It&#8217;s just not the way VBA and Access make easy, and it can yet again very easily lead to duplicated bits (code or UI components).</p>
<p>Finally, the <strong>controller</strong> &#8211; you can avoid duplicated code and make pretty good controllers if you completely ignore the Frame&#8217;s default classes and only use those for proxying your own controller classes that you write in addition to them. Works well, it&#8217;s just, again, not the way VBA and Access makes easy.</p>
<p>That&#8217;s all for now, we&#8217;re warming up. Stay tuned for&#8230;</p>
<ul>
<li><a href="http://www.haslo.ch/blog/whats-wrong-with-vba-23/">Part 2 with error handling, IDE, object orientation and the community</a></li>
<li><a href="http://www.haslo.ch/blog/whats-wrong-with-vba-33/">Part 3 with syntax, MS Access, other things and a conclusion</a></li>
</ul>
<p style="text-align: center;"><a href="http://www.haslo.ch/blog/whats-wrong-with-vba-13/">part 1</a> &#8211; <a href="http://www.haslo.ch/blog/whats-wrong-with-vba-23/">part 2</a> &#8211; <a href="http://www.haslo.ch/blog/whats-wrong-with-vba-33/">part 3</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.haslo.ch/blog/whats-wrong-with-vba-13/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bad PSP Games</title>
		<link>http://www.haslo.ch/blog/bad-psp-games/</link>
		<comments>http://www.haslo.ch/blog/bad-psp-games/#comments</comments>
		<pubDate>Mon, 01 Sep 2008 10:57:00 +0000</pubDate>
		<dc:creator>haslo</dc:creator>
				<category><![CDATA[Video Games]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[psp]]></category>
		<category><![CDATA[reviews]]></category>
		<category><![CDATA[scorchers]]></category>
		<category><![CDATA[video games]]></category>

		<guid isPermaLink="false">http://www.haslo.ch/blog/?p=380</guid>
		<description><![CDATA[After only having written about awesome games so far, it&#8217;s time there&#8217;s some negativity on this blog as well. So I decided to write a list with the worst PSP games I&#8217;ve played so far. Keep in mind that as always, the list is subjective, and unordered. And, there are plenty of good PSP games, [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_422" class="wp-caption alignright" style="width: 160px"><a href="http://www.haslo.ch/blog/wp-content/uploads/2008/09/psp_2.jpg"><img class="size-thumbnail wp-image-422" title="PSP, here with Everybody's Golf 2 (a good game, so it technically doesn't fit this article)" src="http://www.haslo.ch/blog/wp-content/uploads/2008/09/psp_2-150x150.jpg" alt="PSP" width="150" height="150" /></a><p class="wp-caption-text">PSP</p></div>
<p>After only having written about awesome games so far, it&#8217;s time there&#8217;s some negativity on this blog as well. So I decided to write a list with the worst PSP games I&#8217;ve played so far. Keep in mind that as always, the list is subjective, and unordered. And, there are plenty of good PSP games, so this is not a post that says anything like &#8220;the PSP sucks&#8221;.</p>
<p>Here we go, the worst PSP games I&#8217;ve played to date.</p>
<ul>
<li><a href="http://www.guiltygearjudgment.com/">Guilty Gear Judgement</a>: I guess if you&#8217;re a fan of the Guilty Gear series, you&#8217;ll like this one. I never found a combo, just 4 repetitive attacks, always the same enemies every stage &#8230; boring.</li>
<li><a href="http://www.us.playstation.com/PSP/Games/The_Simpsons_Game">The Simpsons</a>: I&#8217;m a huge Simpsons fan. The game has potential, with all the different specials and levels and whatnot. If it weren&#8217;t for the horrible, awkward, terrible camera. No go. Please, don&#8217;t make me jump to my doom by rotating the camera mid-air.</li>
<li><a href="http://www.us.playstation.com/PSP/Games/Bubble_Bobble_Evolution">Bubble Bobble Evolution</a>: Artificial story (the dragons are no longer dragons but boys), a strange nemesis that helps the heroes get out of his prison, 3D features that weren&#8217;t necessary, and strange controls with enemies that I have no idea how to defeat, I tried for 30 minutes &#8230; nothing like I remember Bubble Bobble to be.</li>
<li><a href="http://en.wikipedia.org/wiki/Space_Invaders_Evolution">Space Invaders Evolution</a>: I thought I&#8217;d get <a href="http://www.taito.com/csm/title/2008/sie/sie_psp/index.html">Space Invaders Extreme</a>, which got good reviews, silly old me. The Evolution one is just Space Invaders in 3D, more or less &#8230; not horribly bad, but played a million times.</li>
<li><a href="http://na.square-enix.com/valkyrieprofile/index2.html">Valkyrie Profile: Lenneth</a>: You like watching confusing 2D ingame graphic cutscenes while you&#8217;re pretending to play a game? Occasionally clicking a button (just one, mind you) every 15 minutes, for hours? I don&#8217;t. Maybe the game changes after 90 minutes though, who knows.</li>
<li><a href="http://silenthillorigins.com/">Silent Hill: Origins</a>: I liked this one, the setup, the mood, the city, the story. Until the fights started getting a bit harder, and the problem weren&#8217;t so much tough enemies as horrible controls and fiddly inventory. Sad, really.</li>
<li><a href="http://www.capcom.com/psp/v2/mmmhx_gamepage.html">Mega Man: Maverick Hunter X</a>: Supposedly brings Mega Man into 3D &#8211; which it does, to some extent. Too bad the controls are nothing like I remember them to be, and jumping and shooting are tough to coordinate. I have plenty of known good games that are easy to control, no reason to wrestle horrible controls for a potentially good game.</li>
<li><a href="http://www.japan.ea.com/ssxontour/">SSX On Tour</a>: This one actually does many things right &#8211; except that the PSP&#8217;s screen is much too small to make you feel like you&#8217;re actually snowboarding. Which is what bought me when I first played the very first SSX. So, sorry, wrong platform.</li>
<li>Prince of Persia <a href="http://ubi.com/US/Games/Info.aspx?pId=4124">Revelations</a> and <a href="http://ubi.com/US/Games/Info.aspx?pId=5477">Rival Swords</a>: The problem with these is that they&#8217;re pure ports (with very few more levels). Meaning, the graphics aren&#8217;t optimized, read blurry, and while the story and levels are great they&#8217;re just copies of what you played already, or can have better on a big console or computer.</li>
<li><a href="http://www.wormsopenwarfare2.com/">Worms: Open Warfare 2</a>: Occasional stuttering and being a game that hasn&#8217;t been made for the PSP&#8217;s resolution (with too small fonts and irregularly pixelated worms, much unlike the very first Worms that had intentional and controlled pixelation) make this way worse than it could and should have been, too bad.</li>
</ul>
<p>There you go. Of course, I&#8217;ll eventually make the counterpart to this post, with all the games I like.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.haslo.ch/blog/bad-psp-games/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
