Thread overview
What are the advantages of using betterC?
Jan 19, 2021
Rempas
Jan 19, 2021
Adam D. Ruppe
Jan 19, 2021
Rempas
Jan 19, 2021
Imperatorn
Jan 19, 2021
Adam D. Ruppe
Jan 19, 2021
Rempas
January 19, 2021
Sorry if that's a stupid question but I've read [this](https://dlang.org/spec/betterc.html) post that talks about betterC but I didn't understand where betterC is being used and what are the advantages it gives. Can anyone help me out with this?
January 19, 2021
betterC is a niche restricted feature set. If you don't already have a use case in mind, I'd recommend avoiding it.

It is for cases where you're stuck with certain limitations to integrate with the outside world. Like running on peculiar hardware or interoperating with certain outside programs where you can't initialize the runtime properly (and even then, you might be better off going with a custom minimal runtime over the betterC prepackaged restrictions).

Some libraries try to be compatible with it so they can be used in those special cases too, but you probably don't need it.
January 19, 2021
On Tuesday, 19 January 2021 at 17:40:52 UTC, Adam D. Ruppe wrote:
> betterC is a niche restricted feature set. If you don't already have a use case in mind, I'd recommend avoiding it.
>
> It is for cases where you're stuck with certain limitations to integrate with the outside world. Like running on peculiar hardware or interoperating with certain outside programs where you can't initialize the runtime properly (and even then, you might be better off going with a custom minimal runtime over the betterC prepackaged restrictions).
>
> Some libraries try to be compatible with it so they can be used in those special cases too, but you probably don't need it.

Oh ok! So there is not advantage from using it like faster compile time, better performance etc. right?
January 19, 2021
On Tuesday, 19 January 2021 at 17:44:03 UTC, Rempas wrote:
> On Tuesday, 19 January 2021 at 17:40:52 UTC, Adam D. Ruppe wrote:
>> betterC is a niche restricted feature set. If you don't already have a use case in mind, I'd recommend avoiding it.
>>
>> It is for cases where you're stuck with certain limitations to integrate with the outside world. Like running on peculiar hardware or interoperating with certain outside programs where you can't initialize the runtime properly (and even then, you might be better off going with a custom minimal runtime over the betterC prepackaged restrictions).
>>
>> Some libraries try to be compatible with it so they can be used in those special cases too, but you probably don't need it.
>
> Oh ok! So there is not advantage from using it like faster compile time, better performance etc. right?

Not really
January 19, 2021
On Tuesday, 19 January 2021 at 17:44:03 UTC, Rempas wrote:
> Oh ok! So there is not advantage from using it like faster compile time, better performance etc. right?

The default betterC build will compile about a quarter second faster than the default normal D build, but runtime performance is always the same, and you can get that quicker build with normal D too if you customize your build a little.

And besides a quarter second is prolly worth it to use full D...
January 19, 2021
On Tuesday, 19 January 2021 at 18:04:42 UTC, Adam D. Ruppe wrote:
> On Tuesday, 19 January 2021 at 17:44:03 UTC, Rempas wrote:
>> Oh ok! So there is not advantage from using it like faster compile time, better performance etc. right?
>
> The default betterC build will compile about a quarter second faster than the default normal D build, but runtime performance is always the same, and you can get that quicker build with normal D too if you customize your build a little.
>
> And besides a quarter second is prolly worth it to use full D...

Totally agree! It doesn't worth it! Thanks a lot for the info man!