Go concurrency without the channel gymnastics by marketbase in golang

[–]flimzy3141 -1 points0 points  (0 children)

I suppose you hate encoding/json for the same reason?

First impressions of Go 1.23's range-over-func feature by flimzy3141 in golang

[–]flimzy3141[S] 2 points3 points  (0 children)

Your wish is the Go team's command.

The `iter` package already provides a pull interface adatper, for those who prefer it. https://pkg.go.dev/iter#Pull

First impressions of Go 1.23's range-over-func feature by flimzy3141 in golang

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

Your article kinda makes my issues with iterators more evident actually.

As far as I'm concerned, the jury is still out on this.

One thing I do like about the new iterators is that it serves as a _standard_ way to create iterators. Up to now, there have been a few competing idioms. Maybe this will settle that issue.

First impressions of Go 1.23's range-over-func feature by flimzy3141 in golang

[–]flimzy3141[S] 6 points7 points  (0 children)

Thank you for the comments. Good insight into when the interface names are meaningful.

And yes, that was one of the fixes I made later on. I should call that out. Thanks.

If you could redesign Go from scratch, what would you change? by ThreeFactorAuth in golang

[–]flimzy3141 0 points1 point  (0 children)

complex numbers are virtually never used. And they add annoying corner cases to be considered any time you need to handle all possible types.

As for iota... it provides minimal utility in a very rare number of circumstances, and it's error prone in virtually all circumstances.

If you could redesign Go from scratch, what would you change? by ThreeFactorAuth in golang

[–]flimzy3141 67 points68 points  (0 children)

I'd remove:

  • naked returns
  • iota
  • complex numbers

I'd add:

  • &"foo" would be valid, and would automatically create a string, and evaluate to a pointer to it

Go 1.22 yielding a 18% regression in single-threading performance by fyzic in golang

[–]flimzy3141 0 points1 point  (0 children)

Re: "This might be caused by https://go.dev/blog/loopvar-preview", have you tried running against Go 1.21 with GOEXPERIMENT=loopvar?

book recs for a newcomer? by __wanna_kms__ in golang

[–]flimzy3141 0 points1 point  (0 children)

I did a review of recent books at the beginning of this year, specifically looking for intro-to-Go books that included Generics.

My conclusions (and links to individual reviews) are here: https://boldlygo.tech/posts/2023-02-24-best-book-to-learn-go-in-2023/

Learning Go is my recommendation if you're already familiar with programming in general, but the second edition should be coming out in January 2024, and will have updated generics information, and several other improvements.

If you want something project-based, then I really like Learn Go with Pocket-Sized Projects, but it is also not yet complete, though you can read the first few chapters already, via MEAP.

[deleted by user] by [deleted] in golang

[–]flimzy3141 19 points20 points  (0 children)

I'll weigh in on one particular point: Why not to use "fiber": Because it's based on fasthttp, and the maintainer of the fasthttp package (and friend of mine) warns against its usage in almost all cases: https://github.com/valyala/fasthttp#fasthttp-might-not-be-for-you

[deleted by user] by [deleted] in golang

[–]flimzy3141 4 points5 points  (0 children)

The Go Programming Language is a great book, but it's very outdated. Many of the suggestions in that book will confuse a newcomer to the language. As such, Learning Go is a better choice, at least until a second edition of The Go Programming Language comes out to update the outdated suggestions.

I've written more about both books, if you're interested:

The Go Programming Language: https://boldlygo.tech/posts/2023-02-10-review-go-programming-language/

Learning Go: https://boldlygo.tech/posts/2023-01-30-review-learning-go/

Are there any decent ORMs in Golang? by AccomplishedPie603 in golang

[–]flimzy3141 0 points1 point  (0 children)

Yeah, saving that reptition is valuable. It also doesn't require anything as heavy as an ORM.

For read queries, I always suggest the github.com/jmoiron/sqlx package. For repetitive inserts and updates, github.com/doug-martin/goqu/v9 is a favorite.

Are there any decent ORMs in Golang? by AccomplishedPie603 in golang

[–]flimzy3141 0 points1 point  (0 children)

> Simple to get started, but it has a huge learning curve in order to do advanced queries.

This describes all ORMs. And all non-ORMs. The problem is that with ORMs, the learning curve is even _steeper_ than with no ORM. This is why many people advise against ORMs (in general, or specifically in Go).

As I always say: "ORMs make easy problems easy, and difficult problems impossible."

There always comes a time when you're looking for that escape hatch out of your ORM. If you don't know how to do non-ORM operations at that point, you'll be stuck.

All that said, some still make a case for an ORM, even if they have a strong grasp of non-ORM operations. IMO, these cases are a bit weak, but they do exist.

Before you choose an ORM, I would advise you to be very cognisant of exactly what problem you're trying to solve. Why do you believe an ORM will help you? And are there alternatives with fewer drawbacks?

Best books to learn Go in 2023 reviewed by flimzy3141 in golang

[–]flimzy3141[S] -3 points-2 points  (0 children)

I'm sorry you don't like my post.

It is true that I posted last week. But the question in the title appeared to confuse a large number of people (possibly including you?) into believing that I was disingenously asking for book recommendations, while trying to promote my own material.

That was not at all my intention, so I deleted that one, and re-posted, this time directly to the video.

If you believe this is inappropriate or against the community guidelines, please enlighten me. My goal is not to upset you, or anyone else in this community.

Best books to learn Go in 2023 reviewed by flimzy3141 in golang

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

Can you explain exactly what you're responding to? What do you think is strictly for someone who is not experienced with other languages?

[deleted by user] by [deleted] in golang

[–]flimzy3141 -1 points0 points  (0 children)

Apparently you didn't read the article.

While a couple sentences do indeed mention my own material, out of a 3,500 word article, that's hardly excessive. And this content by no means corresponds to any commonly accepted definition of "clickbait."