News for hackers. Stuff that matters.
Re:Zig 0.4.0 Released by otabdeveloper1 on Tuesday April 09, 2019 @04:12AM (#19612702)
> All these languages are potentially-better systems languages than C/C++

No they are not. C++ has spent decades building "a better C/C++". Any language that ignores those lessons and takes the stance of "learning C++ is too hard, let's go shopping" is doomed to fail.

Re:Zig 0.4.0 Released by flohofwoe on Tuesday April 09, 2019 @05:23AM (#19612998)
Apologies for being a bit blunt, but:

<rant> For all the time and work poured into C++, it has remarkably little to show over plain old C99.

Some of those new "better C" languages are the work of individuals and very small teams, yet they are able to build more progressive "better C" languages than C++ can ever be because it is held back by the need for backward compatibility for 'failed features' and 'design-by-committee'.

If all that ever comes out of those small 'better C' languages is some sort of consensus of which core-set of features actually makes a 'better C', than they have already contributed more to programming language development than C++. </rant>

Re:Zig 0.4.0 Released by notacoward on Thursday April 11, 2019 @09:29AM (#19634258)
> For all the time and work poured into C++, it has remarkably little to show over plain old C99.

Exactly. I think of it as a path-finding problem. C was obviously not where people wanted to be. As with any path-finding problem, it's possible to make a wrong turn. Often, attempts to recover without backtracking only make things worse. I contend that C++ has done exactly this. They're at point where a mature, reasonable person would admit their error and backtrack until a better path can be found.

I doubt that many of C++'s critics are arguing from ignorance or afraid of complexity. More often, they're objecting to spurious complexity because they know how to do better. I've written compilers, and they're not even close to being the most complex things I've written. It's not so much "let's go shopping" as "let's return this defective merchandise" and build something that works. It's only the lemmings who insist on rushing further down the wrong path. "Turning around is hard; maybe if I get enough others to come with me they'll break my fall."

Re:Zig 0.4.0 Released by orbifold on Tuesday April 09, 2019 @12:31PM (#19616392)
Without starting a rant myself about people that think C++ has nothing to offer over C, what is in your opinions then the reason for any large company to develop their code in C++ and not C? I'm thinking of virtually all Adobe Products, anything related to the creative industry really, Google, CERN, Microsoft... No-one in their right mind would try to develop Adobe Photoshop in C.
Re:Zig 0.4.0 Released by p0nce on Tuesday April 09, 2019 @05:48AM (#19613082)
Here are some things that make C++ better than C

- RAII

- exceptions

- classes and objects

- inheritance

- templates

- the STL

C++ is strictly better than C when wielded correctly.

Re:Zig 0.4.0 Released by flohofwoe on Tuesday April 09, 2019 @06:01AM (#19613138)
All of those are very subjective.

- RAII: Only useful with 'smart' data which must run code for initialization, destruction or copying. It's entirely valid to work with 'dumb' data only which is zero-initialized, and can be copied and deleted without any additional custom actions.

- Exceptions: too brittle and complex, modern languages have switched mostly to option-return values, which contain both an error code and success-result.

- Classes, objects, inheritance: left-over artefacts from the OOP hype of the 90's

- Templates: Not the only option to write generic code, other languages do this better. Programming entirely without generics isn't too bad either, not all code benefits from this.

- STL: not sure what to say here, it's the main contributor to slow compile times, excessive hidden memory allocation, slow debug performance and bloated executables. There are not many parts of the STL that are 'acceptable', but of course that's entirely subjective.

Re:Zig 0.4.0 Released by p0nce on Tuesday April 09, 2019 @06:48AM (#19613343)
Well you learn to appreciate the value of RAII and exception working on high-availability software. It's almost impossible to have correct error paths and deinitialization without. I'm very doubtful the new crop of languages without exceptions and RAII actually care about correctness in the wild.

Better than template without uniform representation? template is just copy-paste you don't _have_ to use it. Same remark for STL. You want a hashmap of arrays of string, you can have it in C++ in one line. In C you would end up with a linked list instead of picking the right data structure.

Objects and inheritance are not a hype. See this page, which uses CSS, which implements inheritance. Having subtyping is a basic premise of being a useful language (or, a GUI language).

Re:Zig 0.4.0 Released by flohofwoe on Tuesday April 09, 2019 @07:18AM (#19613480)
I've been writing C++ code since around '98, and have only recently moved back to mostly C. To be honest, features in C++ that I thought are a "must have" are actually a variant of Stockholm Syndrome, after a little while (a few weeks to months) one realizes that the world would keep turning without C++ ;)
Re:Zig 0.4.0 Released by p0nce on Wednesday April 10, 2019 @02:14AM (#19622287)
None of my competitors use a language from the 70's.
Re:Zig 0.4.0 Released by tomp on Tuesday April 09, 2019 @08:00AM (#19613703)
> Well you learn to appreciate the value of RAII and exception working on high-availability software.

Alternatively, you'll learn to not appreciate the value of exceptions working on high-availability software. Not personal experience, but AFAIK Google (definitely lots of highly-available software) disallows using exceptions in C++.

Re:Zig 0.4.0 Released by erik_seaberg on Tuesday April 09, 2019 @08:23PM (#19620446)
They have a critical mass of bad legacy code.

> Because most existing C++ code at Google is not prepared to deal with exceptions, it is comparatively difficult to adopt new code that generates exceptions[....] Things would probably be different if we had to do it all over again from scratch. - https://google.github.io/styleguide/cppguide.html#Exceptions

Re:Zig 0.4.0 Released by rafaelvasco on Tuesday April 09, 2019 @04:27PM (#19618618)
"Left-over artifacts from the OOP hype of the 90's". Sorry, but anyone that bashes on OOP can't be taken seriously. There's no problem with OOP, it can be misused of course, but the same is true of any other paradigm. Every programmer with any worth uses OOP, Functional, Data-Oriented, etc, where they are most effective. They are complements to one another not replacements.
Re:Zig 0.4.0 Released by otabdeveloper1 on Tuesday April 09, 2019 @07:57AM (#19613687)
> All of those are very subjective.

They're not. People vastly more experienced and more intelligent than you came up with them. Learn why they exist before dismissing them.

You won't get anywhere trying to replace C with a "let's go shopping instead" mentality.

Re:Zig 0.4.0 Released by moomin on Tuesday April 09, 2019 @04:18AM (#19612734)
Which of these languages do you think hasn’t learned the lessons of C++? Rust, for instance, has liberally encoded “modern C++” whilst plan not providing a lot of the features that make C++ problematic.
Re:Zig 0.4.0 Released by otabdeveloper1 on Tuesday April 09, 2019 @07:59AM (#19613697)
Rust is the better choice, but they're still learning about the real world of error handling, generic library code and performance optimization.