3 ms·
Doing @WalterBright's job for a second to let you know that in the D language, given a function that is defined as taking, say, a list as the first argument, it
by lionkor 3y ago
Doing @WalterBright's job for a second to let you know that in the D language, given a function that is defined as taking, say, a list as the first argument, it can be called either
myfun(list)
or
list.myfun()
and this applies without exception. This means a lot of C-library code gets easier to read when used from D:
Vector3 vec = (Vector3){ 1, 2, 3};
Vector3 result = Vector3Add(vec, vec2);
becomes
auto vec = Vector3(1, 2, 3);
auto result = vec.Vector3Add(vec2);
I know its slightly off topic, but I want more people to use D, I really prefer it to C, C++ and Rust.
- tcoff91 3y agoI love D, learned it back in high school, but unfortunately it just seems like D is one of those great languages that just isn't going to take off. It just doesn't have a big enough champion to bootstrap a thriving large community that would make more people want to learn it and more companies adopt it. On its technical merits, one of the best languages out there. It gives you insane performance but is so much easier to learn and write than C++ or Rust.