logoalt Hacker News

umanwizard11/09/20242 repliesview on HN

No, the vast majority of people who use go are using it in situations where Java or Python would have been appropriate, not C.


Replies

grey-area11/11/2024

To say a better C means it is clearly influenced by C, not that it was intended to replace C in all contexts, but that it's a compiled language in the C tradition which extends C idioms/syntax, adds a good standard library, better strings etc without losing the simplicity which made C attractive.

Just as C++ intended to improve C but went in a very different direction and added a lot more. Crucially, it doesn't add inheritance as C++/Java did, which I think is an interesting choice which I find quite pleasing and avoids a lot of horrible architectural decisions and vast inheritance trees.

There are certainly lots of bits I would change having used it a while, but I find it quite useful to work in and far more like C than say Java, Ruby or Python which it has supplanted more than usage of actual C. Not sure one of the goals was to supplant C usage and that was not at all what I meant to imply.

show 1 reply
randomdata11/11/2024

> people who use go are using it in situations where [...] Python would have been appropriate

I'm not so sure about that. Python is a DSL for connecting C functions together. Whereas the biggest criticism of Go (gc, at least, but fair to say it has become synonymous with Go) is around its poor C-interop.

In fact, because of that limitation, Go has developed a bit of a "rewrite those C functions in Go" attitude. While that doesn't indicate that Go is a better C (that's subjective anyway), it does indicate that they are found on the same playground. You're probably not going to rewrite Linux in Go, which might be what you are grasping at, but that's not where C ends. Not even close.

You may have a point about Java. Griesemer was a founding member, after all.