<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Brack3t blog</title><link href="http://brack3t.com/blog/atom.xml" rel="self"/><link href="http://brack3t.com"/><updated>2011-10-07T17:18:32Z</updated><id>http://brack3t.com</id><entry><title>Semantic Snakeoil</title><author><name>Brack3t</name></author><link href="http://brack3t.com/blog/2011/semantic_snakeoil.html"/><updated>2011-10-03T21:31:43Z</updated><published>2011-10-03T21:31:43Z</published><id>http://brack3t.com/blog/2011/semantic_snakeoil.html</id><content type="html">
       

&lt;div class=&quot;span2 offset2 figure&quot;&gt;
&lt;img alt=&quot;Semantic All The Thing&quot; src=&quot;/media/img/semantic.png&quot; /&gt;
&lt;/div&gt;
&lt;p&gt;For years now, we&amp;#8217;ve been told that we should always use semantic class names and IDs in our &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt;. And, in general, this is a good practice, I don&amp;#8217;t want anyone to think it&amp;#8217;s not. You &lt;em&gt;should&lt;/em&gt; make your markup, all aspects of it, as accurate and related as possible. The problem, though, comes when people become fanatical about their classes and IDs to the point of swearing off grid systems and &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; frameworks in the name of &amp;#8220;proper&amp;#8221; web development&amp;nbsp;practices.&lt;/p&gt;
&lt;p&gt;So why isn&amp;#8217;t it a big deal? Both the &lt;a class=&quot;reference external&quot; href=&quot;http://www.w3.org/TR/html5-author/global-attributes.html#classes&quot;&gt;&lt;span class=&quot;caps&quot;&gt;W3C&lt;/span&gt;&lt;/a&gt; and the &lt;a class=&quot;reference external&quot; href=&quot;http://developers.whatwg.org/elements.html#classes&quot;&gt;&lt;span class=&quot;caps&quot;&gt;WHATWG&lt;/span&gt;&lt;/a&gt; emphasize that the class attribute, and its values, if specified, should describe the nature of the content and not the presentation of it. And for the most part, I agree. This ideal has limits, though, that need to be addressed and understood. &lt;strong&gt;It&amp;#8217;s currently impossible to be 100% semantic and still be&amp;nbsp;useful.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Let&amp;#8217;s start with the argument presented by the idealists: All class names and IDs should be semantic and address the nature of the element, not its display. This ends up with us needing to create new classes and &lt;span class=&quot;caps&quot;&gt;ID&lt;/span&gt; for every project we do, tied directly to the use case of each bit of markup. Yes, some things could be repeated and copied from project to project, but a decent majority of the &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; would be unique. This is great if you&amp;#8217;re the only person working on something, or working with a small group that works together on many projects. This is rarely the case with large or open-source projects,&amp;nbsp;though.&lt;/p&gt;
&lt;p&gt;Now, let&amp;#8217;s look at the argument from the utilitarians: All class names should be generically semantic to the structure of the document and relate to the use case and nature of the element; IDs should be semantic to the project or page. This opens up the project to third-party grid systems and the like. So long as the class names have meaning to the document, even if it&amp;#8217;s not semantic meaning to the content it&amp;#8217;s wrapped around, it&amp;#8217;s still valid and&amp;nbsp;logical.&lt;/p&gt;
&lt;p&gt;For a second argument against made-to-order frameworks for each project: using third-party libraries like the awesome &lt;a class=&quot;reference external&quot; href=&quot;https://twitter.github.com/bootstrap/&quot;&gt;Twitter Bootstrap&lt;/a&gt;, newcomers to the project will either have experience with the library, or can refer to its documentation to get up to speed; if you&amp;#8217;re using a custom library of &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt; for the project, a new developer needs to familiarize themselves with the whole thing with, lilkely, little to no&amp;nbsp;documentation.&lt;/p&gt;
&lt;p&gt;To my mind, and many other professionals, the point of the &lt;tt class=&quot;docutils literal&quot;&gt;class&lt;/tt&gt; attribute is to describe the element or its content. The element, though, is the more important bit to describe since using a semantic element already describes the content. If you put a list of links into a &lt;tt class=&quot;docutils literal&quot;&gt;&amp;lt;nav&amp;gt;&lt;/tt&gt; element, there&amp;#8217;s no reason to give it a class of &lt;tt class=&quot;docutils literal&quot;&gt;nav&lt;/tt&gt; or &lt;tt class=&quot;docutils literal&quot;&gt;menu&lt;/tt&gt; or the like. There is, however, plenty of reason to give it a class that describes how it relates to other elements, such as &lt;tt class=&quot;docutils literal&quot;&gt;span6&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;Using these systems, as well, gives us the ability to reflow content in a way that remains semantic. To set the stage, we have a &lt;tt class=&quot;docutils literal&quot;&gt;&amp;lt;section&amp;gt;&lt;/tt&gt; of content that is the main content of the site, and an &lt;tt class=&quot;docutils literal&quot;&gt;&amp;lt;aside&amp;gt;&lt;/tt&gt; that is our sidebar. We want the page to reflow based on media queries.  If we use an idealistic set of classes, such as &lt;tt class=&quot;docutils literal&quot;&gt;sidebar&lt;/tt&gt;, once the page reflows and the &lt;tt class=&quot;docutils literal&quot;&gt;&amp;lt;aside&amp;gt;&lt;/tt&gt; ends up below the main content, its class no longer has the same semantic meaning. Yes, we could have used a class like &lt;tt class=&quot;docutils literal&quot;&gt;&lt;span class=&quot;pre&quot;&gt;secondary-content&lt;/span&gt;&lt;/tt&gt; or the like, but few people seem to use class names like this. If, though, we use something like &lt;tt class=&quot;docutils literal&quot;&gt;span6&lt;/tt&gt;, it loses no semantic meaning after the reflow as it is still spanning 6 of our columns. Yes, that&amp;#8217;s describing the display but it&amp;#8217;s describing it on relation to all the other elements, so it is semantic in&amp;nbsp;context.&lt;/p&gt;
&lt;p&gt;The other point I keep seeing being made is, that, to change the width of an element, the designer has to go and edit the &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt;. If, though, you&amp;#8217;re using &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; correctly, to where classes describe more than one object, if I want only one instance of an object to be wider, I have to either add, remove, or edit a class in the &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt; anyway. If your knee-jerk reaction is that &amp;#8220;my classes aren&amp;#8217;t set up that way&amp;#8221; and you&amp;#8217;re using classes like they&amp;#8217;re IDs, to where they&amp;#8217;re unique, you aren&amp;#8217;t using them correctly and should be using IDs on your elements. This also ties into more serious programming; if your model changes, you have to (usually) update your views/controllers and templates/views. This isn&amp;#8217;t a unique concept and shouldn&amp;#8217;t trip up any serious developer or&amp;nbsp;designer.&lt;/p&gt;
&lt;p&gt;Search engines don&amp;#8217;t seem to care about class values, either, so using more of them won&amp;#8217;t hurt your site&amp;#8217;s &lt;span class=&quot;caps&quot;&gt;SEO&lt;/span&gt; (if you care about that). Also, as far as content being available, if people are scraping your &lt;span class=&quot;caps&quot;&gt;HTML&lt;/span&gt;, it would be better to offer it in a more consumable format like an &lt;span class=&quot;caps&quot;&gt;JSON&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; or an &lt;span class=&quot;caps&quot;&gt;RSS&lt;/span&gt; feed (aka &lt;span class=&quot;caps&quot;&gt;XML&lt;/span&gt;). This way the content is separated from your presentation of it and can be used however the consumer needs&amp;nbsp;it.&lt;/p&gt;
&lt;p&gt;So, I put forth a new definition for&amp;nbsp;classes:&lt;/p&gt;
&lt;blockquote&gt;
There are no additional restrictions on the tokens authors can use in the class attribute, but authors are encouraged to use values that describe the nature of the content, rather than values that describe the desired presentation of the content. &lt;strong&gt;It is also valid to use values that describe the element.&lt;/strong&gt;&lt;/blockquote&gt;
&lt;p&gt;Have comments? Continue the discussion on &lt;a class=&quot;reference external&quot; href=&quot;http://news.ycombinator.com/item?id=3072260&quot;&gt;Hacker News&lt;/a&gt;.&lt;/p&gt;


   </content></entry><entry><title>Djangopeople.me</title><author><name>Brack3t</name></author><link href="http://brack3t.com/blog/2011/djangopeople_me.html"/><updated>2011-06-13T18:50:00Z</updated><published>2011-06-13T18:50:00Z</published><id>http://brack3t.com/blog/2011/djangopeople_me.html</id><content type="html">
       

&lt;div class=&quot;section&quot; id=&quot;what-is-it&quot;&gt;
&lt;h1&gt;What is&amp;nbsp;it?&lt;/h1&gt;
&lt;p&gt;At it&amp;#8217;s core, &lt;a class=&quot;reference external&quot; href=&quot;http://djangopeople.me&quot;&gt;djangopeople.me&lt;/a&gt; is a place for &lt;a class=&quot;reference external&quot; href=&quot;https://www.djangoproject.com/&quot;&gt;Django&lt;/a&gt; developers to register and be found based on their geographic location, whether it&amp;#8217;s by recruiters or a lonely Django developer like ourselves trying to find others close to him/her. That&amp;#8217;s the general idea behind the&amp;nbsp;site.&lt;/p&gt;
&lt;p&gt;We wanted to make it clean, simple and fast. For the maps we ended up using &lt;a class=&quot;reference external&quot; href=&quot;http://leaflet.cloudmade.com/&quot;&gt;Leaflet&amp;#8217;s&lt;/a&gt; open-source Javascript library. We initially started with Google Maps, but the rate limiting was too restrictive on the geocoding &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; for our needs and frankly, loading maps seemed very slow. So, with the project being free-to-use (and us being cheap), we looked for something&amp;nbsp;else.&lt;/p&gt;
&lt;p&gt;Yahoo! Maps was the next step as they had a decent &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt; and allowed more requests. Google currently allows 2,500 requests per day and Yahoo allows 5,000 requests (geocoding). Yahoo&amp;#8217;s maps were faster to load but we seemed to have nothing but issues with &lt;a class=&quot;reference external&quot; href=&quot;http://google.com/chrome&quot;&gt;Google Chome&lt;/a&gt; throwing a &lt;span class=&quot;caps&quot;&gt;YMAP&lt;/span&gt; Javascript error we could never track down. We didn&amp;#8217;t think it would be all that awesome telling Chrome users to clear their cache up to three times before the maps would load again (If you&amp;#8217;ve had this issue and a have fix, for the love of all that is holy, let us know about it&amp;nbsp;please).&lt;/p&gt;
&lt;p&gt;After searching around for a day, we came across &lt;a class=&quot;reference external&quot; href=&quot;http://leaflet.cloudmade.com/&quot;&gt;Leaflet&lt;/a&gt;. It was simple to implement and the maps were extremely fast to load compared to Google and Yahoo. You could also make the argument that they don&amp;#8217;t have nearly the traffic that Google and Yahoo have but Leaftlet was simple and it worked. Also, our scientific method for testing the load times was simply us reloading pages over and over as we worked on functionality. So don&amp;#8217;t expect any charts. Chris is an impatient guy, so if he gets annoyed by something he&amp;#8217;s built, it&amp;#8217;s not going&amp;nbsp;live.&lt;/p&gt;
&lt;p&gt;There is one issue we ran into with Leaflet and it has yet to be resolved. Their geocoding &lt;span class=&quot;caps&quot;&gt;API&lt;/span&gt;, after about two weeks of use, started retuning funky results. By funky I mean, resolving &lt;em&gt;Las Vegas, &lt;span class=&quot;caps&quot;&gt;NV&lt;/span&gt;&lt;/em&gt;, to Livingston, Illinois. &lt;em&gt;Dallas, &lt;span class=&quot;caps&quot;&gt;TX&lt;/span&gt;&lt;/em&gt; would come back as being in Australia. Chris emailed their support team and they have confirmed it is a bug but they do not have an idea of when it will be resolved. Aside from that, their service has been&amp;nbsp;fantastic.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot; id=&quot;it-s-already-been-done&quot;&gt;
&lt;h1&gt;It&amp;#8217;s already been&amp;nbsp;done.&lt;/h1&gt;
&lt;p&gt;This is true, &lt;a class=&quot;reference external&quot; href=&quot;http://djangopeople.net&quot;&gt;djangopeople.net&lt;/a&gt; was the inspiration for building djangopeople.me. We realized that djangopeople.net had been down for some time, intermittently. It was useful and we had both been contacted by people looking for Django developers through that site. So the original idea was to bring that functionality back and hopefully make it&amp;nbsp;better.&lt;/p&gt;
&lt;p&gt;Kenneth came across a posting on &lt;a class=&quot;reference external&quot; href=&quot;http://convore.com&quot;&gt;Convore&lt;/a&gt; when we were almost ready to launch the site. It appeared that a group of developers were getting together to bring djangopeople.net back online. We almost stopped working on the site as dp.net came back online for a short time. It was really slow and then ended up going back down a day later. So we decided to finish the small bug fixes we were working on and launch&amp;nbsp;it.&lt;/p&gt;
&lt;p&gt;So, just to be clear, djangopeople.me was inspired by &lt;a class=&quot;reference external&quot; href=&quot;http://djangopeople.net&quot;&gt;djangopeople.net&lt;/a&gt;. We just wanted to bring that back to the Python/Django community. We believe the interface is better and faster. Also, using &lt;a class=&quot;reference external&quot; href=&quot;http://twitter.com&quot;&gt;Twitter&lt;/a&gt; as the main auth system made it dead simple to sign up. We&amp;#8217;ve had a few people ask for other authentication methods but at the moment Twitter provided exactly what we wanted with no&amp;nbsp;hassle.&lt;/p&gt;
&lt;p&gt;We use your Twitter username so it&amp;#8217;s very easy to find a profile of someone you already know and follow. This also makes it a little difficult to add other authentication methods as we&amp;#8217;ll now have to deal with allowing people to choose usernames and possibly picking a Twitter username that a future developer would sign up with. We&amp;#8217;re open to suggestions but we like the simplicity of using Twitter. Having recently wrapped up a project using the &lt;a class=&quot;reference external&quot; href=&quot;https://github.com/facebook/python-sdk&quot;&gt;Facebook Python &lt;span class=&quot;caps&quot;&gt;SDK&lt;/span&gt;&lt;/a&gt;, it was nice for Twitter&amp;#8217;s auth system to just work and not get in the&amp;nbsp;way.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;section&quot; id=&quot;what-s-next&quot;&gt;
&lt;h1&gt;What&amp;#8217;s&amp;nbsp;next?&lt;/h1&gt;
&lt;p&gt;We&amp;#8217;ve had a good amount of people sign up and we&amp;#8217;ve gotten some good feedback. We have a couple of ideas for tying into other Django services but we&amp;#8217;re waiting for replies to our emails at the moment. We both contract/freelance full time, so we&amp;#8217;ll probably spend the next week or two throwing ideas around before we know what the next step is. In the meantime, check out the site and let us know what you love and/or hate about it. We&amp;#8217;ve got thick&amp;nbsp;skins.&lt;/p&gt;
&lt;/div&gt;


   </content></entry></feed>
