News for hackers. Stuff that matters.
Re:The tyranny of the Hollerith punched card by hughes on Monday June 06, 2016 @12:03PM (#11847747)
Has anyone tried enforcing a variable-reference-per-line limit? Eg. if the limit is 4, then these two lines equally hit the limit:

  foo = bar(baz, qux)
  myClassInstance.someWritableVar = lib.someFunction(param1, MyOtherClass.constants.FOO)
The second line is well over 80 chars, but may be as understandable as the first.
Re:The tyranny of the Hollerith punched card by kiruwa on Monday June 06, 2016 @01:03PM (#11848276)
It effectively limits all functions that return a value to 2 parameters. I rarely go over that, but it would seem a bit arbitrary to bump into.
Re:The tyranny of the Hollerith punched card by to3m on Monday June 06, 2016 @02:37PM (#11849117)
You can press the Return key? :)

    const uint64_t *p=bsearch(&ref->u,
                              df->file_offsets,
                              df->num_file_offsets,
                              sizeof df->file_offsets[0],
                              &CompareU64s);
That's from emacs. It's a bit hit or miss whether editors do something nice like the above, or just indent the arguments by one stop, but other options seem to be fairly rare.

I generally have one function call per line for ease of debugging. Nothing worse than having to do a fiddly step in/step out dance when you're trying to think about what's going on. But it's also good for keeping on top of line lengths too.

Re:The tyranny of the Hollerith punched card by kiruwa on Monday June 06, 2016 @03:29PM (#11849580)
Eh, seems fine, just seems odd to be forced to do that for a three-argument function.