News for hackers. Stuff that matters.
Re:Chad Strings – The Chad way to handle strings in C by me_me_me on Wednesday May 19, 2021 @11:50AM (#27210313)
/s is to show sarcasm, so you might be missing point of my reply

Bitching about lang A > lang B is sign of immaturity. Every language had/has a use and arguing about what is better doesnt get anyone anywhere.

Re:Chad Strings – The Chad way to handle strings in C by quotemstr on Wednesday May 19, 2021 @12:05PM (#27210523)
So it'd be immature to suggest that we shouldn't write new code in BASIC or COBOL? Give me a break. Some language wars are the mark of immaturity, sure. Others are the result of a mature career of dealing with shitty legacy code in a language practically guaranteed to produce it.
Re:Chad Strings – The Chad way to handle strings in C by me_me_me on Wednesday May 19, 2021 @02:04PM (#27212198)
> So it'd be immature to suggest that we shouldn't write new code in BASIC or COBOL?

Its immature to suggest rewriting backend of some bank written in COBOL half a century ago, because Go lang is so much better. That would be a suicide.

No sane person will propose to use COBOL for brand new project.

Again my point is that bashing - modern, in use - languages is stupid thing to do. Current languages are used for a reason. Speed, convenience, libs, support etc.

Going back to C++ vs C. Have a look at Linux kernel written in C++.

Languages are tools, and each tool has its purpose and should be chosen for a purpose.

Re:Chad Strings – The Chad way to handle strings in C by quotemstr on Wednesday May 19, 2021 @06:01PM (#27215092)
And no sane person will propose using C for a new project. It's beyond irresponsible to use a language that's led to endless bugs and security flaws over time. Sure, if you're maintaining a C project, use C. But don't use it in new stuff. It's that bad. It really is. Sorry.

There's no reason to use C: it's not faster, or more convenient, or more amenable to library use than C++. C++ has every single advantage of C and then some. That's just a reality.

And yes, I can and will bash C.

Re:Chad Strings – The Chad way to handle strings in C by me_me_me on Wednesday May 19, 2021 @07:21PM (#27215681)
> But don't use it in new stuff. It's that bad. It really is. Sorry.

Anyone is entitled to live in a their delusions, no need to apologize.

Tell me how are you going to write a driver for you new device your company is shipping? Or write firmware for it?

C is a container ship that carries the world's trade on its back, and you come here trying to sell rockets as new means of transportation. We will see if truck are still here in 30 years :) vs some fad language that is going to be forgotten in next few years.

Re:Chad Strings – The Chad way to handle strings in C by quotemstr on Thursday May 20, 2021 @03:53AM (#27218552)
Your comment doesn't contain any technical details. You don't get anything from writing C instead of C++. What does C let you do that C++ does not?
Re:Chad Strings – The Chad way to handle strings in C by junon on Thursday May 20, 2021 @07:02PM (#27228529)
Verify it.
Re:Chad Strings – The Chad way to handle strings in C by me_me_me on Thursday May 20, 2021 @08:40PM (#27229232)
My voice is my passport. Verify me.
Re:Chad Strings – The Chad way to handle strings in C by hderms on Wednesday May 19, 2021 @10:05PM (#27216548)
It's looking like Rust is here to stay
Re:Chad Strings – The Chad way to handle strings in C by junon on Thursday May 20, 2021 @09:37AM (#27220935)
C can be verified quite easily. C++ cannot. Therefore, it is possible to write code safer than C++, Rust or Go, in C.

But sure, keep spewing your incorrect assertions.

Re:Chad Strings – The Chad way to handle strings in C by quotemstr on Friday May 21, 2021 @01:24AM (#27230785)
> C can be verified quite easily. C++ cannot.

Uh, exactly the same kind of static analysis that applies to C applies just as well to C++. C++ doesn't have a magically different execution model. What do you think std::string is except a few wrapper functions that boil down to the same operations you can do in C?

Re:Chad Strings – The Chad way to handle strings in C by junon on Friday May 21, 2021 @01:47AM (#27230903)
Note the term "easily". C++ verifiers have to understand template types, overloads, etc.

I'm sure we'll get there one day. Frama-C is inching toward it at molasses speeds.

But right now, C is undeniably easier to verify than C++.

Re:Chad Strings – The Chad way to handle strings in C by quotemstr on Friday May 21, 2021 @03:08AM (#27231297)
> C++ verifiers have to understand template types, overloads, etc.

If they operate at some compiler IR level (e.g. LLVM bitcode), the difference between C and C++ verification is nothing. C++ is purely a front-end thing. Why should formal verifiers operate at the AST level?