6 ms·
> your inconsistent error passing has me somewhat confused. That was my first somewhat big program in Go plus coming from Python made a bit of hustle here. I s
by piranha 13y ago
> your inconsistent error passing has me somewhat confused.
That was my first somewhat big program in Go plus coming from Python made a bit of hustle here. I still believe exceptions to be much better than this error-returning. :\ Never learned to do it nicely. :\
> Overall, I'd say Go is an effective language. But not beautiful, or novel in the slightest.
Yes, this is more or less my feelings nowadays. It's good for certain cases and if I ever need something fast, I'll use Go and not C.
> I'm not sure I see the appeal.
There is some. It's still much simpler than C (GC + stricter compiler), plus it has goroutines (not much in this app, though), plus interfaces are really wonderful (you don't need to declare that you implement interface, just implement it and you're done).
- artagnon 13y agoOn C. C has been around for _much_ longer than Go, and a lot of people understand C inside out. The C ecosystem is fantastic: there are extremely good implementations of virtually everything that you can use to build a production-grade application. On Go. It'll take time for a programmer to fully understand how to use a new language, and it'll be a long time before great implementations appear. If the language isn't that much of an improvement, why will an existing C programmer take the effort to learn it? Aren't the returns diminishing? Computers will only get faster, llvm will only improve (tooling + compile time + link time): in that respect, doesn't Go seem a bit short-sighted?
- murkt 13y agoAnd there is a whole lot of people who don't know C inside out and don't want to dive in it. One needs to explicitly manage memory, deal with raw pointers, ugly header files and all that stuff. No interfaces, too.
- genwin 13y agoIn the respect of existing C programmers, maybe. Having myself never mastered C because of its complexity, in a few months part-time effort starting from getting a book on Go I built a sophisticated website. In the respect of non-C programmers, Go is extremely useful.
- agentultra 13y agoC isn't any more difficult to understand, IMO. Obviously Go has the advantage of hindsight and an opportunity to go back on the trade-offs that were made for compiler efficiency before C was standardized. However, at it's core I think C is much more simple than Go and theoretically should be easier to understand. I find GC to be a useful tool but have you ever looked into the implementation of one? Or have you run into a situation where it was necessary to reason about the performance characteristics of a GC in relation to some algorithm or tight main loop? I don't find C's lack of GC any more complex than GC. In fact I find it much more simple. It requires more discipline on the part of the programmer (and perhaps that is where the appeal of a GC comes from). Perhaps it's because I started programming with addressing memory and building up a mental model of how it works and have only encountered GC as a useful addition to my programming toolbox (instead of an always-present assumption). As well, co-routine trampolining (which is what I assume the playful pun go-routines are referring to... please correct me if I am wrong) isn't a very "simple" thing to understand either. At least they are not any more simple than threads so I don't understand how they make learning Go any more easy for non-C programmers (except perhaps exposure to co-routines in a language that already has them like Python). I guess what I am saying is that you could have just as easily mastered as much C in those few months as you did Go.
- to3m 13y agoI believe the goroutines are cooperative, yielded either explicitly or by calling various library functions. So you don't need quite the same sort of locking as you do with preemptively-multitasked threads, and there's also a much larger set of atomic operations. This should make things much easier...
- genwin 13y agoI think some people's intellects are more suited to learning and mastering C, which is great for the development of major products. For general business applications development and websites I think C may be overkill compared to Go. In a test of 2K concurrent users hitting my website on a cheap box, each served a unique page, all users are served fast, so I'm glad that Go is handling GC instead of me. I've done multi-threaded code in C# and find goroutines much simpler. I have goroutines referencing objects created in other goroutines. It seems to do my own GC without becoming too unwieldy I'd have to write something like the generic GC code Go already has built-in. It was nice to not have to think about that at all and still get great performance.