News for hackers. Stuff that matters.
Re:Introducting go-pipeline by echlebek on Monday January 09, 2017 @07:41PM (#13361481)
I'm not sure why I should use this and give up typed channels when I could easily implement the same logic on my own?
Re:Introducting go-pipeline by bogaczio on Tuesday January 10, 2017 @01:23AM (#13363073)
I would say that as long as you have a small enough number of types where implementing this for each of them (and each combination of them) is manageable... you should. The absolute worst thing about this is losing type safety (and I helped write it). The time to use this is IF this kind of design could simplify your code overall AND the number of types and their combinations is simply too much to code. Say you have four input types, two intermediary types, and one output type, and more than one step in between them, then you'd be writing about 15 times the code. We actually had a situation like this, which is why it came in handy. If you're not in this situation though, I would always advocate retaining type safety.