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