<?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 Accidental Developer &#187; Best Practices</title>
	<atom:link href="http://osric.com/chris/accidental-developer/category/best-practices/feed/" rel="self" type="application/rss+xml" />
	<link>http://osric.com/chris/accidental-developer</link>
	<description>What if Gregor Samsa awoke a computer programmer?</description>
	<lastBuildDate>Mon, 30 Apr 2012 21:16:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Robert Sedgewick: &#8220;Algorithms for the Masses&#8221;</title>
		<link>http://osric.com/chris/accidental-developer/2012/04/robert-sedgewick-algorithms-for-the-masses/</link>
		<comments>http://osric.com/chris/accidental-developer/2012/04/robert-sedgewick-algorithms-for-the-masses/#comments</comments>
		<pubDate>Tue, 10 Apr 2012 01:23:05 +0000</pubDate>
		<dc:creator>Chris Herdt</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[algorithms]]></category>
		<category><![CDATA[robert sedgewick]]></category>

		<guid isPermaLink="false">http://osric.com/chris/accidental-developer/?p=679</guid>
		<description><![CDATA[On 9 April 2012, I saw Robert Sedgewick give the talk, &#8220;Algorithms for the Masses,&#8221; on the campus of Drexel University. I have several of Sedgewick&#8217;s books on my shelves at home, including Algorithms in Java, Third Edition, Parts 1-5 and Introduction to Programming in Java: An Interdisciplinary Approach. One of my previous computer science [...]]]></description>
			<content:encoded><![CDATA[<p>On 9 April 2012, I saw Robert Sedgewick give the talk, &#8220;Algorithms for the Masses,&#8221; on the campus of Drexel University. I have several of Sedgewick&#8217;s books on my shelves at home, including <a href="http://www.amazon.com/gp/product/0201775786/ref=as_li_ss_tl?ie=UTF8&#038;tag=osriccom-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0201775786">Algorithms in Java, Third Edition, Parts 1-5</a><img src="http://www.assoc-amazon.com/e/ir?t=osriccom-20&#038;l=as2&#038;o=1&#038;a=0201775786" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> and <a href="http://www.amazon.com/gp/product/0321498054/ref=as_li_ss_tl?ie=UTF8&#038;tag=osriccom-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0321498054">Introduction to Programming in Java: An Interdisciplinary Approach</a><img src="http://www.assoc-amazon.com/e/ir?t=osriccom-20&#038;l=as2&#038;o=1&#038;a=0321498054" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />. One of my previous computer science professors, <a href="http://www.cis.uab.edu/sloan/">Kenneth Sloan</a>, counted Sedgewick among his classmates.</p>
<p>The basic thesis of the lecture was that <em>good algorithms matter</em> and that we need to champion good algorithms where they are most needed (particularly in the sciences).</p>
<p>One of his points was that computer science is currently very abstract and lacks a basis in the scientific method. Algorithms need to be tested against models to see how they actually perform. In some cases, the theoretical performance of an algorithm can be off by several orders of magnitude compared to actual performance. For example, the quicksort algorithm is quadratic (<em>N</em><sup>2</sup>) in the worst case, but <em>N</em> log <em>N</em> most of the time. There&#8217;s a reason why quicksort (by the way, the subject of Sedgewick&#8217;s 1975 PhD dissertation) is widely used, in spite of the fact that it is O(<em>N</em><sup>2</sup>) versus binary sort&#8217;s O(<em>N</em> log <em>N</em>).</p>
<p>Sedgewick said, though, that he has run into many computer scientists who fail to observe the difference between theoretical worst-case and actual performance. Some will choose an algorithm based on Big-O analysis alone. Sedgewick&#8217;s response: Big-O is an upper bound, but is your input an example of the worst-case? Probably not. Algorithms should be chosen based on their actual performance.</p>
<p>[As an alternative to Big-O notation, Sedgewick suggested <a href="http://introcs.cs.princeton.edu/java/41analysis/">Tilde notation</a>, although from my perspective I don't see that there is a great difference between them.]</p>
<p>He also gave an example of taking theory too far in the other direction. A computer scientist gave a talk demonstrating that his algorithm, Algorithm B, though exceedingly complex, was superior to the simpler Algorithm A. When Sedgewick asked him why, he explained that Algorithm B removed a log log <em>N</em> factor. Sedgewick&#8217;s analysis was that log log <em>N</em>, in this universe, amounts to 6 &#8212; hardly worth trading algorithms for what, realistically, amounts to a constant factor.</p>
<p>[Why 6? Wikipedia and other sources estimate the <a href="http://en.wikipedia.org/wiki/Observable_universe#Matter_content">number of atoms in the observable universe</a> at 10<sup>80</sup>. The natural logarithm of 10<sup>80</sup> is 184. The natural logarithm of 184 is 5.2. 6 sounds like a fine estimate.]</p>
<p>Another point was that scientists often need algorithms in their daily work, but do things the hard way for a lack of knowledge. One example was a biologist who was trying to use Excel to calculate a standard deviation for over a million data points, an idea that caused several audience members to cringe.</p>
<p>How do we bring a better understanding of algorithms to the masses? (By masses, I think he really means the masses of college-educated scientists&#8211;not quite everyone, but still a much larger group than just computer scientists.) He had several suggestions:</p>
<p><strong>Analytic Combinatorics</strong><br />
From what I gather, analytic combinatorics is a way of using formal languages to describe recurrence relations, and thus a simpler (and easier-to-teach) method of creating generating functions. I don&#8217;t exactly know what that means, but you can read the book on it (by Flajolet and, of course, Sedgewick): <a href="http://algo.inria.fr/flajolet/Publications/book.pdf">Analytic Combinatorics</a> (PDF).</p>
<p><strong>Testing Algorithms Empirically</strong><br />
In computer science classes, he suggests students run a program on an increasing series of inputs (e.g. n = { 1000, 2000, 4000, 8000, 16000, &#8230; }) and examining the ratios of input size to run times to understand the real impact of running in linear time, N log N time, quadratic time, etc. (This is something that some of my past computer science courses have included, so apparently they have already adopted this piece of Sedgewick&#8217;s advice.)</p>
<p><strong>Changing Intro to CS Courses</strong><br />
Sedgewick recommends identifying core elements of computer science, such as classic algorithms, and teaching them to everyone as early as possible. Some changes made to the curriculum at Princeton (where Sedgewick teaches) have led to a dramatic increase in enrollment in intro computer science courses and from a wider range of majors.</p>
<p><strong>Change Publishing</strong><br />
Sedgewick touted his Introduction to Programming in Java and its <a href="http://introcs.cs.princeton.edu/java/home/" title="Companion web site to the book, Introduction to Programming in Java">accompanying web site</a> as a major change for textbooks. The programming examples are short and simple, but demonstrate a wide range of real-world applications across several branches of science. (Although he did not mention it in the lecture, I also appreciated that the examples in this book often include graphics, sound, and animation &#8212; which are far more thrilling results than the usual ASCII that intro CS students see as the fruits of their labors.)</p>
<p>He also criticized academic publishing for making journal articles look as much like boring print articles as possible, in spite of the fact that they are now primarily accessed online. Where are the full-color figures? The hyperlinks? Animated simulations? These things are all possible online, but instead publishers restrict content to the form that is least likely to be accessed.</p>
<p>Several times in the lecture, he also mentioned that freshly-minted computer scientists often have little or no background in science: no physics, no chemistry, no biology. Although he recognized this as a problem, he had no solutions (other than to, perhaps, require foundational science courses as part of a CS degree).</p>
<p>The last two items&#8211;changing the curriculum and publishing&#8211;really sounded like a Sedgewick paid-programming infomercial. &#8220;Everyone should take courses in the subject of which I am an expert, and they should use the book I wrote to teach it.&#8221; It was hard not to be a little skeptical of his motives. At the same time, I can&#8217;t help but think that he&#8217;s right.</p>
]]></content:encoded>
			<wfw:commentRss>http://osric.com/chris/accidental-developer/2012/04/robert-sedgewick-algorithms-for-the-masses/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Douglas Crockford: &#8220;Programming Style and Your Brain&#8221;</title>
		<link>http://osric.com/chris/accidental-developer/2012/01/douglas-crockford-programming-style-and-your-brain/</link>
		<comments>http://osric.com/chris/accidental-developer/2012/01/douglas-crockford-programming-style-and-your-brain/#comments</comments>
		<pubDate>Sat, 28 Jan 2012 23:13:31 +0000</pubDate>
		<dc:creator>Chris Herdt</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Douglas Crockford]]></category>

		<guid isPermaLink="false">http://osric.com/chris/accidental-developer/?p=632</guid>
		<description><![CDATA[Douglas Crockford provided many examples of error-resistant Javascript in his 13 January 2012 talk, "Programming Style and Your Brain." Here's a summary of the talk and 3 of the specific Javascript examples Crockford provided.]]></description>
			<content:encoded><![CDATA[<p>On 13 January, 2012, I saw Javascript expert <a href="http://www.crockford.com/">Douglas Crockford</a> deliver a talk titled &#8220;Programming Style and Your Brain&#8221; on the campus of the University of Pennsylvania. The brain portion of the talk (which Mr Crockford said borrowed heavily from Daniel Kahneman&#8217;s book <em><a href="http://www.amazon.com/gp/product/0374275637/ref=as_li_ss_tl?ie=UTF8&#038;tag=osriccom-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0374275637">Thinking, Fast and Slow</a><img src="http://www.assoc-amazon.com/e/ir?t=osriccom-20&#038;l=as2&#038;o=1&#038;a=0374275637" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></em>) was really just to emphasize that human beings have 2 distinct ways of thinking: Head (slow) and Gut (fast). Computer programming requires some of both, but the same Gut-thinking that can provide useful insights can sometimes also lead us astray.</p>
<p>For example, programmers have been arguing since the 1970s about the placement of curly braces. Some people prefer:</p>
<p><code>if ( true ) {<br />
    doSomething();<br />
}</code></pre>
<p>Others prefer:</p>
<p><code>if ( true )<br />
{<br />
    doSomething();<br />
}</code></p>
<p>Crockford says that if the compiler treats these 2 forms as equivalent, then there is really no difference (so long as you are consistent). These are Gut decisions. However, people will use their Head to try to rationalize their Gut decisions and come up with some ridiculous rationalizations.</p>
<p>OK, fine. What does that mean in practical terms, i.e. writing code?<br />
<span id="more-632"></span><br />
Crockford's advice is:</p>
<blockquote><p><strong><em>Prefer forms that are error-resistant.</em></strong></p></blockquote>
<p>This is aligned closely with my own advice:</p>
<blockquote><p><strong><em>Prefer explicit forms to implicit forms.</em></strong></p></blockquote>
<p>One of Crockford's illustrations (which I have not verified but sounds plausible enough) is that the space character was introduced into Latin writing after the prior practice of running all the words together led to ambiguity and transcription errors. The space characters made the text more explicit, and therefore less prone to transcription error.</p>
<p>Here are 3 of the Javascript examples Crockford provided during his talk:</p>
<p><strong>Curly Braces &#038; Conditional Statements and Loops</strong><br />
In Javascript, a conditional statement or a loop containing only one statement can be written without curly braces:<br />
<code>if ( condition ) doSomething();</code></p>
<p>This form is error-prone. Include the curly braces:<br />
<code>if ( condition ) {<br />
    doSomething();<br />
}</code></p>
<p>Some people might complain and say that this is less concise and requires extra typing. Crockford's response was: less concise is better, and the majority of the time it takes to write a program is in thinking, not typing. If adding a few characters is slowing you down, you either need to take a typing class or spend more time thinking!</p>
<p><strong>Double-Equals versus Triple-Equals</strong><br />
Crockford said that using double-equals (==) to compare objects is <em>always</em> a bad idea because it does implicit type conversion. For example:<br />
<code>var n = 5;<br />
n == 5; //true<br />
n == "5"; // true<br />
n === "5"; // false<br />
n === 5; // true</code></p>
<p>The triple-equals also helps developers know that a number is expected, not a character or other data type.</p>
<p>As Crockford emphasized:</p>
<blockquote><p><strong><em>If a feature is sometimes problematic, and a more reliable feature exists, use it!</em></strong></p></blockquote>
<p>Some people might try to justify the use of implicit type conversion: "But I'm doing it intentionally!" Crockford said that relying on implicit type conversion means you don't know what you're doing.</p>
<p><strong>Incrementing Values</strong><br />
Crockford said he never uses the prefix or postfix ++ operator, because many people don't understand the difference and it can lead to confusion. For example:<br />
<code>var x = 5;<br />
var y = x++; // y is now 5 and x is 6<br />
var z = ++x; // z is now 7 and x is 7<br />
x += 1; // x is now 8. This is Crockford's preferred method to increment a variable</code></p>
<p>Crockford provides several resources to help people write better, more error-resistant Javascript:</p>
<ul>
<li><a href="http://javascript.crockford.com/code.html">Code Conventions for the JavaScript programming language</a></li>
<li><a href="http://www.jslint.com/">JSLint</a>, which alerts you to errors in your code or error-prone code ("JSLint <em>will</em> hurt your feelings")</li>
<li><a href="http://javascript.crockford.com/jsmin.html">JSMin</a>, which "minifies" (removes unnecessary characters) from Javascript files. This should be largely unnecessary if your web server uses <a href="http://developer.yahoo.com/performance/rules.html#gzip">Gzip compression</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://osric.com/chris/accidental-developer/2012/01/douglas-crockford-programming-style-and-your-brain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Test-Driven Programming Assignments</title>
		<link>http://osric.com/chris/accidental-developer/2012/01/test-driven-programming-assignments/</link>
		<comments>http://osric.com/chris/accidental-developer/2012/01/test-driven-programming-assignments/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 02:22:41 +0000</pubDate>
		<dc:creator>Chris Herdt</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[JUnit]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[test-driven development]]></category>
		<category><![CDATA[unit tests]]></category>

		<guid isPermaLink="false">http://osric.com/chris/accidental-developer/?p=601</guid>
		<description><![CDATA[Is consuming unit tests as good an introduction to test-driven development as writing your own unit tests? In some ways, it may even be better.]]></description>
			<content:encoded><![CDATA[<p>I am enrolled in another graduate course this semester, Theory of Computation. Like last semester, the programming assignments include unit tests (<a href="http://www.junit.org/">JUnit</a> tests for the Java assignments). One can be very confident prior to submitting an assignment that it is done properly if it passes all the unit tests!</p>
<p>I&#8217;ve been interested in unit testing and test-driven development for several years now, but have never put it into practice. It seemed like a good idea in theory, but it required picking a testing framework, installing it, configuring it, and, of course, writing good tests. Without any hands-on experience, it&#8217;s a difficult practice to adopt. Getting introduced to unit tests this way lifts nearly all those burdens. On top of that, the advantages are clear: the tests will tell you when you have it right.</p>
<p>I was a little surprised to run into unit testing via coursework, because I&#8217;d been under the impression that computer science education focuses a lot on theory, and skips over a lot of the practice. I&#8217;ve met a lot of people coming out of computer science programs who, while probably excellent theorists, don&#8217;t know heads from tails when you sit them at a terminal. I was happy to see that my coursework included practical knowledge as well.</p>
<p>All the unit tests are provided by the professor. I assume we may write some tests of our own later on&#8211;and certainly nothing is stopping us from writing our own tests now&#8211;but I do wonder how many students will be prepared to take that next step. From what I understand, writing good tests is the better part of successful unit testing.</p>
<p>Some things I&#8217;ve noticed about the provided unit tests:</p>
<ul>
<li>There are <em>a lot</em> of them. The unit tests are half as long the code that passes them.</li>
<li>There are many sample values to test the same function, mostly to test specific <a href="http://en.wikipedia.org/wiki/Edge_case">edge cases</a>. Failure at a specific edge case helps to identify where the code went wrong.</li>
<li>In some cases, the tests are within a loop that generates random test data. Although there&#8217;s nothing quite like real human input to break your programs, 1000 random tests might help.</li>
</ul>
<p>In practice, do programmers tend to write their own unit tests? I imagine it would be ideal if you partnered with someone, and you wrote their unit tests, and they wrote yours. It might be easy to overlook an edge case or dismiss something as impossible if you are too involved with the specifications. At the same time, it is probably difficult to write a unit test without spending some time reading the specifications and understanding exactly what it is supposed to do.</p>
]]></content:encoded>
			<wfw:commentRss>http://osric.com/chris/accidental-developer/2012/01/test-driven-programming-assignments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When should alt text be blank?</title>
		<link>http://osric.com/chris/accidental-developer/2012/01/when-should-alt-text-be-blank/</link>
		<comments>http://osric.com/chris/accidental-developer/2012/01/when-should-alt-text-be-blank/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 00:51:42 +0000</pubDate>
		<dc:creator>Chris Herdt</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[accessibility]]></category>
		<category><![CDATA[alt]]></category>
		<category><![CDATA[JAWS]]></category>
		<category><![CDATA[WCAG]]></category>

		<guid isPermaLink="false">http://osric.com/chris/accidental-developer/?p=386</guid>
		<description><![CDATA[Although HTML image elements (img) are required to have alt text, the recommendations on how to use alt text are vague. Linked graphics should have descriptive alt text. Decorative graphics should have blank (empty) alt text. But what about graphics that don't convey pertinent information, such as a photograph of a corporate headquarters?]]></description>
			<content:encoded><![CDATA[<p>The <em>alt</em> attribute of an image element is a required HTML attribute (see <a href="http://www.w3.org/TR/html401/struct/objects.html#edef-IMG">the IMG element</a>). If it is not present, screen-reader software will typically read the <em>src</em> attribute instead. Text-based user agents such as Lynx, or browsers that allow users to disable images, will also typically use the <em>src</em> attribute in the absence of the <em>alt</em> attribute.</p>
<p>I had always heard that, unless the image conveys important information (e.g. a graphic of text used as navigation, or a chart or graph) that the alt text should be left blank:<br />
<code>&lt;img src="myimage.png" alt="" /&gt;</code></p>
<p>A screen-reader passes such an image over without saying anything. This makes sense to me. When I&#8217;ve closed my eyes and tried navigating the web using a screen-reader like <a href="http://www.freedomscientific.com/products/fs/jaws-product-page.asp">JAWS</a>, anything non-essential was a distraction and just got in my way. Knowing that a page contained an image of, say, a corporate headquarters in no way helped me understand the page content.</p>
<p>However, a colleague of mine suggested that the alt text should describe, briefly, the image. He offered a compelling use case: you are browsing on your mobile device with images disabled, due to bandwidth. How would you know if there was an image that you did want to view if no description was provided? This is a case where the alt text can provide a better user experience for users without vision impairments. But does it make the experience worse for users with vision impairments using assistive technology?</p>
<p>(A case could be made that vision-impaired users should also know there is an image on the page for orientation purposes: &#8220;The link to the annual report is underneath the photo of the corporate headquarters.&#8221; However, what may appear <em>above</em> or <em>below</em> on screen may not make sense when page content is read linearly.)</p>
<p>I looked to the <a href="http://www.w3.org/TR/WCAG/#text-equiv">WCAG 2.0 section on text alternatives</a>, which states that images used for decoration or formatting should be implemented in such a way that they &#8220;can be ignored by assistive technology.&#8221; That&#8217;s a good case for using an empty <em>alt</em> attribute. If the image is <em>sensory</em> (WCAG 2.0 has been criticized for being vague&#8211;obviously anything visual is sensory), then the item should &#8220;at least provide descriptive identification of the non-text content.&#8221;</p>
<p>What about that photo of the corporate headquarters then? It&#8217;s decorative, but not in the same way as a fleuron or a border. It may not be an inspiring image, but maybe it should have associated alt text.</p>
<p>I decided to check 4 sites that I thought might demonstrate best-practice, but found little consistency across these examples:</p>
<ul>
<li><a href="http://www.nfb.org/">The National Federation for the Blind</a> &#8211; they use rather extensive alt text for the main image on their homepage: &#8220;Graphic consisting of two photos. On left is a group of children with white canes on a hayride. Right is a close-up of a finger reading Braille.&#8221; However, they fail to use the <em>alt</em> attribute for their menu divider graphic, which is clearly a decorative element.</li>
<li><a href="http://www.freedomscientific.com/products/fs/jaws-product-page.asp">Freedom Scientific&#8217;s JAWS Screen Reading Software</a> &#8211; the alt text &#8220;A student uses JAWS to do work on a desktop computer&#8221; accompanies a photo of a man at a computer. Decorative images (menu dividers, stars) use an empty string for the alt text.</li>
<li><a href="http://webaim.org/services/">WAIM &#8211; Web Accessibility in Mind</a> &#8211; they avoid the issue on their services page by inserting the pictures as CSS background images. These would not appear at all to a screen reader, to a text-based browser, or to a user agent with images disabled. This would be functionally equivalent to using empty alt text.</li>
<li><a href="http://www.ssa.gov/disability/">The Social Security Administration&#8217;s Disabilities Benefits</a> &#8211; this page gets it <em>completely</em> wrong, including alt text for images that do not even appear visible to users with normal vision (e.g. a tracking image with the alt text &#8220;DCSIMG&#8221; and a spacer image with the alt text &#8220;blank space&#8221;).</li>
</ul>
<p><a href="http://web.mit.edu/atic/www/accessibility/guidelines.html">MIT&#8217;s general web-accessibility guidelines</a> offer some additional guidance:</p>
<blockquote><p>ALT tags are often misused, mostly people overuse them. It&#8217;s better to leave the ALT tag blank (ALT=&#8221;") then to enter a text description that&#8217;s not useful or is redundant. For example an image with a caption below it does not need alt text that matches the caption, leave the alt text blank to avoid redundancy.</p></blockquote>
<p><a href="http://www.umich.edu/webaccess/best/quickguide.html#alt">The University of Michigan&#8217;s Accessibility Quick Guide</a> suggests using empty alt text for <em>non-informative</em> images.</p>
<p>Unfortunately, we&#8217;re still left with a rather vague recommendation: use a description when <em>useful</em> or <em>informative</em>. How do we decide when a description is <em>useful</em> or <em>informative</em>? My gut feeling is to agree with MIT: it should be left blank in most cases (such as with the hypothetical photograph of a corporate headquarters), but I think no great harm is done if a brief description is included.</p>
]]></content:encoded>
			<wfw:commentRss>http://osric.com/chris/accidental-developer/2012/01/when-should-alt-text-be-blank/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Monitoring web server status with a shell script</title>
		<link>http://osric.com/chris/accidental-developer/2011/09/monitoring-web-server-status-with-a-shell-script/</link>
		<comments>http://osric.com/chris/accidental-developer/2011/09/monitoring-web-server-status-with-a-shell-script/#comments</comments>
		<pubDate>Sun, 11 Sep 2011 16:00:48 +0000</pubDate>
		<dc:creator>Chris Herdt</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[web server]]></category>

		<guid isPermaLink="false">http://osric.com/chris/accidental-developer/?p=499</guid>
		<description><![CDATA[Recently, my VPS (Virtual Private Server) ran into some issues where it exceeded the maximum amount of RAM allotted under my subscription. When this happens, the web server software shuts down and does not restart until I manually restart it. This is bad. I&#8217;m not always visiting my own web site, so it could be [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, my VPS (Virtual Private Server) ran into some issues where it exceeded the maximum amount of RAM allotted under my subscription. When this happens, the web server software shuts down and does not restart until I manually restart it.</p>
<p>This is bad. I&#8217;m not always visiting my own web site, so it could be down for days without me knowing. Although I really need to identify what is using all the RAM, in the meantime I&#8217;ll settle for a monitoring system that will notify me when the server is down.</p>
<pre><code>#!/bin/bash
if curl -s --head http://osric.com/ | grep "200 OK" &gt; /dev/null
  then
    echo "The HTTP server on osric.com is up!" &gt; /dev/null
  else
    echo "The HTTP server on osric.com is down!"
fi</code></pre>
<p><a href="http://curl.haxx.se/" title="cURL">cURL</a> will let you retrieve a URL via the command line, and provides more options than <a href="http://www.gnu.org/s/wget/" title="Wget">Wget</a> for a single URL. In this case, I used the <em>silent</em> switch to eliminate the status/progress output, and the <em>head</em> switch to retrieve only the document headers. The document header is then piped to <a href="http://www.gnu.org/s/grep/" title="Grep">Grep</a>, which searches for the string &#8220;200 OK&#8221; (the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1" title="HTTP status message 200 OK">HTTP status message for a successful request</a>).</p>
<p>I send the result of that to /dev/null so that the output doesn&#8217;t appear on the screen.</p>
<p>If grep does find 200 OK, then I send a success message to /dev/null. This is largely unnecessary, but it is nice to leave in to test the script in a successful case&#8211;just remove the <code>&gt; /dev/null</code>. If it doesn&#8217;t find 200 OK, then there is a problem. It might not mean, necessarily, that the web server is down, but it definitely indicates there is a problem that needs to be identified.</p>
<p>I added a call to this script to a crontab to run every 5 minutes. If there is no output, nothing happens. If there is output, the output is sent to me via e-mail, which, assuming I am checking my e-mail religiously, should reduce server downtime.</p>
]]></content:encoded>
			<wfw:commentRss>http://osric.com/chris/accidental-developer/2011/09/monitoring-web-server-status-with-a-shell-script/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CSS Sprites and Accessibility</title>
		<link>http://osric.com/chris/accidental-developer/2011/08/css-sprites-and-accessibility/</link>
		<comments>http://osric.com/chris/accidental-developer/2011/08/css-sprites-and-accessibility/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 03:11:00 +0000</pubDate>
		<dc:creator>Chris Herdt</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[accessibility]]></category>
		<category><![CDATA[bandwidth]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[sprites]]></category>

		<guid isPermaLink="false">http://osric.com/chris/accidental-developer/?p=438</guid>
		<description><![CDATA[Yahoo&#8217;s Best Practices for Speeding Up Your Web Site lists minimizing HTTP requests as the very first recommendation. One of the ways they suggest doing that is by using CSS sprites (which I mentioned previously in Clever Ways to Save Bandwidth). I recently applied this technique to a series of social media icons. Here&#8217;s an [...]]]></description>
			<content:encoded><![CDATA[<p>Yahoo&#8217;s <a href="http://developer.yahoo.com/performance/rules.html">Best Practices for Speeding Up Your Web Site</a> lists minimizing HTTP requests as the very first recommendation. One of the ways they suggest doing that is by using CSS sprites (which I mentioned previously in <a href="http://osric.com/chris/accidental-developer/2008/03/clever-ways-to-save-bandwidth/">Clever Ways to Save Bandwidth</a>).</p>
<p>I recently applied this technique to a series of social media icons. Here&#8217;s an example:<br />
<a href="http://osric.com/chris/css-sprites-social-media-icons-example.html" title="Social media icons CSS sprites example" target="_blank">http://osric.com/chris/css-sprites-social-media-icons-example.html</a></p>
<p>The example page uses a single image to display 8 separate icons from the following single image:</p>
<p><img src="http://osric.com/chris/images/social-media-icons.png" alt="CSS sprites of social media icons" /></p>
<p>Be careful when using background images as links. <span id="more-438"></span> Since there is nothing inside the anchor element, what appears if the image fails to load, or if the user agent is a screen reader? I added descriptive text to the title attribute of the anchor element. According to Dive Into Accessibility&#8217;s <a href="http://diveintoaccessibility.org/day_14_adding_titles_to_links.html" target="_blank">Adding Titles to Links</a>, reading the title attribute is an optional feature in the JAWS screen reader that is not enabled by default. I tested it using  a recent demo version of JAWS 12, and it read the title attributes without any settings adjustments. However, in a text-based browser, or with CSS or images disabled, the links will be completely invisible.</p>
<p>Google, in the following example, uses icons in conjunction with text. The icons add to the experience, but the site is still fully functional without the images:<br />
<img src="http://osric.com/chris/accidental-developer/wp-content/uploads/2011/08/google-search-options.png" alt="Partial screenshot of Google's search options" /></p>
<p>What is the gain from this effort to speed up a site?</p>
<p>There&#8217;s the reduction in file size&#8211;from 20.3 kB to 3.98 kB in my social media icon example, just 20% of the original file size&#8211;although part of that is due to a reduction in the overall number of colors. 8-bit images can have at most 256 colors, so the 8 icons share all 256, and are consequently not as true to the originals. Using CSS sprites for logos of different shapes and sizes, or for informational icons, might be a better use since the color palette would be shared.</p>
<p>Google&#8217;s sprites are again a good example that combines both logos and informational icons:<br />
<img src="http://osric.com/chris/accidental-developer/wp-content/uploads/2011/08/google-nav_logo83.png" alt="Google's CSS sprites" /></p>
<p>In kilobytes it is still a small savings compared to the bandwidth requirements of most of today&#8217;s pages. The savings are just for the initial page load though, because the browser will use cached images on subsequent loads. The user agent still makes a call to the server with every request, thought the server will reply with a short message (<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5">304 Not Modified</a>).</p>
<p>There&#8217;s still a round-trip between client and server. How long does that take? From my high-speed connection, only a couple milliseconds. From a mobile device? I haven&#8217;t tested it, although it is worth trying. The speeds on my G4 mobile device are still excruciatingly slow, so improving speed to mobile devices would go a long way to improving the mobile experience.</p>
<p>Overall, using CSS sprites seems like a trivial savings&#8211;one that the user will not notice, one that the server can manage, one that makes the images more difficult to maintain, and one that may reduce accessibility. If your site has extremely high traffic volumes it might be worthwhile to reduce the number of requests to the server, but overall it doesn&#8217;t appear to be particularly effective. Feel free to disagree in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://osric.com/chris/accidental-developer/2011/08/css-sprites-and-accessibility/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Opening links in a new window without the target attribute</title>
		<link>http://osric.com/chris/accidental-developer/2011/02/opening-links-in-a-new-window-without-the-target-attribute/</link>
		<comments>http://osric.com/chris/accidental-developer/2011/02/opening-links-in-a-new-window-without-the-target-attribute/#comments</comments>
		<pubDate>Sun, 20 Feb 2011 21:00:26 +0000</pubDate>
		<dc:creator>Chris Herdt</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[anchor]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[target]]></category>
		<category><![CDATA[validation]]></category>
		<category><![CDATA[window]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://osric.com/chris/accidental-developer/?p=354</guid>
		<description><![CDATA[Web developers often use the attribute target="_blank" to force a link to open in a new window. However, if you use an HTML validation service to check your web pages, you know that the target attribute is not valid in strict versions of HTML and XHTML. There is a simple way to have a link [...]]]></description>
			<content:encoded><![CDATA[<p>Web developers often use the attribute <code>target="_blank"</code> to force a link to open in a new window. However, if you use an <a href="http://validator.w3.org/">HTML validation service</a> to check your web pages, you know that the target attribute is not valid in strict versions of HTML and XHTML.</p>
<p>There is a simple way to have a link open in a new window using Javascript. You may have seen code like this:<br />
<code>&lt;<!-- -->a href="#" onclick="window.open('http://osric.net')"&gt;osric.net web hosting&lt;<!-- -->/a&gt;</code></p>
<p>That method has some serious drawbacks, though:</p>
<ul>
<li>The user now sees <em>#</em> in the browser&#8217;s status bar instead of the actual destination URL</li>
<li>The link fails if the Javascript fails (or if the browser has Javascript disabled</li>
<li>Search engines may not follow the link</li>
</ul>
<p>I&#8217;ve written a summary of the issue and the methods I&#8217;ve found so far that best address it. I moved it to a page outside this blog because of the Javascript examples, which were easier to include on a separate page:<br />
<a href="http://osric.com/chris/javascript/javascript-anchor-target-blank.html"><br />
<img src="http://osric.com/chris/accidental-developer/wp-content/uploads/2011/02/javascript-new-window-screenshot-300x199.png" alt="" title="How to best use Javascript to open links in a new window" width="300" height="199" class="alignnone size-medium wp-image-357" /></a></p>
<p><a href="http://osric.com/chris/javascript/javascript-anchor-target-blank.html">How to best use Javascript to open links in a new window</a></p>
]]></content:encoded>
			<wfw:commentRss>http://osric.com/chris/accidental-developer/2011/02/opening-links-in-a-new-window-without-the-target-attribute/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress Security Tips</title>
		<link>http://osric.com/chris/accidental-developer/2009/09/wordpress-security-tips/</link>
		<comments>http://osric.com/chris/accidental-developer/2009/09/wordpress-security-tips/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 22:18:32 +0000</pubDate>
		<dc:creator>Chris Herdt</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[birmingham]]></category>
		<category><![CDATA[file permissions]]></category>
		<category><![CDATA[mod_suexec]]></category>
		<category><![CDATA[security plugins]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[wcbham09]]></category>
		<category><![CDATA[wordcamp]]></category>

		<guid isPermaLink="false">http://osric.com/chris/accidental-developer/?p=235</guid>
		<description><![CDATA[I attended the WordCamp Birmingham conference this past weekend to find out more about all things WordPress. WordPress is an open source blog engine/lightweight Content Management System (CMS) that has a huge community of users and developers, and an enormous repository of plugins to extend its functionality. One of the presentations I attended, Mitch Canter&#8216;s [...]]]></description>
			<content:encoded><![CDATA[<p>I attended the <a href="http://wordcampbirmingham.org/">WordCamp Birmingham</a> conference this past weekend to find out more about all things <a href="http://wordpress.org/">WordPress</a>. WordPress is an open source blog engine/lightweight Content Management System (CMS) that has a huge community of users and developers, and an enormous repository of plugins to extend its functionality.</p>
<p>One of the presentations I attended, <a href="http://www.studionashvegas.com/">Mitch Canter</a>&#8216;s session on WordPress Security, had 6 good tips for making your WordPress-based site more secure:<br />
<span id="more-235"></span>
<ol>
<li><strong>Updgrade WordPress</strong><br />
WordPress recently released an important security update. Making sure that you are using the most current version will ensure that you have the latest security patches. (WordPress will complain if you aren&#8217;t running the latest, greatest version, so no need to fear: you&#8217;ll know.)</li>
<li><strong>Update your plugins</strong><br />
Plugins are 3rd-party code that can have their own security flaws [a good reason, in my opinion, to do a little research before you install any old WordPress plugin you find lying around the internet]. Find out if updates are available for yours.</li>
<li><strong>Set your file permissions</strong><br />
A lot of WordPress users may not be familiar with Unix/Linux file permissions, and once they find out, they may become even more confused, as files permissions use an octal-based numeric scheme to determine who (the owner, the group, or other users) can do what (read, write, execute) with a file.</p>
<p>Depending on which user your web server runs as, your files should be set to 0775, which means you (the owner of the files) and the associated group can read, write, and execute the files, but other users can only read and execute the files. With Apache 2, you can use <a href="http://httpd.apache.org/docs/2.0/mod/mod_suexec.html">mod_suexec</a> and a SuexecUserGroup command to make the webserver run commands as a specific user and group, which means you should <em>never</em> have to make any of your files or directories world-writable.</p>
<p>["World-writable" is a misnomer here--it really means "writable by anyone who has access to the server." That means other legitimate users who may have an account on the same machine, or malicious users who have compromised someone else's account on the system.]</li>
<li><strong>Make backups</strong><br />
I was really glad this came up, because security is about much more than preventing malicious attacks. It&#8217;s about maintaining your data over time. Mitch suggested the <a href="http://wordpress.org/extend/plugins/wp-db-backup/">wp-db backup</a><br />
WordPress plugin. [Although one of the options is to have WordPress send an e-mail with the compressed data, e-mail is not a secure way to transfer data, and I would recommend against it.]</li>
<li><strong>Delete the <em>admin</em> account</strong><br />
Every WordPress install comes with a privileged account, &#8216;admin&#8217;. Automated attacks can be launched against your system attempting to login as this user with a guessed password.</p>
<p>Anyone that really wants to hack into your system can do a bit of sleuthing and probably guess your actual login name&#8211;but creating a new account with administrative privileges and changing the admin account should at least provide some protection against the most automated attacks.</li>
<li><strong>Change your WordPress database table prefix.</strong><br />
This setting is contained within the wp-config.php file, and it&#8217;s easiest to change it when you are first setting up a new WordPress install. Otherwise, you will need to change not only the config setting, but additionally all the table names in your database. This change will help protect you from automated SQL injection attacks.</li>
</ol>
<p>Some additional ideas were floated during the questions and comments portion of the session, most of which included plugins, such as:</p>
<ul>
<li><a href="http://wordpress.org/extend/plugins/wp-security-scan/">WP Security Scan</a></li>
<li><a href="http://www.seoegghead.com/software/wordpress-firewall.seo">WP Firewall</a></li>
<li><a href="http://wordpress.org/extend/plugins/stealth-login/">Stealth Login</a></li>
</ul>
<p>Other ideas included:</p>
<ul>
<li>Restricting access to the files within wp-admin to specific IP addresses (this may not work for most people, who want to update their sites from wherever they happen to be)</li>
<li>Installing a <a href="http://www.tc.umn.edu/~brams006/selfsign.html">self-signed SSL certificate</a> and requiring SSL (https instead of http) to log in. This wouldn&#8217;t be good solution if you are setting up a site for someone else, as they would get browser warnings unless they permanently accept the self-signed certificate.</li>
</ul>
<p>I will probably be posting further updates this week with my notes from the WordCamp.</p>
]]></content:encoded>
			<wfw:commentRss>http://osric.com/chris/accidental-developer/2009/09/wordpress-security-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>University of Michigan jobs site has major browser compatibility issues</title>
		<link>http://osric.com/chris/accidental-developer/2009/07/university-of-michigan-jobs-site-has-major-browser-compatibility-issues/</link>
		<comments>http://osric.com/chris/accidental-developer/2009/07/university-of-michigan-jobs-site-has-major-browser-compatibility-issues/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 16:05:29 +0000</pubDate>
		<dc:creator>Chris Herdt</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[User Interface]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[cross-browser compatibilty]]></category>
		<category><![CDATA[opera]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[um]]></category>
		<category><![CDATA[university of michigan]]></category>

		<guid isPermaLink="false">http://osric.com/chris/accidental-developer/?p=197</guid>
		<description><![CDATA[The University of Michigan's job postings web site is not only unusable in modern browsers like Safari, Chrome, and Opera, but it also serves up an unfriendly error message that may dissuade users of those browsers from returning. The cost? Missing out on some of the most tech-savvy and qualified job candidates.]]></description>
			<content:encoded><![CDATA[<p>At the risk of sounding like a one-note, I would like to again talk about browser compatibility issues. These compatibility issues affect an organization&#8217;s bottom line, and should not be ignored. In this particular case, <a href="http://www.umich.edu/~jobs">The University of Michigan&#8217;s (U-M) job web site</a> is unusable to about 10-15% of visitors, by my estimates (they are using <a href="http://www.google.com/analytics/">Google Analytics</a> on the page, so they should have that data). To me, this says that U-M may be missing out on some of the most qualified candidates for their position openings, undeniably at great cost to the organization. [I am particularly concerned in this case because U-M is my alma mater.]</p>
<p>In particular, the browsers that are not compatible with the U-M jobs site are Safari, Chrome, and Opera &#8212; browsers typically used by more tech-savvy users &#8212; so U-M may be missing out on the very candidates best-suited for work in today&#8217;s web-based world.<br />
<span id="more-197"></span><br />
The first thing to note is the warning on the interstitial page, the page between the user and the content:<br />
&#8220;Supported browsers are: Windows 2000 and XP &#8211; Internet Explorer version 7.0. MAC OSX &#8211; Safari versions 1 and 2. (Safari 3.0 for Mac is not supported).&#8221;</p>
<p>It&#8217;s in small type and can easily be overlooked by a focus-driven person who is here to look for jobs postings, not browser recommendations. Not that I think there is any excuse for not supporting all major, modern browsers, but this page could at least include a browser-detection script that would alert users of unsupported browsers in a prominent manner. It might as well also mention that Javascript needs to be enabled. No matter, though, because the next click will let Safari, Chrome, and Opera users know in bold black text on a plain white background:</p>
<blockquote><p><strong>// Start Req. No 3294 Bug No 21869,21870 This site is designed to work with Microsoft Internet Explorer (versions 5.5, 6.0, 7.0), Netscape (versions 7.0, 7.1) and Mozilla (version 1.7) Web browsers installed with the Microsoft Windows operating system, and Safari (version 1.2) Web browser installed with the Mac operating system. The browser and/or operating system that you are using to access this site is not currently supported. Please access this site from a device with a supported browser and operating system combination. // End Req. No 3294 Bug No 21869,21870</strong></p></blockquote>
<p>Friendly, isn&#8217;t it? It looks more like a browser error than a message from the U-M jobs site. A lot of people might see &#8220;Bug No 21869,21870&#8243; and assume the site is temporarily down.</p>
<p>Job searchers are a persistent bunch, though, and presumably many of them will read through the error message and decide to revisit the site in Internet Explorer. Mac users may have a harder time following the recommendation, as Apple likes to push out Safari updates. You can download <a href="http://mac.oldapps.com/safari.php">old versions of Safari</a>, but that&#8217;s not something we can expect every job searcher to do, much less be aware of.</p>
<p>Once you do get to the jobs search page in (in Internet Explorer or Firefox), you get a frameset consisting of 5 frames, none of which have titles (from <a href="http://www.webaim.org/techniques/frames/">Creating Accessible Frames</a>: &#8220;One of the most important things you can do to increase the accessibility of frames is to give each frame a title.&#8221;). The links on the footer frame, such as the link to the <a href="http://www.umich.edu/~jobs/nondisc.html">non-descrimination statement</a>, do not have a target attribute set to &#8220;_top&#8221; and therefore open in the same frame, one line of text high.</p>
<p>There is a logo on the page: &#8220;Powered by Deploy Solutions TM, Copyright 2004 Deploy Solutions, Inc. All rights reserved.&#8221; <strong>2004?</strong> Maybe it&#8217;s time to upgrade.</p>
<p>In my recent post about T-Mobile, the cost of browser incompatibility was expensive and avoidable phone calls to customer services. Here, the cost is arguably even higher: missing out on the best job candidates. That might be more difficult to pin a dollar amount to, but if I were U-M I would be worried&#8211;and I would fix it.</p>
<p><strong>Edit:</strong><br />
I e-mailed U-M about these issues and received the following in their response: &#8220;There are no plans to upgrade this until the system is replaced in June of 2010.&#8221; Although that&#8217;s nearly a year away, I&#8217;m glad to know that they are planning to replace it.</p>
]]></content:encoded>
			<wfw:commentRss>http://osric.com/chris/accidental-developer/2009/07/university-of-michigan-jobs-site-has-major-browser-compatibility-issues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>T-Mobile Website Unfriendly to Chrome, Safari</title>
		<link>http://osric.com/chris/accidental-developer/2009/07/t-mobile-website-unfriendly-to-chrome-safari/</link>
		<comments>http://osric.com/chris/accidental-developer/2009/07/t-mobile-website-unfriendly-to-chrome-safari/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 15:24:40 +0000</pubDate>
		<dc:creator>Chris Herdt</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[accessibilty]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[cross-browser compatibilty]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[tmobile]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://osric.com/chris/accidental-developer/?p=186</guid>
		<description><![CDATA[Visitors to T-Mobile's site using Safari or Chrome lose dramatic amounts of functionality, leading to customer frustration and unnecessary calls to customer support. Verdict? Cross-browser compatibility saves money and improves customer satisfaction.]]></description>
			<content:encoded><![CDATA[<p>Early this morning, Nicola was bugging me to add a data plan to her phone account in anticipation of receiving her shiny new <a href="http://www.t-mobilemytouch.com/">MyTouch</a>. We logged on to the site using our favored browser, Google&#8217;s <a href="http://www.google.com/chrome">Chrome</a>. Here&#8217;s what we found:</p>
<div id="attachment_191" class="wp-caption alignnone" style="width: 510px"><img src="http://osric.com/chris/accidental-developer/wp-content/uploads/2009/07/tmobile-chrome1.png" alt="T-Mobile\&#039;s default page in Chrome, post login" title="T-Mobile&#039;s page in Chrome" width="500" height="190" class="size-full wp-image-191" /><p class="wp-caption-text">T-Mobile's default page in Chrome, post login</p></div>
<p>After several unsuccessful attempts to view info for her line from several different screens, we called T-Mobile&#8217;s customer support. The service rep walked through the same steps and said, &#8220;OK, now you should see tabs on the left with your names, phone numbers, and &#8216;Add A Line&#8217;.&#8221;</p>
<p>That&#8217;s when it hit me. I should try a different browser.<br />
<span id="more-186"></span><br />
The same page in Firefox:</p>
<div id="attachment_192" class="wp-caption alignnone" style="width: 510px"><img src="http://osric.com/chris/accidental-developer/wp-content/uploads/2009/07/tmobile-ff1.png" alt="T-Mobile&#039;s default page in Firefox, post login" title="T-Mobile&#039;s page in Firefox" width="500" height="190" class="size-full wp-image-192" /><p class="wp-caption-text">T-Mobile's default page in Firefox, post login</p></div>
<p>(The big &#8216;Image Not Available&#8217; is a different matter&#8211;that&#8217;s because my phone, in spite of the fact that I bought it from T-Mobile, is almost 4 years old, and therefore no longer exists from the perspective of their web site. Planned obsolescence at its finest.)</p>
<p>The same issue affects Safari, the default browser on the Mac. According to one <a href="http://www.w3schools.com/browsers/browsers_stats.asp">browser statistics report</a>, Chrome and Safari accounted for 9.1% of traffic in June 2009. Stats for a site I work with show 13.6% of visitors use Chrome or Safari (presumably due to a higher Mac userbase).</p>
<p>If we the relevant sections of the web site had been <em>accessible</em> to us, T-Mobile could possibly have avoided an expensive customer service call. Making your web site cross-browser compatible is worth money.</p>
<p>One last comment: what if Javascript is turned off? Does the T-Mobile site degrade gracefully?<br />
<div id="attachment_193" class="wp-caption alignnone" style="width: 510px"><img src="http://osric.com/chris/accidental-developer/wp-content/uploads/2009/07/tmobile-noscript1.png" alt="T-Mobile&#039;s site with Javascript disabled" title="T-Mobile&#039;s site with Javascript disabled" width="500" height="375" class="size-full wp-image-193" /><p class="wp-caption-text">T-Mobile's site with Javascript disabled</p></div></p>
<p>The site, which relies heavily on Javascript and AJAX, becomes completely unusable.</p>
]]></content:encoded>
			<wfw:commentRss>http://osric.com/chris/accidental-developer/2009/07/t-mobile-website-unfriendly-to-chrome-safari/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

