News for hackers. Stuff that matters.
Re:The ups and downs of porting 50k lines of C++ to Go (2015) by jonahx on Thursday March 14, 2019 @01:28AM (#19386724)
Claiming that Go should excels in readability or ergonomics is pure, Koolaid fever-dream delusion.

Is it cleaner than C/C++? Sure. It's still a painfully verbose language full of boilerplate and with zero concern for expressivity or the suppression of detail [0].

Which isn't to say it's overall a bad language. It prioritizes other things over readability -- like speed, enforcing consistency, keeping its primitive set small.

[0]: https://golang.org/doc/faq#Does_Go_have_a_ternary_form

(no further evidence is needed)

Re:The ups and downs of porting 50k lines of C++ to Go (2015) by bnolsen on Thursday March 14, 2019 @09:50AM (#19389179)
Speed of compilation, not necessarily speed of compiled code. Missing generics: deadly. Passing around just interfaces? At times clearly not sufficient. Their idea of closures? Looks messy to me. Having a special syntax just for threading stuff? Totally beyond lame!

Golang is absolutely not a replacement for c or c++. It's a better replacement for the other languages out there requiring a VM to run anything. In short golang is better at cross platform than these other platforms and is IMHO good for writing good tooling. One of my colleagues said that golang now is sort of like java was in the old, old days. Making the same mistakes and needing necessary features added to become truly productive.

In my opinion ternary stuff is short handed eye candy and not a great reason to discount a language.

c++'s collections and <algorithm> fundamentally and utterly thrash anything golang claims to have, not to mention the whole stupidity around building garbage collection into a language that wants to be low level.

Re:The ups and downs of porting 50k lines of C++ to Go (2015) by jonahx on Thursday March 14, 2019 @10:54AM (#19389742)
> In my opinion ternary stuff is short handed eye candy

Granted

> not a great reason to discount a language

The ternary quote exemplifies an attitude at the heart of the language designer's priorities. That is, the lack of ternary is, in fact, much more than a lack of ternary.

Re:The ups and downs of porting 50k lines of C++ to Go (2015) by fwip on Thursday March 14, 2019 @11:06AM (#19389863)
> special syntax for threading

You mean the word go?

Re:The ups and downs of porting 50k lines of C++ to Go (2015) by jknoepfler on Thursday March 14, 2019 @12:06PM (#19390527)
coroutines aren't threads, fwiw
Re:The ups and downs of porting 50k lines of C++ to Go (2015) by networkimprov on Thursday March 14, 2019 @02:26AM (#19386906)
The main rationale for the lack of ternary, "We don't do control flow with symbols" should also disallow this:

    t && a() || b()
Admittedly tho, nested ternaries are tedious to parse by eye.
Re:The ups and downs of porting 50k lines of C++ to Go (2015) by simonask on Thursday March 14, 2019 @06:50AM (#19388047)
They're nothing against nested applications of the above, though. :-)

    t && a() || (u && b() || c())
Personally, I enjoy Rust's choice of letting `if` be an expression.
Re:The ups and downs of porting 50k lines of C++ to Go (2015) by paulddraper on Thursday March 14, 2019 @02:34PM (#19392046)
> I enjoy Rust's choice

As a Scala user, I agree it really is the best

   val a = if (t) a() else b()