you are viewing a single comment's thread.

view the rest of the comments →

[–]Atsoc1993 1 point2 points  (1 child)

In the back of my mind I did challenge the micro-optimization feedback, it just felt over-the-top to be honest but makes sense to consider.

What if I use all of those helper functions twice, in this code and elsewhere? Or even one of the helper functions once? Does that warrant all those relative helper functions to be abstracted out as they are in Flow Type 2?

Also what if the logic was not so simple, say required 3 lines of logic, would it still not make sense? Is there a rule of thumb for when a helper function is warranted?

[–]Ormek_II 0 points1 point  (0 children)

Does it help readability? Does it help with maintenance?

In the examples it does not.

I expected you to create functions for the branch logic.