I'm bored...

Pages: 12
Yeah. Don't get me wrong, I am not saying D is bad, just the syntax hangs me up. The only thing I think D does bad that it should drop is the void main() as I do agree with C++ standard that says main should always return something to the OS. The only thing that tainted my taste for D is that I did a 120 lines of code app in it just trying to learn to use it and upon compiling it gave a bunch of errors. Upon checking the errors it was because I had done what I said above, started using C# syntax (which is my biggest hang up now that I think about it). I'm sure I'll eventually try it again, just not planning to jump head first into it again.
The only thing I think D does bad that it should drop is the void main() as I do agree with C++ standard that says main should always return something to the OS.


D also supports int main() if that's what the programmer wants.
void main() is fine for when you don't want to bother with an error code.

Edit: messed up the tags.
Last edited on
Hmm...maybe I will give it a try again, but are there any tutorials that aren't just sections of books trying to get you to buy a book? Most of the tutorials I've found are excerpts trying to get me to buy the D Programming Language book, which I can't afford at this time.

I'm just become accustomed to C/C++ requiring int main() that I'm surprised when I see void main for any language with main. Though I think most languages have an int form that I normally use.
Last edited on by closed account z6A9GNh0
There's a tutorial that is work in progress, translated from Turkish:
http://ddili.org/ders/d.en/

But I think the official site itself is good enough if you're only test-driving D.
http://dlang.org/ctod.html
http://dlang.org/cpptod.html
http://dlang.org/phobos/index.html

One neat thing is that since D supports unittests, you'll find working usage examples inside the library files themselves, if you're feeling adventurous.

1
2
3
4
5
6
7
8
9
10
unittest
{
    string s = " 1.2 3.4 ";
    double x, y, z;
    assert(formattedRead(s, " %s %s %s ", &x, &y, &z) == 2);
    assert(s.empty);
    assert(x == 1.2);
    assert(y == 3.4);
    assert(isnan(z));
}
And now that I think of this carefully, the one good reason why you'd want to avoid D is its lack of stability. The language evolves at a much faster rate than, for instance, C++.

Example: delete is being deprecated, having been replaced by clear() which is garbage-collector friendly.
But now clear() is being renamed to destroy().
And the library is clearly under heavy development, with deprecation warnings all over the place.

So there you go, BHXSpecter, an argument on the house.
Thanks for the links. Yeah, flux in stability is a bad thing, but the more programmers using it the quicker they can make it stable.
Topic archived. No new replies allowed.
Pages: 12