DEV Community

Discussion on: ✔||🤢 Commit or Vomit | function currying 🍛

Collapse
 
jackmellis profile image
Jack • Edited

Is the question "do we like currying as a feature?" or is it "do we like this style of currying?" @jmdejager

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

I understood the question as "do you like this code", regardless of currying as a concept.

Thread Thread
 
jmdejager profile image
🐤🥇 Jasper de Jager

yes that's the idea of ✔|| 🤢 but the example obviously wasn't clear enough. I'll make some changes for future viewers 😎

Collapse
 
jmdejager profile image
🐤🥇 Jasper de Jager

good question, it was meant as currying as a feature but... it is commit or vomit so I gues would you commit the code or not.

Thread Thread
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

In that case, what the code does would maybe better be described as "manual currying", as normally the word refers to something that happens automatically (often even on a language-level).

Doing this manually can be useful in edge-cases, but just currying every function for good measure is definitely a bad idea.

  • ✔ When done for a reason
  • 🤢 When overused