DEV Community

loading...

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

Collapse
darkwiiplayer profile image
DarkWiiPlayer

Definitely 🤢!

This way it is much easier to read:

const mul = a => b => c => a*b*c
Enter fullscreen mode Exit fullscreen mode
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
DarkWiiPlayer

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

Thread Thread
jmdejager profile image
🐤🥇 Jasper de Jager Author

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 Author

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
DarkWiiPlayer

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