You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem?
This is a follow-on from PR #148
From the call to getOpenSearchData, it seems that this is not a fetching function, this function is picking the selected data fields out of each record of the given arrayHits.
rename getOpenSearchData. Something that describes what is happening to the data - "pickFeildsFromDataArray" ?
divide and encapsulate the code to find the field within the hit-object. This will make the loops within the function much easier to read.
divide and encapsulate the date-management code. The date-formatter, and the conditional to detect a date, should both be single functions with simple input (1 or 2 args only).
While you're constructing code, always be thinking about how that code "tells a story". Reading lines of syntax is very difficult cognitively -- yes that is why we are hired to do the job we're doing (because we're good at reading code) -- our job is more than that though. We need to write code that is easier to understand to someone else... and to your future self. Use function names that convey the intention of that step in a process. Collect lines of code together that accomplish a thing, and put them in a function. Even when the function has only one usage... a well named function will save millions of exhausted brain cells the next time somone (or You!) need to read and undersand that code.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem?
This is a follow-on from PR #148
From the call to
getOpenSearchData
, it seems that this is not a fetching function, this function is picking the selected data fields out of each record of the givenarrayHits
.getOpenSearchData
. Something that describes what is happening to the data - "pickFeildsFromDataArray" ?While you're constructing code, always be thinking about how that code "tells a story". Reading lines of syntax is very difficult cognitively -- yes that is why we are hired to do the job we're doing (because we're good at reading code) -- our job is more than that though. We need to write code that is easier to understand to someone else... and to your future self. Use function names that convey the intention of that step in a process. Collect lines of code together that accomplish a thing, and put them in a function. Even when the function has only one usage... a well named function will save millions of exhausted brain cells the next time somone (or You!) need to read and undersand that code.
The text was updated successfully, but these errors were encountered: