from Hacker News

Go: Functional Options are named args on steroids

by vmihailenco on 10/21/21, 8:42 AM with 1 comments

  • by DeathArrow on 10/21/21, 9:39 AM

    In both C# and Nim (and probably other languages ) it's easy to use fluent syntax:

    MyConfig() .WithTimeout(0).WithDir("/home").DirFromEnv("DIR")