> There’s nothing wrong with writing reusable functions, and most well-written functions will be reusable without adding any needless complexity. However, too often I’ve seen developers over-generalize a problem to the detriment of readability.
I think one of the main points why a lot of developers tend to over-generalize is because they are not specific enough with the name of the function they are trying to write. Although it looks dull, I find the best workflow is giving functions (or methods) very specific names.
I think there are two major advantages as to why you should do it:
- the problem mentioned in the text of over-generalising is minimised since you are forced to think about what exactly that method should do when creating it, not while writing it.
- other people using your code will (to a certain degree) instantly know, what the function method is doing without having to look at the code
The design reminded me very much of Craft, which im using currently → What are the advantages of using a card base note system over a regular "file"based one?
Obviously, I can see the "visual" difference, but in terms of actual usage, where's the difference?
I think one of the main points why a lot of developers tend to over-generalize is because they are not specific enough with the name of the function they are trying to write. Although it looks dull, I find the best workflow is giving functions (or methods) very specific names.
I think there are two major advantages as to why you should do it: - the problem mentioned in the text of over-generalising is minimised since you are forced to think about what exactly that method should do when creating it, not while writing it. - other people using your code will (to a certain degree) instantly know, what the function method is doing without having to look at the code