|
|
|
|
|
by cartlidge
2530 days ago
|
|
I thought the point of code is to make it more difficult for the non-initiate to read it... Actually, I think a good, justly polymorphic function should probably have a word of a reasonable length and parameters that are called `a`, `x`, `f`, since the parameters convey almost no information. If they have any greater length, it's just a restatement of the known information about the type. The more unique information a name conveys, the less information the types convey and the bigger a chance you have of bugs or coding yourself into a hole. But also, if you've called it `x` hopefully there's only one thing it can be and its scope is just one or two lines so you've written a single unit. If there's anything else `x` could be, then you've got a problem - your unit is too much. Not every piece of code should be written this way, but your vocabulary should be built up of pieces like this. |
|