DEV Community

Cover image for 3 clean code principles for the functional programming beginner

3 clean code principles for the functional programming beginner

Ayabonga Qwabi on October 13, 2019

1. Name things meaningfully When you name a variable the name you give it must tell us that variable's whole life story. It must tell us...
Collapse
 
mattmcmahon profile image
Matt McMahon

Only thing better than a well named variable is a variable that doesn't need a name at all. Many of these functions could be written in a point-free style and composed or piped together. Add some higher order functions to simplify, e.g. filterPetsBy, and you'd have an excellent follow up to a great beginner article. 👏👏👏👏

Collapse
 
1crazymoney profile image
1Crazymoney

Yes you are correct sir

Collapse
 
sirseanofloxley profile image
Sean Allin Newell

+1 for the code potatoe.

Collapse
 
davidvalenciait profile image
davidvalencia-it

Thank u !

Collapse
 
haaxor1689 profile image
Maroš Beťko

the getCatsAnd... method kind we called an ensure... and everyone new that these methods did stuff that was too bullshit to call properly.

Collapse
 
douglasvincent profile image
Douglasvincent

Thanks for the potatoe

Collapse
 
ken11zer01 profile image
ken11zer01

You got the potato from the "Potato Pirate" card game right?