<?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>Justin Carmony &#187; Best Practices</title>
	<atom:link href="http://www.justincarmony.com/blog/tag/best-practices/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.justincarmony.com/blog</link>
	<description>Web Designer &#38; Software Engineer</description>
	<lastBuildDate>Wed, 01 Feb 2012 04:30:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Characteristics of Good PHP Code</title>
		<link>http://www.justincarmony.com/blog/2009/01/11/characteristics-of-good-php-code/</link>
		<comments>http://www.justincarmony.com/blog/2009/01/11/characteristics-of-good-php-code/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 01:20:02 +0000</pubDate>
		<dc:creator>Justin Carmony</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.justincarmony.com/blog/2009/01/11/characteristics-of-good-php-code/</guid>
		<description><![CDATA[At the time I am sitting in the Las Vegas airport waiting for a very delayed layover flight to San Diego. Wonderful weather causing all sorts of headaches. So I&#8217;ve decided to make the best of my time by writing the introductory article to a series of PHP articles. I&#8217;ve had this idea for a ...


Related posts:<ol><li><a href='http://www.justincarmony.com/blog/2008/01/22/asp-net-gridview-access-to-data-in-code/' rel='bookmark' title='ASP .NET GridView Access to Data In Code'>ASP .NET GridView Access to Data In Code</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/09/24/zend-studio-vs-php-development-tools/' rel='bookmark' title='Zend Studio vs PHP Development Tools'>Zend Studio vs PHP Development Tools</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/07/15/web-development-10-years-ago-now/' rel='bookmark' title='Web Development 10-Years Ago &amp; Now'>Web Development 10-Years Ago &#038; Now</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>At the time I am sitting in the Las Vegas airport waiting for a very delayed layover flight to San Diego. Wonderful weather causing all sorts of headaches. So I&#8217;ve decided to make the best of my time by writing the introductory article to a series of PHP articles. I&#8217;ve had this idea for a while, and now I&#8217;m going to finally sit down and write it.</p>
<p><strong>A Different Type of Article</strong></p>
<p>Over the years I&#8217;ve seen many great tutorials on programming better in PHP. Many start with a number, then with a word like &#8220;techniques, practices, patterns, etc,&#8221; and end with a phrase like &#8220;for better PHP.&#8221; Examples like &#8220;8 Tips for Cleaner Code,&#8221; &#8220;5 Practices that make you&#8217;re life easier,&#8221; and the list goes on. I&#8217;ve enjoyed and learned a lot about making my PHP code better. However, there is a subject I&#8217;ve never really read or heard about before: characteristics of good PHP code.</p>
<p>What is the difference between characteristic and the other subjects above? To me tips, techniques, and practices are well-defined instructions that are straight forward. They may be advanced topics, but they are well-defined. In lots of ways I think of them as rules to follow.</p>
<p>A characteristic, for me at least, is a more abstract concept. Let me give you an example: readable. Several techniques and practices help towards having more readable. However, if a developers follows a few rules, it doesn&#8217;t necessary mean his code will be readable. Characteristics are traits that code have that exists, but aren&#8217;t easily defined into a set of rules.</p>
<p><strong>Real Life Example</strong></p>
<p>Lets look at a non-programming example. A person can have the characteristic of being &#8220;nice.&#8221; We all know nice people, and people who are not nice. A nice person might have a habit of saying hi to their co-workers in the morning. However, just because a person says hi to a co-worker in the morning doesn&#8217;t mean they are nice. It is impossible to quantify being &#8220;nice&#8221; into a set of rules and regulations. Being nice is a so much more than just following a few guidelines, hence it is a characteristic. Its the way a person acts in a large variety of situations.</p>
<p>If I am a person who isn&#8217;t nice, but I want to become nice, I can&#8217;t just google &#8220;10 tips on being nice,&#8221; follow them, and declare myself a &#8220;nice person.&#8221; I can&#8217;t just emulate things nice people do and expect the same results. Becoming a nice person requires hard work and serious reflection. I would need to take a step back and continuously analyze my actions over time.</p>
<p><strong>Why Characteristics?</strong></p>
<p>So why list characteristics? Writing great code is so much more than following guidelines. It is impossible to write a book of rules that will guarantee great work, yet so many people take this approach when programming. I&#8217;ve met several developers, that while reviewing their code, list rules and guidelines as to why they did everything they did. &#8220;I&#8217;ve commented every section of code.&#8221; &#8220;I&#8217;ve used the DAL for all the queries.&#8221; &#8220;I used X pattern for Y situation.&#8221; The list goes on, but the code they&#8217;ve produced looks, feels, and runs sub-par. The reason I like to focus on characteristics is that is helps me recognize there is more to programming than rules and guidelines. Best practices will only help you out so far. The ultimate test is after everything is said and done, and I review my work, is going through my list of characteristics and seeing if my code follows the list.</p>
<p>Like personal characteristics, programming code with great characteristics can take time and experience. Every year I learn more as I write more. I find weaknesses in my code. I make it a personal goal to improve the quality of my code, and I find it helpful to have a list of characteristics I strive for.</p>
<p><strong>What Characteristics?</strong></p>
<p>So what are desirable characteristics of good PHP code? Here is my own list, in no special order. This article is the first of a series which I will describe how to achieve these characteristics with the your code, and how to evaluate your code. So without further introduction, here is my personal list:</p>
<ul>
<li><strong>Readable</strong> &#8211; Being able to easily read code is vital. Don&#8217;t ever assume you will be the only developer to ever read and maintain your code. I can&#8217;t think of a single project for the exception of my blog that I have been the only one who worked on it. Readable code has meaningful variables, good comments that help describe what&#8217;s going on. However, good variables and comments doesn&#8217;t necessarily mean your code is readable.</li>
<li><strong>Organized</strong> &#8211; While some people think this is the same as readable, organization is different and crucial to me. Readability is the ability to read your code, however organized code helps you find what your looking for. There are many techniques to help keep your code well organized, but the most important thing is at the end of the day, can your fellow developers find what they are looking for?</li>
<li><strong>Modular</strong> &#8211; I hear this word tossed around a lot when talking about programming. However, what really is modular? I like to define it as being able to take a part of your code and use it elsewhere with the least amount of headache.</li>
<li><strong>Relevant</strong> &#8211; While I hear a lot about Modular code, I don&#8217;t hear a lot about relevant code. While people might consider relevant in the modular or organized characteristic, I find it helps me to separate this out. Relevant to me means that code is where it belongs. Its easy to have code blur together and have purposes mixed. Relevant code means the grouping of code belongs together.</li>
<li><strong>Efficient</strong> &#8211; What good is code if it is slow, doesn&#8217;t scale, and will have to be re-written? Is being efficient is just following a handful of rules and guidelines?</li>
<li><strong>Practical</strong> &#8211; It may be efficient, it be organized, but is it practical? In the past I&#8217;ve written the &#8220;coolest&#8221; class, or so I thought, only to have a fellow developer tell him that my implementation is confusing, and overly complex. While many times we create code that isn&#8217;t robust enough, but it is possible to make stuff just complicated, over-designed, or just impractical. Keeping your code practical helps you and your team to make a good solution that is easy to maintain.</li>
<li><strong>Documented</strong> &#8211; Code that isn&#8217;t well documented will be a time drain. I know many developers who think keeping up documentation slows the development process down. However, without that documentation, the overall development process will suffer. Bringing new developers up to speed, maintenance, even just general development will be slowed down by &#8220;figuring stuff out.&#8221; Documentation is also more than just having a &#8220;wiki&#8221; or using comments.</li>
<li><strong>Longevous</strong> &#8211; The definition is to live a long life. There are two parts to having longevous code. First of all, when you&#8217;ve programmed or maintained some code, ask yourself. &#8220;How long will this last? Will this solution work well over time?&#8221; Then, the second part which I think is almost never asked: &#8220;when the time comes, how easily can I extend, or replace this code?&#8221; To often programmers &#8220;dig ruts&#8221; so-to-speak in projects. They code an aspect of a project that locks them into a situation that is extremely difficult to code out of.</li>
<li><strong>Secure</strong> &#8211; All of the time spent on development can be for nothing if it isn&#8217;t secure. Security in web development is a must. It doesn&#8217;t matter the size of the website, large or small, eventually someone will try to break it. Someone will try to compromise it. The consequences vary, from an annoyance, to destroying the entire business. Making your application secure is a skill all developers need.</li>
<li><strong>Safe</strong> &#8211; While some people think of this as the same as secure, for me safe PHP code means it handles errors correctly. Great PHP code handles errors correctly. If a PHP class fails, it should handle the error properly. It should also throw errors correctly when needed. If code is safe, I know that it will behave as it should, and properly let me know when it is not.</li>
</ul>
<p>This article is the first of this series for me, and I&#8217;ll try to write an article for each characteristic. I will start on the top of the list and work my way down. Hopefully I can write one every week, and this can help PHP developers take a broader, overall look at their work. Principles, tips, and techniques are great, the are helpful, but without a broader view of things, developers can still develop sup-par code. Knowing the characteristics of good PHP code can help us strive to ensure we make great solutions. It allows us to sit back and really ask ourselves &#8220;does this code really have these characteristics?&#8221;</p>


<p>Related posts:<ol><li><a href='http://www.justincarmony.com/blog/2008/01/22/asp-net-gridview-access-to-data-in-code/' rel='bookmark' title='ASP .NET GridView Access to Data In Code'>ASP .NET GridView Access to Data In Code</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/09/24/zend-studio-vs-php-development-tools/' rel='bookmark' title='Zend Studio vs PHP Development Tools'>Zend Studio vs PHP Development Tools</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/07/15/web-development-10-years-ago-now/' rel='bookmark' title='Web Development 10-Years Ago &amp; Now'>Web Development 10-Years Ago &#038; Now</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.justincarmony.com/blog/2009/01/11/characteristics-of-good-php-code/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>HTML Education in Universities</title>
		<link>http://www.justincarmony.com/blog/2008/12/10/html-education-in-universities/</link>
		<comments>http://www.justincarmony.com/blog/2008/12/10/html-education-in-universities/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 19:24:46 +0000</pubDate>
		<dc:creator>Justin Carmony</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[College]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Education]]></category>
		<category><![CDATA[Frustration]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.justincarmony.com/blog/2008/12/10/html-education-in-universities/</guid>
		<description><![CDATA[Why, oh why, are website classes so extremely out of date in universities, colleges, and schools? I just spent the last few hours helping my wife with her Information Systems class. I&#8217;ve had to do similar assignments for technology classes, yet the things they are teaching are extremely out of date and a waste of ...


Related posts:<ol><li><a href='http://www.justincarmony.com/blog/2008/10/03/css-id-vs-class/' rel='bookmark' title='CSS – ID vs Class'>CSS – ID vs Class</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/09/22/php-6-books-did-i-miss-something/' rel='bookmark' title='PHP 6 Books &#8211; Did I Miss Something?'>PHP 6 Books &#8211; Did I Miss Something?</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/05/20/iphone-sdk-learning-the-basics-by-removing-the-touch/' rel='bookmark' title='iPhone SDK &#8211; Learning the Basics by Removing the Touch'>iPhone SDK &#8211; Learning the Basics by Removing the Touch</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://c747925.r25.cf2.rackcdn.com/blog/wp-content/uploads/2008/12/graduation-cap.jpg"><img src="http://c747925.r25.cf2.rackcdn.com/blog/wp-content/uploads/2008/12/graduation-cap.jpg" alt="" title="graduation-cap" width="200" height="162" class="alignright size-medium wp-image-313" /></a>
<p>Why, oh why, are website classes so extremely out of date in universities, colleges, and schools? I just spent the last few hours helping my wife with her Information Systems class. I&#8217;ve had to do similar assignments for technology classes, yet the things they are teaching are extremely out of date <span style="font-weight: bold; font-style: italic;">and</span> a waste of time. Why? After taking these classes, to actually use HTML, I would have to unlearn 80% of what they taught, and re-learn from scratch.</p>
<p>It is one thing to keep things very simple. However, if I have a basic Account class, and I would expect to learn about Credits, Debits, and keeping a ledger. There isn&#8217;t a need to get into complex concepts or advanced journal entries. However, if I take an Accounting class, and they teach me incorrect concepts, that class would be 100% worthless. I&#8217;ve uploaded the project my wife had done for her class, after following their textbook and professors instructions. This is also after helping her remove as much &#8220;junk&#8221; HTML.</p>
<p><a href="http://www.justincarmony.com/blog/files/website/">Her Website Assignment</a></p>
<p>For those HTML Gurus out there, if they look at the source, they&#8217;ll cringe. I haven&#8217;t seen this poor of HTML since the 90s. Also, guess what? The book they were following was published in 2008. How well does this example validate? <a href="http://validator.w3.org/check?uri=http%3A%2F%2Fwww.justincarmony.com%2Fblog%2Ffiles%2Fwebsite%2Findex.html&amp;charset=(detect+automatically)&amp;doctype=XHTML+1.0+Strict&amp;group=0&amp;user-agent=W3C_Validator%2F1.606">Terrible</a>. This was after I helped her strip every bad piece of HTML I could without &#8220;breaking&#8221; the instructions.</p>
<p>Why teach your students to use very, very old markup? I guess is the authors don&#8217;t have a clue. However, if I hired a person who says they know HTML, and the produced the stuff books teaches, I would very upset. I mean, who teaches their students to use background images like that? Here is what HTML classes need to teach:</p>
<h2>HTML Structure</h2>
<p>Don&#8217;t worry about styling at first. Just worry about the structure. That is why they invented CSS (Cascade Styles Sheets). Teach your students how to use your correct markup. Use strong, emphasis, and span tags. Here are some examples:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!-- Bad --&gt;
&lt;img src=&quot;image.jpg&quot;&gt;

&lt;!-- Good --&gt;
&lt;img src=&quot;image.jpg&quot; alt=&quot;My Dog&quot; /&gt;

&lt;-- Bad --&gt;
&lt;b&gt;Bold&lt;/b&gt;, &lt;i&gt;Italics&lt;/i&gt;

&lt;!-- Good --&gt;
&lt;strong&gt;Bold&lt;/strong&gt;, &lt;em&gt;Italics&lt;/em&gt;
</pre>
<p>Once they have a good base for HTML structure, then you can move on to Styling. There is no need to use Font, B, or I tags. </p>
<h2>Cascade Styling</h2>
<p>I can see why a professor would be leery to teach about Cascade Style-sheets. They can be confusing, and a new concept for their students. Also, Information System classes usually only have 2-3 weeks before moving onto another subject. So keep is very, very basic. Don&#8217;t even touch on ID and CLASS attributes if you don&#8217;t have time. Just show changing the colors of links, and maybe making strong and emphasis tags different colors. Keep it simple. However, do NOT resort to deprecated methods that may seem easier to use at first, but hurt the student&#8217;s full education on the subject.</p>
<h2>Teach Principles, Not Motions</h2>
<p>My wife&#8217;s professor held an optional saturday class to help with the assignment. If a student went, the teacher would walk through, step-by-step, what to put into notepad to make their websites. However, there wasn&#8217;t any discuss as to why they were typing what they we&#8217;re. Unfortunately, I feel like they were probably just going through the motions. The goal of teaching students is that they walk away with something. If you&#8217;re just spoon feeding the students what to type, what good is it doing? Isn&#8217;t it just a waste of time?</p>
<p>Don&#8217;t spend time getting a better &#8220;end result&#8221; by sacrificing the learning process. Teach students the &#8220;why&#8221; for what they are doing. If that means you only mention CSS, show how it works, but not require the students to write any, so be it. I know technology can be extremely difficult to teach. Many students have a hard time grasping concepts. Technology professions, such as website designers, usually rely heavily on self-taught technologies. Traditional classes usually aren&#8217;t well adapt to keeping up with the content.</p>
<h2>What Should Professors Do?</h2>
<p>Don&#8217;t worry about crazy backgrounds, changing colors, and different font sizes. Focus on good, validated content. If its super simple, thats fine. You can tell your students if they are interested in learning more, point them to websites like <a href="http://www.w3schools.com">W3Schools</a>.</p>
<p>Also, I would say a large portion of the blame lies on the Book Publishers. I would assume many of these teachers and professors are teaching general information systems classes. They aren&#8217;t experienced web designers and just teach what is in the books. The fact that students are buying brand new books with outdated content is rediculous. Maybe 2-3 years out of date, but not a decade.</p>
<p>I don&#8217;t know what else, other then there is nothing that drives me crazy more than sitting in a class learning something the wrong way.</p>


<p>Related posts:<ol><li><a href='http://www.justincarmony.com/blog/2008/10/03/css-id-vs-class/' rel='bookmark' title='CSS – ID vs Class'>CSS – ID vs Class</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/09/22/php-6-books-did-i-miss-something/' rel='bookmark' title='PHP 6 Books &#8211; Did I Miss Something?'>PHP 6 Books &#8211; Did I Miss Something?</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/05/20/iphone-sdk-learning-the-basics-by-removing-the-touch/' rel='bookmark' title='iPhone SDK &#8211; Learning the Basics by Removing the Touch'>iPhone SDK &#8211; Learning the Basics by Removing the Touch</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.justincarmony.com/blog/2008/12/10/html-education-in-universities/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS – ID vs Class</title>
		<link>http://www.justincarmony.com/blog/2008/10/03/css-id-vs-class/</link>
		<comments>http://www.justincarmony.com/blog/2008/10/03/css-id-vs-class/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 22:22:20 +0000</pubDate>
		<dc:creator>Justin Carmony</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.justincarmony.com/blog/?p=191</guid>
		<description><![CDATA[After hacking apart &#38; cleaning up code for the better part of the day, I&#8217;ve decided to set the record straight about CSS, IDs, and Classes. The question is &#8220;when should I use an ID, and when should I use a class?&#8221; Is it that big of a deal? The big issue is that people ...


Related posts:<ol><li><a href='http://www.justincarmony.com/blog/2008/01/17/asp-net-accessing-session-request-response-etc-from-within-a-class/' rel='bookmark' title='ASP .NET Accessing Session, Request, Response, etc from within a Class'>ASP .NET Accessing Session, Request, Response, etc from within a Class</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/01/07/asp-net-20-gridviews-hyperlinkfield-and-javascript/' rel='bookmark' title='ASP .NET 2.0, GridViews, HyperLinkField, and JavaScript'>ASP .NET 2.0, GridViews, HyperLinkField, and JavaScript</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/04/21/iphone-web-development-controlling-the-viewport-via-javascript/' rel='bookmark' title='iPhone Web Development: Controlling the viewport via Javascript'>iPhone Web Development: Controlling the viewport via Javascript</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://c747925.r25.cf2.rackcdn.com/blog/wp-content/uploads/2008/10/flow_kl_2.jpg"><img class="alignright size-medium wp-image-192" title="flow_kl_2" src="http://c747925.r25.cf2.rackcdn.com/blog/wp-content/uploads/2008/10/flow_kl_2-266x300.jpg" alt="" width="186" height="210" /></a>After hacking apart &amp; cleaning up code for the better part of the day, I&#8217;ve decided to set the record straight about CSS, IDs, and Classes. The question is &#8220;when should I use an ID, and when should I use a class?&#8221; Is it that big of a deal?</p>
<p>The big issue is that people who just write Cascading Style Sheets usually won&#8217;t run into problems if they are more lax with their use of IDs. Its the people after who coming in trying to add advanced JavaScript features that will end up becoming very, very frustrated.</p>
<p>Why does it matter? Because an ID and Class have one major difference:</p>
<p><em><strong>ID is supose to be 100% unique to a single HTML element through the entire HTML document. Class can be shared among many elements.</strong></em></p>
<p>Example:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!-- This HTML element is using an ID --&gt;
&lt;p id=&quot;text&quot;&gt;This is using an ID&lt;/p&gt;

&lt;!-- This HTML element is uing a class --&gt;
&lt;p class=&quot;text&quot;&gt;This is using a class&lt;/p&gt;
</pre>
<p>What is the big deal? For CSS designers, not a whole lot. In fact, IDs have a higher specificity, so some CSS designers default to using an ID just because it is more convenient. The problem is when your boss say &#8220;hey, we need two paragraphs.&#8221; The developer copies a new paragraph in and to keep the formatting, adds another ID tag. Now we&#8217;ve broke the rule about only having one ID in an HTML document. Sure, it renders fine, but if a JavaScript developer tries to add additional features, they will have to code around these problems.</p>
<p>So when should you use ID and when do you use a class? Here is my rule of thumb:</p>
<p><em><strong>Unless you are 100% sure that you will never, ever have a duplicate element name on the same page, use a class. When in doubt, use a class. Only use an ID when you&#8217;re positive it will always be unique.<br />
</strong></em></p>
<p>Examples of when I would use an ID are:</p>
<ul>
<li><strong>Unique parts of page layout:</strong> &lt;div id=&#8221;header&#8221;&gt;&lt;/div&gt;&lt;div id=&#8221;content&#8221;&gt;&lt;/div&gt;&lt;div id=&#8221;footer&#8221;&gt;&lt;/div&gt;</li>
<li><strong>Identifying specific items:</strong> &lt;div id=&#8221;post-32&#8243;&gt;&lt;/div&gt;&lt;div id=&#8221;item-123&#8243;&gt;&lt;/div&gt;</li>
</ul>
<p>If it doesn&#8217;t fall into those two categories, I usually won&#8217;t use an ID. Most of the time, I&#8217;ve never had moment where I wished a developer had used a ID instead of a class. But I&#8217;ve had many times where I wish an element used classes intead of ID.</p>


<p>Related posts:<ol><li><a href='http://www.justincarmony.com/blog/2008/01/17/asp-net-accessing-session-request-response-etc-from-within-a-class/' rel='bookmark' title='ASP .NET Accessing Session, Request, Response, etc from within a Class'>ASP .NET Accessing Session, Request, Response, etc from within a Class</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/01/07/asp-net-20-gridviews-hyperlinkfield-and-javascript/' rel='bookmark' title='ASP .NET 2.0, GridViews, HyperLinkField, and JavaScript'>ASP .NET 2.0, GridViews, HyperLinkField, and JavaScript</a></li>
<li><a href='http://www.justincarmony.com/blog/2008/04/21/iphone-web-development-controlling-the-viewport-via-javascript/' rel='bookmark' title='iPhone Web Development: Controlling the viewport via Javascript'>iPhone Web Development: Controlling the viewport via Javascript</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.justincarmony.com/blog/2008/10/03/css-id-vs-class/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 22/56 queries in 0.023 seconds using memcached
Content Delivery Network via Rackspace Cloud Files: c747925.r25.cf2.rackcdn.com

Served from: www.justincarmony.com @ 2012-02-07 23:40:56 -->
