Why is language documentation still so terrible?
walnut356.github.io
walnut356.github.io
Rust's is pretty good too. I also like Pythons. I agree cppreference is very very bad and unreadable.
Or, at first it seems overly verbose and hard to parse. As you get more familiarized with C++’s semantics though, it feels very useful for covering a lot of ground quickly.
That said, it feels like something that comes time.
The layout could definitely be better, but at least the information density is high. My take is that any attempt at C++ docs just kinda really does need all of the information that cppreference gives you.
I laughed in despair at their operator==,!=,<,<=,>,>=,<=>(std::unique_ptr) picture but the thing is, C++ is just kinda like that, and I don't think any other way of organizing that information would be clearer.
Same content, better search.
I'll expand by saying I think there's two types of documentation: references and guides. cppreference is a really, really good reference. It's complete, highly specific, and well formatted.
But it's an awful guide. If I was trying to learn C++ or it's standard lib, I would want to kill myself.
The problem is these two types of documentation are almost perfectly perpendicular in my mind. Meaning, a good guide is a poor reference, and a good reference is a poor guide.
Hand-holding step by step instructions, popular with many js frameworks now, are great guides. But when I want to know what function X returns and under what circumstances, I don't want to prune through a guide that starts at the beginning of the universe. And often those guides will be missing huge amounts of detail to lower the complexity.
So you need one kind of documentation when you start, and then another 5 years later.
MDN covers a vast range of subjects and knowledge levels but is most laborious to maintain and I have seen some gaps due to that.
Rust is also similar in those aspects, but has different "documentations" that don't fully interconnect to each other yet. Rustdoc's automatic nature is great to have a complete and working documentation, but also means that API documentations are often weaker than those of MDN as the documentation should be embedded into the source code. Python has the same issues and also inconsistencies due to the lack of language-wide automatic documentation system (Sphinx autodoc is close but still annoying).
Cppreference (perhaps not intentionally) covers only higher knowledge levels and absolutely standard matters. It is of course very clear that you can't really use cppreference for learning C++ from scratch, but it is well written as long as you fit with those assumptions and its writing quality is comparable to MDN in my opinion.
Rust has a good documentation but the general lack of such manipulation makes it often hard to navigate. For example `Vec` [1] has a lot of inherent methods with two separate orderings, where one is alphabetical in the sidebar and another is the declaration order, but none of them are actually logical and will benefit from reordering in general. Of course Rust folks are aware of this issue and have put a lengthy introduction with most important methods for each category, but that's less flexible and prone to future updates.
[1] https://doc.rust-lang.org/stable/std/vec/struct.Vec.html
It's worth noting there is no good C documentation in one place, either.
Python dumped the book quickly and went online, but that was probably more for the publisher not being interested in releasing new versions every time something changed. It's also a little younger, but still appeared before the widespread use of broadband internet.
I think Perl was probably the first one to make documentation a real first class citizen, with perhaps Emacs shining a light in that direction.
Link: https://kagi.com/search?q=python+float&r=us&sh=cDUw0QAZf3DUs...
At first the author complains about bad search implementations on the documentation sites and then judges Python by the bad google results.
* writing
* super high empathy
* a deep understanding of the language in both substance and form
* persistence and adversity through a challenging effort
Most developers I have worked with the in past struggle in all those bullet points except possibly that last one. Everybody in software likes to think they are awesome, but tell them to write an essay or formal documentation and that confidence is immediately shattered.
This is what you need when writing documentation covering...
1. Where should someone new to the codebase start? Literally, which line in which file?
2. How does the code "fit together"? What is the call-graph of its top use-cases?
3. What are its compile-time and run-time dependencies? Which exact versions of those dependencies were used during development?
4. When something isn't working, how can someone replicate your development environment EXACTLY in order to determine what's different about theirs?
5. How would you approach debugging on this codebase? A detailed write-up or even a video of every step you took could help someone new gain a deep understanding quickly.
For those unaware, you can submit example suggestions for functions in PHP. The majority are being down voted for being garbage.
The massive amount of garbage and the downvoting wasn't a thing then.
They came when the Internet got populated by normies.
StackOverflow stopped being a fun place to be, too.
It's all I needed to learn web dev.
Sometimes the comments are all screaming about how bad the doc is, then all give an inconsistent variant of the truth.
I haven't touched php in forever, but I imagine that the spammers and idiots would ruin that feature.
When started using Python, oh man, I immediately noticed how much time I wasted because of the horribly structured all over the place docs.
Google also has some of the worst documentation, like on browser extensions.
When I look up a class, I can't see all of its methods on a single page because it doesn't show methods inherited by the Protocols it conforms to.
Also, Apple's license for the documentation means that sites like devdocs can't put the docs on their website in a better format.
If you're not on macOS and just searching open source Swift docs, try swiftpackageindex.org and swiftinit.org. Swift Init especially has fast rendering and better search, though ultimately is based off the same inline docs as Apple's.
Re: "introductional/topical contents", this is what package-info.java files are for.
Yes.
> What about finding all symbols in a package?
I do not know what exactly you mean here, but I look for stuff like "all methods" or "implementations" in IDE.
> I use inline IDE documentation a lot but still also use the online or offline copy of the HTML reference manual.
I literally never ever use offline copy of the HTML manual nor need a need for it. I use online copy when google lands me there - but typically I then find the same thing in IDE, because then I see also a source code and have generally great experience.
To me, having to read manual online is a fail of documentation.
Exploration, though, not so much. But you have is "object." and then read the methods and properties. It's not awful, but if you don't know the object first you can't do it.
I would highly suggest using javadoc before something like SO when you are confused about how to use a class. The vast majority of SO's java help is frozen in time due to SO's 'no duplicate questions' policy. Java has improved a lot since java 7.
They’re like the Americans of tech. Truly.
Having said that, it's worth asking if some of these asks are orthogonal to each other. For example:
>That page must contain (not link to) every method, and the descriptions of those methods, that can be called by that class, preferably including all inherited functions.
>That page must be as uncluttered as possible
"Including all inherited functions" is a pretty deep stack pretty quickly in a lot of languages. I'm entirely willing to acknowledge that maybe that means the page being "as uncluttered as possible" is to be read in the same vein as "the design should be as simple as possible, _and no simpler_".
>Seriously, cppreference straight up taking you to duckduckgo when using the search box is fucked.
In this case, we're seeing the tension between "The official docs should be great" and "I've mistaken a community project for the official docs" (cf. https://en.cppreference.com/w/Cppreference:FAQ the question "Who is behind this site?")
This sort of conversation naturally invites the more subtle conversations around who funds/maintains open/libre projects and whether those in the community who aren't actively working to improve the situation should follow ESR's wonderful advice, "Every good work of software starts by scratching a developer's personal itch."
What official documentation? The standards? C and C++ are weird languages from a modern perspective, and that includes their cultures: They don't have a single blessed implementation, they have a standards body and a community. The standards body issues standards, the community does everything else. Both C and C++ come from a time when all "serious" languages worked like that. Yes, even BASIC. There's an ANSI standard for BASIC.
It would be great if the FSF and/or the LLVM people wrote documentation for C and C++ and it would be even better if they collaborated on it. But it would be no more "official" than cppreference is, because they don't write the standards.
The standard is what the committee publishes, yeah. For C++ it's https://www.iso.org/standard/79358.html ; I didn't look up the corresponding C one, but I have a friend (hi, Kate!) who maintains a C compiler who's pretty comfortable with the latest standard. The standard is the official documentation.
There's drawbacks having whitepaper standards that cost money, but this is what those languages have.
For what it's worth, it used to bug me that part of the standard is that there's intentionally undefined behaviour, but I went to BoostCon and heard some of the standard body talk and they impressed me as being thoughtful about leaving areas for implementers to innovate specific optimisations, so as not to restrict the potential of the community.
If I'm reading you right we agree that there's a difference between the standard and the implementation that's practical and real, but I'm not certain there's much to be done about that.
cppreference is best used for the normal workflow:
Search with Google, instantly find the correct page among the first 10 results, go there, skim the page, find what you need.
cppreference is more like man pages. You slowly build up your own mental map rather than having a structure enforced on you by hyperlinks and a directory hierarchy.
I find this model superior.
But these days you can ask AI chat, so it’s not a big deal.
Yesterday I asked chatGPT about OnceCell. It said "SyncOnceCell<T> in Rust is the thread-safe version of OnceCell<T>". This is incorrect, the thread safe version is OnceLock.
When confronted with this it went on to say "What I was actually referring to is OnceCell<T>, which is thread-safe when used as a static/global value" which is also not true.
C# documentation is pretty decent, exhaustive and comprehensive. How would you even "improve" table of contents anyway? It just says what a type has. You can't add/remove much from it. Are they really complaining that a website they haven't used much is different to a website they have used a lot?
There are plenty examples of bad documentation but for simple type info navigation all C#, Go and C++ are totally fine - I only had to peruse the C++ one for example and found everything quickly and in sufficiently great detail (it did not help with abrasive nature of the language for general purpose coding but I digress). It's the additional information/context that is often lacking. Moreover in C# you can use your IDE or a VS Code plugin to see all types present in a namespace or a package. Most of the time, their type and method names are self-descriptive - what matters more is hand-written guidance to using the library the right way, which is extremely hit and miss with numerous Rust crates.
I think the author just wanted to make a complaint for its own sake and is not looking at documentation from perspective of being productive with a particular language.
See the Rust example at the top of the post.
The only part I don’t agree with is the author’s assessment of SEO. Search algorithms aren’t handed down by God on stone tablets. Google decides how to rank search results. They can figure out how to give sane results for common programming language queries.
Extra quirks and edge cases are just comments in the implementation code.
In my opinion that's exactly how it should be. The documentation should be as close to the codebase as possible to avoid redundancies and an out of date documentation.
Only the go documentation proxies are a little messed up, see sourcehut blog posts about it. But the huge advantage is that you can selfhost them and create your own automated documentation base for your company, for example.
Though it's been a year since I was dabbling with Rust, I had a hard time finding specific functions/methods in different crate docs. For example tokio_tungstenite::accept_async returns a WebSocketStream<S> and a lot of the code snippet examples show use of a split() method, but I couldn't find it in the docs or any examples.
Go shows prominent examples for almost all things in stdlib, but couldn't say the same for Rust.
Just today we were talking about how dull and overtly technical AWS documentation, and how Amazon Q is justified in it’s existence just to make the eye-bleeding-like experience of configuring a policy slightly more tolerable.
If you want just-terribly-awful-embarrassing documentation, just try doing anything in the KDE Plasma stack without a search engine. Try building a kirigami app and looking up class definitions. The easiest path is to install the Kirigami Gallery app and click on the examples of what you want, which opens a web browser to the source code of the app. Written in QML resembling the jQuery mega scripts of yesteryear.
If I have to switch to my web browser there's a reasonable chance I get distracted.
[0]: https://pubs.opengroup.org/onlinepubs/9799919799/functions/o...
At least, this website lets you switch to a light theme. But if you do, inline code fragments still use a background color from the dark theme, which makes them practically unreadable. Looks like the author doesn't care about people who prefer a light theme. Then why they complain about websites made by people who don't care about people who prefer a dark theme?
And when viewed from that lens you can see how off-putting it is when it’s a paid feature, or only adjustable when logged in, or a user-setting that seemingly always defaults to light.
But if you only blah blah, blah blah blah blah <optionname> blah blah blah, blah blah, blah blah blah <value1> blah, blah blah blah blah blah blah <value3> blah blah <value1> blah blah, then screw your manual and you too.
Also, “documentation” in README.md and in markdown in general. The laziest form, especially unreadable on 4+ level headers which are indistinguishable from just text.
Still supported in .net 8. Windows only though.
Beyond that, I have not bothered.
dotnet new --install Avalonia.Templates
dotnet new avalonia.app
dotnet run
Will work on any platform.GUI might be special a case because there are so many flavors of it, and half of them are abandoned dead-ends.
For the love of god, before thinking about that be sure that at least a version of the site loads on any device.
On developer.android.com many pages are impossible to open on lower-end phones.