Spyke

Posts

Why is it x.* but not x.& ?

I'm currently learning the language, and I was wondering about this design quirk.

Basically, if we have a variable x which is a pointer, we use x.* to get the value. This is much better than using * as a prefix, since the * might need to be applied to anything in the chain for complex access. I see the usecase.

For example something like

(*(*pointer_to_struct).struct_field_ptr).struct_field

is much more clearly written as

pointer_to_struct.*.struct_field_ptr.*.struct_field

But then it feels really inconsistent that we don't do the same for taking a reference with &. Sure, we only ever take one reference of the entire value, so we don't have the same problem as above, but:

We still have the issue that the & is not next to the value being dereferenced:

&some_ptr.*.some_array_struct_field[5].target

this takes the address of the target struct field, which is on the opposite side of the expression.

It also just feels inconsistent.

Additionally, I think the type declaration for a pointer should be &u8, not *u8. Since the & character is semantically equivalent to "address of", and * is more like "value at address".

Thoughts?

View original on discuss.tchncs.de
linux_gaming·Linux GamingbyPotatoesFall

What headsets are linux gamers using?

cross-posted from: https://discuss.tchncs.de/post/55388559

I made the mistake of believing some dumb guide online that recommended the Razer BlackShark v2 Pro for Linux. Literally the volume control is broken out of the box lol.

I just want a wireless headset. For listening to audio. And a mic. Don't care for fancy features. Apparently too much to ask for a linux user.

What are y'all using and how is it working for you?

View original on discuss.tchncs.de

Good NAS solution for dummies / apple users?

My parents are looking into getting their own NAS to replace iCloud. I don't really have much experience with that, and zero experience with apple stuff. They are also not very techy, but at least enthusiastic.

Can sombody recommend easy NAS products where you basically just buy a device, do some basic setup, and then it functions as your at-home cloud? I don't want to get roped into doing too much admin for them, but they do already have DDNS for some other smart home crap. Bonus if it's non-US tech.

Personally I run a nextcloud server on a VPS that I could expand, that's not quite selfhosted, I don't know if that integrates well with apple though, are they better off if I just onboard them onto that?

Cheers in advance

View original on discuss.tchncs.de