Note that these samples are not semantically equivalent, so that may factor 
into the choice between the two for more complex examples. While using 
'with', if the pipeline value comes out "empty" then the entire 'with' 
block is skipped. That may have implications in both the short and long 
term (when considering maintaining this code), in regards to both 
performance and actual output generated 
On Monday, May 26, 2025 at 8:41:56 PM UTC-6 Paul Baker wrote:

> > I'd consider both to be perfectly reasonable ways of going about
> > what you're doing. [...] And most of the time I would likely pick 
> example 1
>
> Thanks Nick. Example 1 is my preference as well - I'm a fan of the Zen
> of Python's "Explicit is better than implicit" and "Flat is better
> than nested".
>
> However most other templates I've seen tend to resemble example 2.
> It's good to know that's mostly just preference, not because example 1
> is somehow flawed.
>

-- 
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.
To view this discussion visit 
https://groups.google.com/d/msgid/golang-nuts/c673d79f-19a5-4873-8c82-996bac373293n%40googlegroups.com.

Reply via email to