top | item 45640923

(no title)

bobmarleybiceps | 4 months ago

A personal guideline for a lot of stuff is that a function may be too long when people add comments to mark what sections of it do. (ofc not really a hard rule). I just think it's easier to see "oh this is calling the load_some_stuff function, which I can easily see returns some data from a file." Rather than <100 lines of stuff, inlined in a big function, that you have to scan through to realize it loads some stuff and/or find the comment saying it loads some stuff>. That is to say, descriptive functions names are easier to read than large chunks of code!

smaller functions are also usually easier to test :shrug:

discuss

order

No comments yet.