News for hackers. Stuff that matters.
Re:Orthodox C++ by 37ef_ced3 on Sunday December 27, 2020 @07:22PM (#25555457)
I just use Go (golang) instead, whenever I can

Go can be understood as an improved C that keeps much of C's simplicity but adds small, powerful features like interfaces and channels and garbage collection

Go fixes C's well-understood flaws (declaration resembling use, unintuitive operator precedence, unrestricted address math, silent casting, zero-terminated strings, etc.)

Go puts essential C idioms directly into the language (pointer/length is formalized as slices, packages are part of the language instead of just being naming convention, etc.)

The longer I used C++, the more I despised it. I used C++ for 11 years and I literally hate the language. But C has always remained a pleasure, and Go is a continuation/modernization/enhancement of that

Go is mature, stable, widely-used, well-supported, well-understood, etc., so it's fully mainstream

If you like C, you will love Go

Re:Orthodox C++ by srockets on Sunday December 27, 2020 @08:08PM (#25555767)
Like the OP approved subset of C++, the design of Go is anachronistic on purpose, and makes a point to ignore most of what we have learned about programming language design since the 1990s.

Go goes further and puts the blame on its users, who are “not capable of understanding a brilliant language […] the language that we give them has to be easy for them to understand and easy to adopt”[0].

This stands in a stark contrast to one of C++'s design principles, namely that the language shouldn't “force people to use a specific programming style”[1]. C++ not being opinionated is not aesthetically pleasing, and at times confusing. But that wide acceptance to new ideas is exactly what allowed those ideas to graduate from niche languages to the mainstream.

--

[0] Rob Pike at Lang.NEXT 2014. 20:52 @ https://channel9.msdn.com/Events/Lang-NEXT/Lang-NEXT-2014/Fr...

[1] Bjarne Stroustrup, pp.3 @ https://stroustrup.com/hopl-almost-final.pdf

Re:Orthodox C++ by 37ef_ced3 on Sunday December 27, 2020 @08:20PM (#25555834)
Go and C (even moreso) are simple languages. Some people understand the reason for (and appreciate) that simplicity

Other people prefer profound language complexity; no comment

Re:Orthodox C++ by erik_seaberg on Sunday December 27, 2020 @08:52PM (#25555989)
When a language ignores a problem in the name of simplicity, every application now needs to choose some idiosyncratic way to solve the same problem without help. Mastering a larger toolbox takes work but it pays off.
Re:Orthodox C++ by pansa2 on Sunday December 27, 2020 @09:18PM (#25556106)
> every application now needs to solve the same problem

Some applications do. Other applications, for which the problem is irrelevant, can now ignore it rather than having the complexity of a solution baked into their foundations.

Re:Orthodox C++ by srockets on Sunday December 27, 2020 @08:43PM (#25555944)
I don't think the motivation behind Go's and C's austerity is the same for both language, so I wouldn't lump them together in the same argument.
Re:Orthodox C++ by 37ef_ced3 on Sunday December 27, 2020 @09:06PM (#25556063)
Go's austerity is an acknowledgement that C's austerity is a net win (as long as you fix some of C's well-understood deficiencies; e.g., you're better off with slices and maps built directly into the language)
Re:Orthodox C++ by elb2020 on Sunday December 27, 2020 @08:57PM (#25556012)
I see you've revised your comment from 3 days ago, where you made the more sweeping statement that "the longer you use C++, the more you despise it".

My experience is that C++ is complex, but it gives you power. I think whether or not you like the complexity of C++ depends very much upon whether or not you _need_ the power that comes with it. If you do not need the power, I can understand your argument that a simpler language is preferable.

Re:Orthodox C++ by pansa2 on Sunday December 27, 2020 @08:05PM (#25555751)
I’ve heard that Go code can make use of libraries written in C++, but that you can’t write libraries in Go and use them from C++. Is that true?

If so, it’s a significant impediment to introducing Go into a team that’s currently using C++ - any Go code would be isolated from the rest of the codebase.

Re:Orthodox C++ by 37ef_ced3 on Sunday December 27, 2020 @08:10PM (#25555784)
Yes, if you're on a team developing a program in C++, everyone should use C++

My condolences

Re:Orthodox C++ by pansa2 on Sunday December 27, 2020 @08:22PM (#25555847)
At least we have Lua, which we can call freely from our C++ application.
Re:Orthodox C++ by Rendello on Sunday December 27, 2020 @07:43PM (#25555602)
Do you have any thoughts on Zig? It's nowhere near stable yet, but it seems like the a promising C replacement, in terms of maintaining simplicity, strict memory control, etc. (speaking as someone who's only worked a few months in C, as a hobby)
Re:Orthodox C++ by 37ef_ced3 on Sunday December 27, 2020 @07:54PM (#25555690)
Go is 13 years old, and it has a huge developer ecosystem

Being practical, I'm not interested in using an experimental language that could be dead/unused/unsupported in 5 years

Re:Orthodox C++ by dvh on Monday December 28, 2020 @02:40AM (#25557481)
But go is Google's project and it will be cancelled.
Re:Orthodox C++ by devnull1 on Sunday December 27, 2020 @08:58PM (#25556019)
agree with you completely
Re:Orthodox C++ by shrimp_emoji on Sunday December 27, 2020 @07:57PM (#25555706)
You misspelled Rust several times in your post here.
Re:Orthodox C++ by 37ef_ced3 on Sunday December 27, 2020 @07:59PM (#25555717)
Rust is too complex. It's not simple like C