Remove data types from main function. #8
Replies: 4 comments 2 replies
-
In addition we could add other cues for parameter types and defaults: colours, icons, font styling, sub/superscript, tooltips. Also applies to #9 . |
Beta Was this translation helpful? Give feedback.
-
I'm of two minds here.
|
Beta Was this translation helpful? Give feedback.
-
I find that first line to be more like a heading/summary of the function, since it has the parameter names and types. By looking at it I know what values the function takes, and I maybe don't even need to read down to the rest of the page. So I'm not in favor of removing the data types/defaults. |
Beta Was this translation helpful? Give feedback.
-
At first, I found it hard to read the main function with such format, though I eventually got used to it, I still feel a bit hmm... seeing it from time to time. I'm thinking that since the Parameter section in the current page layout isn't right below the main function, it would be not easy to refer to what values the function takes easily. So if we can make sure the Parameter section and the main function are displaying at the same time or without requiring too much scrolling to refer to parameters, I think it would be nice to remove the data type from the main function to increase the readability. We probably could remove the data types after making sure that we (just like what Steve mentioned above) Or, if we eventually decided not to remove the data types, I'm wondering if it's a good idea to reformat the main function section. |
Beta Was this translation helpful? Give feedback.
-
WordPress functions can take numerous arguments and trying to read the function declaration is difficult. We don't need the data types if we have the parameters listed immediately below as presented in #7 and make the data type easier to see as presented in #9.
This will improve:
Beta Was this translation helpful? Give feedback.
All reactions