{"id":54,"date":"2004-04-01T09:50:00","date_gmt":"2004-04-01T17:50:00","guid":{"rendered":"http:\/\/eschatologist.net\/blog\/?p=54"},"modified":"2009-01-25T21:01:17","modified_gmt":"2009-01-26T05:01:17","slug":"code-width","status":"publish","type":"post","link":"https:\/\/eschatologist.net\/blog\/?p=54","title":{"rendered":"Code Width"},"content":{"rendered":"<p>There&#8217;s a question on <a href=\"http:\/\/discuss.fogcreek.com\/joelonsoftware\/default.asp?cmd=reply&#038;ixPostParent=128655&#038;sHeadline=Wrapping+code+at+80+columns%3F\">wrapping code at 80 columns<\/a> in the <a href=\"http:\/\/discuss.fogcreek.com\/joelonsoftware\/\">Joel on Software Forum<\/a>.  Most of the time, when I see 80 columns as a standard it&#8217;s to enable easy printing of the code.  However, in this day and age, why are you printing code?  I print code occasionally when I need to read it in-depth, but other than that I do most of my reading on-screen.  It&#8217;s certainly not a regular occurrence.<\/p>\n<p>I also use mostly large or widescreen displays for coding.  The smallest display I use regularly is my laptop, which is 1152 by 768.  Most of the time I use my 19-inch monitor, which I run at 1600 by 1200.  As a result, if I want to write really long lines, I can.  But I don&#8217;t.<\/p>\n<p>I generally limit the length of lines I write to 80 to 120 characters.  Most of the time this is easy, because Objective-C&#8217;s syntax lends itself to very readable multi-line expressions:<\/p>\n<pre>NSDictionary *d = [NSDictionary dictionaryWithObject:@\"Chris\"\n                                              forKey:@\"name\"];<\/pre>\n<p>The main reason I do it, though, is that I use multiple windows while I code.  I usually have <em>at least<\/em> 6 windows open in Xcode while I&#8217;m coding: The Xcode project itself, the source and header file for the class I&#8217;m working on, the source and header file for the unit test I&#8217;m working on, and the build results window (which also shows my unit test results).  Often it&#8217;s much more, with more class and unit test sources &#038; headers open.  And it&#8217;s much easier to fit these windows all on a screen when they don&#8217;t need to be as wide as the screen to see their contents&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There&#8217;s a question on wrapping code at 80 columns in the Joel on Software Forum. Most of the time, when I see 80 columns as a standard it&#8217;s to enable easy printing of the code. However, in this day and age, why are you printing code? I print code occasionally when I need to read&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[3],"tags":[9,36,18,17],"class_list":["post-54","post","type-post","status-publish","format-standard","hentry","category-technology","tag-cocoa","tag-joel-on-software","tag-objective-c","tag-xcode"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p74loH-S","_links":{"self":[{"href":"https:\/\/eschatologist.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/54","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eschatologist.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eschatologist.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eschatologist.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/eschatologist.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=54"}],"version-history":[{"count":1,"href":"https:\/\/eschatologist.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/54\/revisions"}],"predecessor-version":[{"id":55,"href":"https:\/\/eschatologist.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/54\/revisions\/55"}],"wp:attachment":[{"href":"https:\/\/eschatologist.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=54"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eschatologist.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=54"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eschatologist.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=54"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}