Skip to content

Commit

Permalink
Adds link for 80 char limit info.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyckahn committed Jul 6, 2012
1 parent c4dcf47 commit 658aacd
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -16,7 +16,7 @@ Much of my style is rooted in the [Google JavaScript Style Guide](http://google-


There's nothing more irritating when trying to grok code than scrolling around to see the entire line. It's a mental context killer. While any text editor worth its disk space has the option to wrap text automatically, chances are your code will be read in an environment that doesn't. This includes CLI programs (like diff and less) and web-based source viewers like Github. Don't make people scroll, it's mean. There's nothing more irritating when trying to grok code than scrolling around to see the entire line. It's a mental context killer. While any text editor worth its disk space has the option to wrap text automatically, chances are your code will be read in an environment that doesn't. This includes CLI programs (like diff and less) and web-based source viewers like Github. Don't make people scroll, it's mean.


At some point in computer history, somebody (arbitrarily?) created an 80 character line limit for code. It's formally documented in the [Python Style Guide](http://www.python.org/dev/peps/pep-0008/#maximum-line-length), and I think it's totally awesome. This has two benefits. First, as I mentioned, you eliminate the need to horizontally scroll. More substantively, this promotes code simplicity. When you restrict yourself to 80 characters before a line break, you're more likely to break statements up into smaller chunks. I don't like clever code that crams a bunch of nested function calls into lines like this: At some point in computer history, somebody ([<del>arbitrarily?</del>](http://programmers.stackexchange.com/questions/148677/why-is-80-characters-the-standard-limit-for-code-width)) created an 80 character line limit for code. It's formally documented in the [Python Style Guide](http://www.python.org/dev/peps/pep-0008/#maximum-line-length), and I think it's totally awesome. This has two benefits. First, as I mentioned, you eliminate the need to horizontally scroll. More substantively, this promotes code simplicity. When you restrict yourself to 80 characters before a line break, you're more likely to break statements up into smaller chunks. I don't like clever code that crams a bunch of nested function calls into lines like this:


```javascript ```javascript
setTransformStyles(context, buildTransformValue(this._transformOrder, _.pick(state, transformFunctionNames))); setTransformStyles(context, buildTransformValue(this._transformOrder, _.pick(state, transformFunctionNames)));
Expand Down

0 comments on commit 658aacd

Please sign in to comment.