Comments by "Kristopher Driver" (@paxdriver) on "Scams In Software Engineering" video.
-
1
-
6 line functions are fine if the function names are long, fully worded English verbs. If you can read functions like English language then it's fine, but most devs do half and half - poorly named short functions or lengthy named huge functions with 6 flags to switch its usage.
If you've got a database that you want to insert, update, or upsert based on the element of the array then that's fine to have 1 function do 3 things if it means I can dump an array of mixed changes into one function as one parameter, then it's fine to have a function long and do several things. Once it works you never have to look at it again.
But when you have short functions like "update_metadata", "insert_new", "upsert_db" then it doesn't help me the developer know if the data in this array needs upsert or update because I haven't memorized mongo docs.
I was never formally trained but I started in 1999 so I have some experience. My code isn't the most elegant or clever, I'm no genius, but anybody who speaks English can read my code. Compilers will optimize, code is for humans to read and reason through.
1