I experimented using the function options (e.g. withFunc() ) in PHP. I know 
its unnecessary as PHP functions and methods can accept optional 
parameters, and I know that you cant have function types in PHP, but the 
approach is still so clean and self documenting I'd like to use it for much 
more in PHP:

$conn = new Beanstalk\Connection(
    withHost('127.0.0.1'),
    withPort(11300),
);

I've also found that my approach is much more "inside out", much more like 
Uncle Bobs clean architecture - a core library of domain objects is what I 
am building, with supporting tools for use cases e.g. PHAR command line 
tool.


On Tuesday, January 17, 2017 at 5:58:46 AM UTC, so.q...@gmail.com wrote:
>
> Just curious how often you find yourself applying idiomatic Go patterns to 
> other languages? (JavaScript, Python, C#, Java)
>
> For instance returning and handling an error value as opposed to 
> throw-try-catch. I understand this isn't the best example since try-catch 
> exceptions are more closely aligned to panics, but I do find myself 
> returning more error values since using Go.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to