Hacker News new | ask | show | jobs
by aleem 4500 days ago
Touche. Multiple monitors and more screen real estate has been proven to increase productivity. It's an easy win.

If the lines come out too long too often, it may be a symptom of other problems.

  if ((browser.OS == 'win') && (browser.userAgent == 'IE')) {
is often better written as:

  isIE = (browser.userAgent == 'IE');
  isWindows = (browser.OS == 'win');
  if (isIE && isWindows) {
It's self-documenting and reads like natural english. It also has the good side-effect of making lines shorter, more terse.
1 comments

Its more code, more variables. I sometimes do this with complex conditions, but for your example I find it counterproductive.
Well if this is deep deep down in a nested loop, then either you increase char or you wrap that code into multiple statements. It would be counterproductive if this is first or second level.

However, I think I missed one important point. If you are writing for Linux kernel, then 80 chars is definitely not enough since 8 spaces = 1 tab in kernel code. That is, if you have a deep branching, then after 2-3 levels 80 chars wouldn't be enough. But increasing to 100 is only going to help for an extra level.

So the important point missing is the char limit is often project coding style dependent.