News for hackers. Stuff that matters.
Re:Better C – A subset of D Programming Language by arunc on Tuesday April 28, 2020 @01:09PM (#23009129)
For me the single best feature that stands out in D is the uniform member access using dot.

- Want to access member in a aggregate (class/struct)? Use .

- Want to access member in pointer to an aggregate? Use .

- Want to access member in a module? Use .

- Want to access reference (not free standing)? Use .

This makes switching between different implementations pretty easy. Coupled with UFCS, this is pretty fantastic!

Re:Better C – A subset of D Programming Language by jane_red on Tuesday April 28, 2020 @05:05PM (#23012015)
I can strongly relate to that. You can write a custom "fill" method for your array and just do "arrray.fill", bam! It just works. You want numpy "zeros"?

Just do a template

void zeros(T)(ref T arr) { arr.each!"a = 0"; }

someArr.zeros;