Re:Write tests. Not too many. Mostly integration
by al2o3cr on Friday October 27, 2017 @07:12AM
(#15567287)
We had this at a company I worked at a while back - dozens of modules with nothing but static functions that all took a first argument of the same type. If only there was some kind of METHOD for declaring a whole bunch of functions that operated on the same data...
[ Parent
| on HN ]
Re:Write tests. Not too many. Mostly integration
by meheleventyone on Friday October 27, 2017 @11:38AM
(#15569433)
Until you get into polymorphism etc. this is just a style thing.
method(a,b) is equivalent to a.method(b) and exactly as much typing. You do save manually typing the extra part of the definition but 'eh'. A few languages treat these interchangeably.