Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Don't use betterC as a global @nogc attribute. This flag does more than just remove the garbage collector and adds extra checks that can sometimes be overly restrictive. If writing GC-free code is important and compiler assistance is really needed, then add @nogc: at the top of every file. But even that is a bit extreme because the @nogc attribute is just a hint to the compiler, telling it to check that called functions also carry that hint. It is not essential for writing GC-free code.

My library for example is not using the GC, but I don't put @nogc on every function because it does not make sense. Here is the link to the library: https://github.com/Kapendev/joka



> Don't use betterC as a global @nogc attribute.

Well I am not, but thanks.


> Using D in betterC mode is what I am most interested about

Well you will. It's a common mistake new D users do.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: