Apr 30, 2017

[HDGEM] Function without parameters is an antipattern.

There are certain scenarios in which it might be useful of function without parameters, but those are very rare and mostly related to already-broken design. 

If the function doesn't have any params, then what does it do? Where does it take the input and state? It could a global one — but that is an antipattern, too. 

Functions need input and output and should be pure.


--
Posted By Blogger to HDGEM at 4/30/2017 01:36:00 PM
Post a Comment

Featured Post

Setup Chinese Input Method in Ubuntu 17.10 Artful

sudo apt install ibus-sunpinyin After either of those commands do not forget to restart the IBus daemon ibus restart You might need t...