2 ms·
Doesn't every language have a feature like this these days? If not an official standard, then a commonly used third-party tool. Though embedding unit tests in
by ameliaquining 5y ago
Doesn't every language have a feature like this these days? If not an official standard, then a commonly used third-party tool.
Though embedding unit tests in API documentation is less common; the only other languages I'm aware of that support it out of the box are Python and Rust. A Google search turns up some implementations for other languages, like C++ and Haskell, but I don't know how widely used they are.
Regardless, I definitely agree that it's a very important and useful feature.
- WalterBright 5y agoDOxygen existed for D at the time we developed Ddoc, and some people used it, and so I was constantly asked "Why not just use DOxygen?" The problem with DOxygen was, it wasn't installed automatically! It was extra work to go get it and install it, so it never happened. What a builtin Ddoc does is: 1. It's always installed 2. It's always matched to the current compiler (one never has a mismatched set) 3. It is standardized (code using DocX is not mismatched with other code using DocY) 4. It can take advantage of the compiler's available semantic information 5. Don't have to beg documentation tool vendor to add features we need. For example, Markdown support was recently added. Didn't have to ask or beg. A Ddoc user simply added it These advantages are enormous and transformative. Minimizing friction matters a great deal. C and C++ do not have builtin documentation generators. I ask you, of professional C/C++ code you've seen, how many consistently and properly documented the function interfaces? In my experience, it's rare. It's much more common in D, and that's entirely due to Ddoc.