2 comments

  • yakubov_org 13 hours ago
    When GitHub Copilot suggests your next line of code, does it matter whether your variables are named "current_temperature" or just "x"?

    I ran an experiment to find out, testing 8 different AI models on 500 Python code samples across 7 naming styles. The results suggest that descriptive variable names do help AI code completion.

    Full paper: https://www.researchsquare.com/article/rs-7180885/v1

  • ssalka 12 hours ago
    The names of variables impart semantic meaning, which LLMs can pick up on and use as context for determining how variables should behave or be used. Seems obvious to me that `current_temperature` is a superior name to `x` – that is, unless we're doing competitive programming ;)
    • yakubov_org 12 hours ago
      My first hypothesis was that shorter variable names would use fewer tokens and be better for context utilisation and inference speed. I would expand your competitive programming angle to the obfuscated C challenge ;)