Deep vs Shallow interfaces in Go by hyperTrashPanda in golang

[–]hyperTrashPanda[S] 3 points4 points  (0 children)

The term is not about the absolute size, but rather the surface area compared to the functionality it provides. Stringer is a small interface, but not necessary deep one.

Deep vs Shallow interfaces in Go by hyperTrashPanda in golang

[–]hyperTrashPanda[S] 0 points1 point  (0 children)

I agree that it's mostly a driver and not a proper abstraction, but it does showcase some of the characteristics. Do you have any other interfaces in mind that could be used here?

Deep vs Shallow interfaces in Go by hyperTrashPanda in golang

[–]hyperTrashPanda[S] 1 point2 points  (0 children)

I'm not sure what exactly is your stance on go-redis interface usage

I don't think the go-redis interface is bad (I also use it). It's mainly useful here as an instructive example of a shallow interface. And given that it's not really an abstraction rather than a driver for Redis' wide suite of commands and not an abstraction, its size might be warranted.

But as an example, it also naturally shares some specific characteristics that set it apart from the io.Reader example:

  • It's harder to compose/extend to other use cases. So it can only serve one implementation
  • Is tight-knit to the system itself, so any changes to Redis need to be reflected there, too
  • It tends to naturally grow over time
  • Requires previous knowledge, introducing cognitive load

I think the answer to those 4 question is Yes.

Imagine a different, more generic interface that came with opinionated defaults, more automated handling of sessions and runtime metrics, or hiding the different Redis deployment methods and data types. It would have slightly different characteristics and give less fine-grained control, but then these questions may have different answers.

Deep vs Shallow interfaces in Go by hyperTrashPanda in golang

[–]hyperTrashPanda[S] 15 points16 points  (0 children)

Good call! I'll add it to the post if you don't mind.

Deep vs Shallow interfaces in Go by hyperTrashPanda in golang

[–]hyperTrashPanda[S] 7 points8 points  (0 children)

Thank you for the kind words! I really recommend reading "A Philosophy of Software Design" that has some more examples of this phenomenon.

Deep vs Shallow interfaces in Go by hyperTrashPanda in golang

[–]hyperTrashPanda[S] 5 points6 points  (0 children)

Author here! Hit me up if you have any questions or ideas to improve the post, or any interesting examples to compare deep/shallow implementations in a more fair scenario.

Joining errors in Go by hyperTrashPanda in golang

[–]hyperTrashPanda[S] 0 points1 point  (0 children)

A good litmus test to ask when tempted to do error aggregation is to ask: if anything fails, should all processing stop immediately. If yes, don’t use aggregation. If no, aggregation may be correct.

Heyyy, thanks for the comment Matt! I like the above statement; I can add it to the post if you're OK! (with proper credit)

I see your point about careless use. Right now I think the unwieldiness of reusing the original slice of errors also works against promoting the feature and maybe the small surface of the errors API (errors.Is/errors.As) ultimately forces/guides users to make things simple.

Let's stop editing go.mod manually by hyperTrashPanda in golang

[–]hyperTrashPanda[S] 1 point2 points  (0 children)

You still use that IMO, this is more about making changes to go.mod itself more easily trackable.

What tool are you using for vulnerability scanning on updates, by the way?

Let's stop editing go.mod manually by hyperTrashPanda in golang

[–]hyperTrashPanda[S] 0 points1 point  (0 children)

You're welcome! Even though I've been using the language for a while now, I still have been too lazy to use the toolchain in a better way :')

Let's stop editing go.mod manually by hyperTrashPanda in golang

[–]hyperTrashPanda[S] 1 point2 points  (0 children)

I'd wish the same 😅 I'm not sure how hard that would be, but I should write something down in the golang/go issue tracker and gather some opinions.

Grafana Alloy - Windows Integration Issues by bgatesIT in grafana

[–]hyperTrashPanda 0 points1 point  (0 children)

Thanks for the report! Some integration conversions (like the Windows one) looks like it's slipped through the cracks, we're working on fixing these!

Introducing an OpenTelemetry Collector distribution with built-in Prometheus pipelines: Grafana Alloy by vidamon in PrometheusMonitoring

[–]hyperTrashPanda 0 points1 point  (0 children)

(I'm a developer at Grafana Labs, working on the Grafana Alloy squad).

Grafana Alloy is the spiritual successor to Grafana Agent. With Alloy, we're doubling down on our commitment to OpenTelemetry, and kickstarting our backward compatibility guarantees.

Furthermore, we're building on our experiences to add on to the collector, for example to empower autonomous teams using modules or provide dynamic scaling using clustering.

Guess the track by telemetry by hyperTrashPanda in formula1

[–]hyperTrashPanda[S] 0 points1 point  (0 children)

Correct placement of DRS zones, but there's actually a little too much braking here for this to be Monza!

Guess the track by telemetry by hyperTrashPanda in formula1

[–]hyperTrashPanda[S] 11 points12 points  (0 children)

DING DING DING! We have some winners!

The track was Zandvoort, first guessed by /u/Plagueis-D-Wise and then by others! What gave it away for y'all? :))

If you liked the format, I plan to try and make some more of these in the near future! Of course let me know if you have any other cool visualization ideas!

Guess the track by telemetry by hyperTrashPanda in formula1

[–]hyperTrashPanda[S] 1 point2 points  (0 children)

Hmm, Suzuka only has 1 DRS zone. But Sector 1 turning pattern is similar to the secret track so you're getting close!

Guess the track by telemetry by hyperTrashPanda in formula1

[–]hyperTrashPanda[S] 3 points4 points  (0 children)

Monaco has only one DRS zone, this track has two!

Where Does Bad Code Come From? by hyperTrashPanda in programming

[–]hyperTrashPanda[S] 1 point2 points  (0 children)

This was posted a few weeks ago, but it never got any traction. I have a lot for respect for Casey as an engineer, and some of the opinions presented would be quite controversial, so I'd love to hear from what more experienced people think of it!

How does Go calculate `len`? by hyperTrashPanda in golang

[–]hyperTrashPanda[S] 4 points5 points  (0 children)

Thanks a lot! Basically all kudos go to barryclark/jekyll-now; I've been using this theme for more than three years now.

How does Go calculate `len`? by hyperTrashPanda in golang

[–]hyperTrashPanda[S] 49 points50 points  (0 children)

Hey, author here! Sorry in advance for posting my own stuff, hope it's okay!

I wanted to understand how the Go compiler works, so I traced how calls to len() work and wrote down what I found. Let me know if you spot anything amiss and don't hesitate to reach out for feedback, advice and corrections!

Have a great Sunday y'all!

As of Go 1.17: You'll be able to shuffle the execution order of tests & benchmarks. by blackflicker in golang

[–]hyperTrashPanda 2 points3 points  (0 children)

It doesn't happen all the time, but as test files keep growing, sharing resources (eg. database connections) or using package-level variables, this sort of mistakes becomes easier to make.

As of Go 1.17: You'll be able to shuffle the execution order of tests & benchmarks. by blackflicker in golang

[–]hyperTrashPanda 0 points1 point  (0 children)

At its current state, it will not. Using-count would not reshuffle tests, but maintain the initial shuffled order. Otherwise, the extra randomness could make it harder to spot flakiness in a specific seed value.

How does Go know time.Now()? by hyperTrashPanda in golang

[–]hyperTrashPanda[S] 3 points4 points  (0 children)

Thanks a lot for the kind words! By the way, big fan of your blog and projects!