News for hackers. Stuff that matters.
Re:Do you use blank lines in your code? by user24 on Saturday November 06, 2010 @05:52PM (#1877850)
Lol, yeah only kidding - I don't write minified code. No, I just skip that layer entirely and type pure gzipped data.

edit: but seriously, yeah I use tonnes of whitespace and bucketloads of comments. No point making things harder than they need to be. Also commenting helps you solidify your understanding of the code.

I tend to write like this:

  while(foo) {
    code;
  }
rather than

  while(foo)
  {
    code;
  }
I use newlines to separate tasks in the code. Example:

  // do the foo check
  if(foo){
    removeFoo();
  }

  // now perform the bar operation
  if(shouldDoBar) {
    performBar();
  }

  // now return
  return fooBar;
Re:Do you use blank lines in your code? by KevBurnsJr on Saturday November 06, 2010 @11:53PM (#1878607)
Remove every comment in your last example and see if you can still read it.

I believe you will find it easier to read.

Re:Do you use blank lines in your code? by user24 on Sunday November 07, 2010 @07:41AM (#1879227)
just an example, but thanks for your valuable opinion.
Re:Do you use blank lines in your code? by lucisferre on Sunday November 07, 2010 @03:23AM (#1879011)
I really hope you don't comment code like that and this is just a result of the example.
Re:Do you use blank lines in your code? by user24 on Sunday November 07, 2010 @07:34AM (#1879215)
yeah, it was just a toy example. I also don't name variables 'foo' and have functions called 'performBar' :P