News for hackers. Stuff that matters.
Re:Go Concurrency Patterns: Context by trhway on Tuesday July 29, 2014 @03:44PM (#8104525)
>Hence, having the standard that all functions get the context always seems excellent because it is no longer something to think or worry about and doesn't increase code length by an unreasonable amount.

how about new paradigm - context-oriented programming :) where, like "this/self" in OOP, ctx is always present. And looking through the posted article Google is somewhat there with context [instance level] kind of inheritance (the context tree)

Re:Go Concurrency Patterns: Context by mhogomchungu on Tuesday July 29, 2014 @04:13PM (#8104713)
> how about new paradigm - context-oriented programming :) where, like "this/self" in OOP, ctx is always present.

This is how OOP in C is done though usually its done with the context being an opaque object.

Having functions with multiple arguments that depends on other functions with multiple arguments that depends on yet other functions with multiple arguments will result is very hard to manage function dependencies sooner or later and "context-oriented-programming" solves this problem very nicely.

A function that takes a single argument as a pointer to a struct can be extended indefinitely without breaking the function API.A function that takes its arguments by individual arguments will break everytime it need to be extended by an additional argument.