Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Why isn’t the AI suggesting putting into an appropriately named const? Magic numbers are poor practice.


Good catch. The team could add this rule to their Ellipsis config file to make sure that it's always flagged: "Never use magic numbers. Always store the number in a variable and use the variable instead."

Docs: https://docs.ellipsis.dev/config#add-custom-rules


But even that isn’t ALWAYS the case. There are times when it is appropriate to have numbers inline, as long as they’re not repeated.

This is where good judgement comes in, which is difficult to encode rules for.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: