News for hackers. Stuff that matters.
Re:Be wary of functions which take several parameters of the... by yawgmoth on Friday September 27, 2019 @08:00AM (#21090901)
Personally, in C#, I don't enjoy debugging and maintaining Fluent APIs. An exception thrown in the chain is sometimes opaque and the necessary extension methods to make everything come together is not neat code. The former reason is why I also discourage use of object initializers.
Re:Be wary of functions which take several parameters of the... by tluyben2 on Friday September 27, 2019 @09:39AM (#21091796)
I like those API's much better for reading, but when there are issues with them, like you say, debugging is often a right pain compared to the other examples. Especially when a chain became a bit too long (over time) and there is suddenly a null somewhere (for whatever reason). VS indicates the error in the first line of the chain and debugging can become quite hairy.

Is that better in other language runtimes/debuggers?

Re:Be wary of functions which take several parameters of the... by GordonS on Friday September 27, 2019 @06:17PM (#21096751)
If you want to be more opaque, I guess you could do:

```c# var file = File("source"); file.CopyTo("target"); ```

(apologies if this is formatted badly; no clue what HN supports here, and I'm on mobile)

Re:Be wary of functions which take several parameters of the... by lonelappde on Friday September 27, 2019 @01:57PM (#21094495)
The proper place to pay the dev cost is once in the library, not in all its callers.