Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 3
    $\begingroup$ One size doesn't fit all. What matters is legibility. and sometimes creating more space helps. $\endgroup$ Commented Nov 27, 2023 at 11:20
  • 1
    $\begingroup$ I haven't heard the "one screen" function size limit recommendation before. This seems pretty arbitrary. Nowadays, with high res vertical monitors, "one screen" can probably fit 500 lines of code or more. In general, it's good to approach any sort of one-size-fits all rule like this with suspicion. Regarding the switch-case question, usually use a lookup table in whatever language you're using, preferably populated by raw data (JSON, typically). But it depends on your specific use case. switch-cases may be calling functions rather than accessing simple data. $\endgroup$ Commented Nov 27, 2023 at 20:23