Hacker Newsnew | past | comments | ask | show | jobs | submit | cabirum's commentslogin

> Using empty structs also hurts readability

An empty struct is idiomatic and expected to be used in a Set type. When/if the memory optimization is reintroduced, no code change will be needed to take advantage of it.


Using a bool instead of empty struct also means that there is more way to use it wrong: check the bool instead of if the key exist, set the bool incorrectly, etc...

I would argue using bool hurts readability more.

Even better write/use a simple library that calls things that are sets `Set`.


I could've sworn we got "sets" in the Go's standard library along with the "maps" module but... apparently not? Huh.

Almost made it into 1.18 but looks like it doesn't add enough value and has some open questions like what to use for a backing data type and what complexity promises to make.

https://github.com/golang/go/discussions/47331


Honestly insane in 2025 to not have a generic Set.


I also feel like map[T]struct{} communicates its purpose way better than map[T]bool. When I see a bool I expect it to represent a bit of information, I don't see why using it as a placeholder for "nothing" would be more readable than a type that can literally store nothing.

Isn't it empty interface that's idiomatic? Or was anyway?

edit: I may be wrong here


MIPI camera on my 3 year old Thinkpad still does not work


In 2025, is it still prohibively expensive to run some community-supported crawler & search engine? Without Google censorship, ads, and ai.


Based on marginalia's work I would say no, but maybe you're thinking of a different scale than they work at.


What if.. the management made a request to make the game take more space than the previous release? So everyone could see just how much content there is and how much better everything is.

I mean, the developers cannot be that incompetent while being able to ship a high quality product.


Instead of "-X POST" and "-H 'Content-Type: application/json'", use "-d" or "--json", asshat.


Pathetic posturing.

With an access badge, at least you can leak something important anonymously.


> With an access badge, at least you can leak something important anonymously

You think generals leak to journalists at press conferences?


Quantum computing does not exist. The industry with it's 30 year history since Shor algorithm boasts its crown achievement of factoring the mind-blowing N=35 and creatively inflated qubit counts.


If it could exist during our lifetime, assuming the capture and storage of encrypted message streams is trivial to well resourced threat actors (nation states), if the cost is reasonable to implement quantum mitigations it is reasonable and prudent from a risk management perspective to do so.

The worst case scenario is nation states consuming and storing these encrypted message streams, and suddenly achieving the ability to rapidly decrypt everything previously captured and stored a la "No more secrets."


Doesn't mean that it won't exist in the future (I'm not sure if this was meant to be negative towards Signals efforts here)


Yeah let's only start work once it's too late. That'll teach em!


amen


Hx is batteries included. Nvim requires installing lots of plugins that do not inspire confidence - descriptions ridden with emojis, impossible to know who maintains what. Too many vectors leading to possible compromise.


Hn shows this story is 3 hours old, yet your GitHub PR was made 2 days ago, linking here?


The story has been reposted to HN via the “second-chance pool”, which resets the dates.

https://news.ycombinator.com/item?id=26998308


> but goroutine B (the goroutineB function) apparently never ran at all.

Untrue. Up the iterations to 1000, you'll get your interleaving. Since 1.14, goroutines are async preemptible (async safe points), and will not block the scheduler. Also, time.Sleep bad, use runtime.Gosched().


time.Sleep bad? Grug no understand.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: