logoalt Hacker News

woadwarrior01today at 12:02 PM7 repliesview on HN

> noCopy is a special marker for types that must not be copied after their first use.

if it looks like a hack, walks like a hack, and quacks like a hack...


Replies

breakingcupstoday at 12:57 PM

I'd want to blame Go's compatibility guarantee for this, but I can't because it wouldn't actually stop them from adding a proper solution for this..

Just like the magic comments, it's a sad thing to see appear in this language because it feels like magic incantations one has to know that bend over backwards to not actually extend the language to fit the use case.

show 1 reply
stevecoalbeartoday at 1:06 PM

Go's full of hacks, and holds no shame over it. Zero-initialized everything, and proceeding to 'defer' instead of RAII, generic builtin types despite lack of generics (until recently), no builtin list type, slices having capacity...

This was Go's design philosophy until Rob Pike left - to do the simple thing simply and not try to be clever about it.

show 4 replies
pjmlptoday at 1:41 PM

The whole Go design philosophy in one sentence, that is what one gets by refusing to adopt modern language practices.

show 1 reply
never_inlinetoday at 12:20 PM

Every language can't be rust.

neilalexandertoday at 12:10 PM

It's not really a hack. It's a hint to a static analyser, that's all.

show 2 replies