News for hackers. Stuff that matters.
Re:Fundamentals of Optimal Code Style by kbenson on Friday March 26, 2021 @12:40AM (#26588810)
Yeah, it's interesting that they present two choices, but not my preferred choice, thus leaving me to wonder why their options are supposedly superior. E.g. out of

    result = someFunction(firstArgument, secondArgument);
    result = someFunction (firstArgument, secondArgument);
They view the second as easier to distinguish the function from the arguments. I agree. But then again, I generally might write that like so:

    result = someFunction( firstArgument, secondArgument );
Which I think accomplishes the same purpose, and as a style has the added benefit of making KV pairs more distinct if you group them:

    result = someFunction( argX="foo", argY="bar" );

There are no comments on this comment yet.