DEV Community

Discussion on: Daily Challenge #57 - BMI Calculator

Collapse
 
shostarsson profile image
Rémi Lavedrine

That is an interested method, but come back at your code in a few months with absolutely no explanation and I do think that it is not going to be that easy.

I think that a code should be self explanatory (especially to newcomers on your codebase) and, even if this one is a tour-de-force in terms of one-liner, it is not self explanatory. 😉

That is why, I would find that a switch case method would be better.

Collapse
 
ynndvn profile image
La blatte

I completely agree with you on this one! (Hi fellow french dev!) I tend to try to golf a lot in these challenges, even though I completely agree on the fact that it's as ugly as it can be. That way, I can discover new principles (like the reduce method, that I hated a few months back even if it is really useful) that I can later use on my projects or at work.

Indeed, this challenge was clearly made for a switch/case solution, but as I had some free time I though I could try something different haha