<?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>Chris Morrell &#187; Web Development</title>
	<atom:link href="http://cmorrell.com/tag/web-development/feed" rel="self" type="application/rss+xml" />
	<link>http://cmorrell.com</link>
	<description>The personal home page of Chris Morrell</description>
	<lastBuildDate>Thu, 02 Feb 2012 16:34:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>&quot;Learning&quot; to Design</title>
		<link>http://cmorrell.com/graphic-design/learning-to-design-194</link>
		<comments>http://cmorrell.com/graphic-design/learning-to-design-194#comments</comments>
		<pubDate>Wed, 28 Jan 2009 22:18:41 +0000</pubDate>
		<dc:creator>Chris M.</dc:creator>
				<category><![CDATA[Graphic Design]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[design]]></category>

		<guid isPermaLink="false">http://cmorrell.com/?p=194</guid>
		<description><![CDATA[A while back, Randy, of ümlatte, posted some thoughts on becoming a full-stack developer, something that I take pride in being.  Though I think it may be impractical in many (mostly larger) situations, developing a Web application (or anything) from &#8230; <a href="http://cmorrell.com/graphic-design/learning-to-design-194">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A while back, Randy, of ümlatte, posted some thoughts on <a href="http://blog.umlatte.com/2008/06/03/full-stack-web-developers/" target="_blank">becoming a full-stack developer</a>, something that I take pride in being.  Though I think it may be impractical in many (mostly larger) situations, developing a Web application (or anything) from end-to-end can be remarkably fulfilling, not to mention extremely efficient (assuming you&#8217;re good at each part of the stack).  I think that as Web development has become more of a &#8220;real&#8221; profession, we see less and less people doing it all.</p>
<p>Anyway, that&#8217;s another post.  Randy&#8217;s a <a href="http://www.umlatte.com/">fantastic developer</a>, and he&#8217;s hoping to become a fantastic designer as well.  In his blog entry, he says:</p>
<blockquote><p>If anybody has any suggestions about how I can go about achieving my new goal, please feel free to speak up! I have a feeling this is going to be quite a bit more difficult than web development since design is so subjective.</p></blockquote>
<p>That got me thinking—can you <strong>learn</strong> design?  I&#8217;m not sure.  In fact, I have two completely conflicting views: one practical (a) and one philosophical (b):</p>
<h3>A) COPY, COPY, COPY</h3>
<p>I&#8217;d guess that my first HTML project was maybe 95% other people&#8217;s code, 5% mine.  Similarly, my next project was probably 90%, the third 80%, the fourth 70% and so on.  Now it&#8217;s rare that I copy other people&#8217;s code, but that pattern holds true for every new language I learn, and I&#8217;m guessing that&#8217;s true for most Web developers.  So why not for design?  In design we call it <em>inspiration</em>, but is it really that different?  The first two pages of my delicious bookmarks include an <a href="http://www.webdesignerdepot.com/" target="_blank">overwhelming</a> <a href="http://www.mostinspired.com/blog/2008/03/16/niche-galleries/" target="_blank">number</a> of <a href="http://www.seoptimise.com/blog/2008/12/30-web-trends-for-2009.html" target="_blank">design</a> <a href="http://css-tricks.com/examples/WebsiteGalleryRoundup/" target="_blank">galleries</a>, <a href="http://www.smashingmagazine.com/2009/01/14/web-design-trends-for-2009/" target="_blank">trends</a> and <a href="http://abduzeedo.com/" target="_blank">tutorials</a>.  Often when I start a design project, I&#8217;ll find myself browsing through some of my favorite galleries and design magazines looking for inspiration.  When I was first learning <a href="http://cmorrell.com/tag/photoshop">Photoshop</a>, my designs were probably 95% tutorial, 5% my design.  Now it&#8217;s rare that I actually follow the tutorial instructions, but I still look at them for inspiration.</p>
<p>So, my practical advise would be: do the same thing you did learning HTML, learning CSS, learning Javascript, learning Ruby, learning PHP, etc, etc.  Copy.  Over time you may find that you need to copy less and less.</p>
<h3>B) You Gotta Have <em>It</em></h3>
<p>But there&#8217;s <em>more to it</em> than that.  I don&#8217;t know what <em>it</em> is, but I know <em>it</em> exists.  There&#8217;s something that makes <a href="http://www.jonathanive.com/" target="_blank">Jonathan Ive </a>special; something a Web designer like <a href="http://www.joshuadavis.com/" target="_blank">Joshua Davis</a> or a graphic designer like <a href="http://fabiosasso.com/" target="_blank">Fabio Sasso</a> has that not everyone has.  We&#8217;ve all got a little bit of <em>it</em>, but while some folks have a tablespoon or maybe even a cup, others have a bucket.</p>
<p>That&#8217;s not to say that you shouldn&#8217;t try.  It doesn&#8217;t necessarily just bubble out of you like you might imagine it did for DaVinci.  Sometimes you don&#8217;t have the technical knowledge.  Sometimes you just haven&#8217;t given it a chance.  But I don&#8217;t think anyone can just pick up a Wacom tablet and design a site like <a href="http://mezzoblue.com/" target="_blank">Dave Shea</a> or <a href="http://simplebits.com/" target="_blank">Dan Cederholm</a> any more than they can pick up a paint brush and paint like <a href="http://en.wikipedia.org/wiki/Thomas_Eakins" target="_blank">Thomas Eakins</a>.</p>
<p><strong>So what do I actually think?</strong> I don&#8217;t know.  I think there are a lot of things you can learn, from color theory, to proper use of white space, to typography, to concepts like the <a href="http://en.wikipedia.org/wiki/Golden_ratio" target="_blank">Golden Ratio</a>.  And I certainly know that I was a better graphic designer after taking some design classes in college than I was before.  But I think a lot of that comes from doing it, and either getting it or not.  Randy&#8217;s a pretty talented guy, so I wouldn&#8217;t be surprised if he gets it, but I&#8217;m not sure if he&#8217;ll <em>learn it</em> or just finally discover <em>it</em> was already there to begin with.</p>
<div class="su-linkbox" id="post-194-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://cmorrell.com/graphic-design/learning-to-design-194&quot;&gt;&quot;Learning&quot; to Design&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://cmorrell.com/graphic-design/learning-to-design-194/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Auto-Focus Input</title>
		<link>http://cmorrell.com/misc/auto-focus-input-45</link>
		<comments>http://cmorrell.com/misc/auto-focus-input-45#comments</comments>
		<pubDate>Thu, 21 Aug 2008 21:20:13 +0000</pubDate>
		<dc:creator>Chris M.</dc:creator>
				<category><![CDATA[frustrations]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://cmorrell.com/?p=45</guid>
		<description><![CDATA[OK, this has bugged me for a long time.  Many times I&#8217;ll come to a site which helpfully auto-focuses on the input element I&#8217;m most likely to use (either the username field of a login form, or the query field &#8230; <a href="http://cmorrell.com/misc/auto-focus-input-45">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>OK, this has bugged me for a long time.  Many times I&#8217;ll come to a site which helpfully auto-focuses on the input element I&#8217;m most likely to use (either the <em>username</em> field of a login form, or the <em>query</em> field of a search form).  But if the script to make this happen is slow, I&#8217;ll often find myself typing over my already half-written search query, or even worse, typing my password (in plain text) into the user name field.</p>
<p>I&#8217;ve come up with a few possible solutions.  To start, you could just skip the auto-focus code all together and let your users manually select the input they want to type in.  This can be fine, but in my opinion, what separates good UI from great UI is when the system seems to know what you want and is one step ahead of you. So how can we avoid the problem while still providing the functionality?</p>
<h3>Update: Latest Technique</h3>
<p>Commenter Joe points out that all three of these techniques fail if you use your browser&#8217;s autocomplete to pre-populate the field, but want the web page to focus on the field so you can either hit return or enter a custom username.  To handle this scenario I&#8217;ve come up with a new recommendation based on focus rather than content:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function() {
	var el = $('#query')[0];
	if (true !== el.hadFocus) {
		el.focus();
	}
});
&lt;/script&gt;
&lt;input type=&quot;text&quot; onfocus=&quot;this.hadFocus = true;&quot; id=&quot;query&quot; /&gt;
</pre>
<p>So now, instead of checking to see if there&#8217;s any content in the &#8220;query&#8221; field, we&#8217;re checking to see if the user has focused on it.  If they haven&#8217;t, it&#8217;s safe to change the focus there.  If they have, you know they&#8217;re ahead of your code, and you can just get out of the way.</p>
<p>You might want to expand this to check if <strong>any</strong> field has been focused on.  That way if someone starts typing in your search box, you don&#8217;t accidentally send them to the username field.  But in general, something like the code above should be good in most situations.</p>
<p>Let me know if you see any potential problems.<br />
<span id="more-45"></span></p>
<p>Here are the approaches I&#8217;ve toyed with.</p>
<h3>Option 1: Inline JavaScript</h3>
<pre class="brush: xml; title: ; notranslate">
&lt;input id=&quot;username&quot; name=&quot;username&quot; type=&quot;text&quot; /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;![CDATA[
if (document.getElementById)
     document.getElementById('username').focus();
]]&gt;
&lt;/script&gt;
</pre>
<p>In simple situations (where the web app uses little to no other javascript), this is the option I go with. But it assumes a modern browser is available.  And while you could use a Javascript framework to support more browsers, then you&#8217;d have the associated lag from loading the framework, which could reintroduce the original problem.  That leads me to option 2&#8230;</p>
<h3>Option 2: Check Before Focus</h3>
<pre class="brush: jscript; title: ; notranslate">
window.addEvent('domready', function() {
	var field = $('username');
	if (field.value.length == 0) field.focus();
});
</pre>
<p>In this scenario, you run your auto-focus code once your framework (in this case <a href="http://www.mootools.net/" target="_blank">mootools</a>) and the DOM have loaded, but you check to see if the field has been typed in first.  That way, if I type faster than your <a href="http://developer.yahoo.com/performance/rules.html#cdn" target="_blank">CDN</a> loads, the code just doesn&#8217;t run.  If you&#8217;re using a javascript framework, this is probably the best option.</p>
<p>There&#8217;s one other approach that I&#8217;ve always thought was interesting, but really doesn&#8217;t work in the end.  I&#8217;m just putting it here for the fun of it&#8230;</p>
<h3>Option 3: Make Them Wait</h3>
<p>First, output a <strong>disabled</strong> form element via javascript:</p>
<pre class="brush: jscript; title: ; notranslate">
document.write('&lt;input id=&quot;username&quot; disabled=&quot;disabled&quot; name=&quot;username&quot; type=&quot;text&quot; /&gt;');
</pre>
<p>Then, output an enabled element in noscript tags (just in case):</p>
<pre class="brush: xml; title: ; notranslate">
&lt;noscript&gt;
&lt;input type=&quot;text&quot; name=&quot;username&quot; id=&quot;username&quot; /&gt;
&lt;/noscript&gt;
</pre>
<p>And finally, run your code on DOM Ready:</p>
<pre class="brush: jscript; title: ; notranslate">
window.addEvent('domready', function() {
	var field = $('username');
	field.disabled = false;
	field.focus();
});
</pre>
<p>This way the input is disabled until your code loads.  Though technically that method would work, it&#8217;s more likely to frustrate your power-users than enhance their user experience.</p>
<p><strong>Have other people experienced this frustration? If you&#8217;re a web developer, are there other ways you have dealt with it?</strong> Leave a reply, or reply to <a href="http://www.twitter.com/inxilpro">@inxilpro</a> on twitter.</p>
<div class="su-linkbox" id="post-45-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://cmorrell.com/misc/auto-focus-input-45&quot;&gt;Auto-Focus Input&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div>]]></content:encoded>
			<wfw:commentRss>http://cmorrell.com/misc/auto-focus-input-45/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 18/28 queries in 0.134 seconds using disk: basic
Object Caching 493/548 objects using disk: basic
Content Delivery Network via cdn1.cmorrell.com

Served from: cmorrell.com @ 2012-02-09 16:36:45 -->
