KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ Code Formatting Re: Code Formatting

  • davidcrossey

    Member
    March 19, 2024 at 11:01 am

    Thanks for sharing @dhodgins.

    Whilst I don’t necessarily agreed with all of the points based on personal preference, I do agree with the overall theme of keep it simple and consistent – both for readability and performance.

    I find it’s a balancing act, for example on the projection performance, one may prefer a more tacit style approach as it can be cleaner/easier to read right-to-left the following expression:

    aggFunc projFunc[var1;] calcFunc

    vs

    aggFunc projFunc[var1;calcFunc]

    Especially if calcFunc has a longer definition and if the small performance overhead justifies it.

    Your blog post and notes on style can be eye-opening and help to develop good code hygiene over the long term.