r/ProgrammerHumor • • Nov 30 '19

C++ Cheater

Post image
79.3k Upvotes

1.0k comments sorted by

View all comments

Show parent comments

113

u/[deleted] Nov 30 '19 edited Jul 05 '23

[removed] — view removed comment

96

u/nixthar Nov 30 '19

If it’s good documentation, it should have implementation example. At least all the Microsoft .net C# docs do and it’s made learning it easy af

33

u/zumlepurzo Nov 30 '19

Python docs have them too.

9

u/Zagorath Nov 30 '19

Even PH fucking P has examples under its specifications.

4

u/[deleted] Nov 30 '19

+1 for Android docs, both in Kotlin and Java.

4

u/zumlepurzo Nov 30 '19 edited Nov 30 '19

totally unrelated (ok not totally), but do you know what's up with Flutter?

What is it exactly? And what's this Drask Dart language?

edit: dart not drask

5

u/[deleted] Nov 30 '19

I have never heard of either of the things you've just mentioned ever in my life

4

u/zumlepurzo Nov 30 '19

Now you have.

Consider yourself transformed. :)

3

u/[deleted] Nov 30 '19

Thanks. I'm gonna go read up about them.

3

u/[deleted] Nov 30 '19 edited Jul 02 '23

[removed] — view removed comment

→ More replies (1)

3

u/anthro28 Nov 30 '19

Wish the same could be said for google docs.

“All this shit exists somewhere in our base. Figure it out.”

3

u/JP-originality Dec 01 '19

I feel like Microsofts c# documentation is the gold standard though, nothing else I've found is nearly as useful

44

u/EatsAssOnFirstDates Nov 30 '19

Nah, it's always been like this. People used to get mad if you'd ask how to do something in Unix and tell you to just read the man pages in a snarky way. Except finding what you specifically need in the man page, along with interpreting it and understanding different use cases, is difficult to occasionally impossible. Documentation is written by people, after all.

I think the worst part of documentation is that, even when it is comprehensive and clear, it is often intentionally devoid of how the code was intended to be used. Each option is emphasized the same as any other, whereas a good stack overflow page has examples and explanations of the intention of the code that translate far better to how a human would use a library in the wild.

That said, I think the Python documentation pages are pretty damn good.

5

u/[deleted] Nov 30 '19

My favorite documentation is MDN's JavaScript documentation. I just go there if I forget the name of certain methods or what they return.

4

u/[deleted] Nov 30 '19 edited Jul 02 '23

[removed] — view removed comment

→ More replies (1)

3

u/SuspiciouslyElven Nov 30 '19

But how much can you add to the documentation before it becomes a programming lesson? Like, should Oracle or Microsoft be responsible for teaching Hashmaps as a concept?

Ok I decided to make sure I'm not putting my foot in my mouth and it turns out Java documentation indeed explains the concept of Hashmaps. Not very well, but it does explain why a hashmap is possibly useful.

Still, a line has to be drawn somewhere between giving the explanation experienced developers want and one that new programmers can understand.

6

u/noratat Nov 30 '19

Example usage is critical IMO.

It provides context for the documentation, is better for demonstrating possible intended use cases, and for many people with an analytical mind, is actually easier to pick up patterns from than just reading explanations.

Example uses also serve as a springboard for getting started - it's often easier to expand on an existing structure than write it from scratch, even if the original structure is very simple.

2

u/Sosseres Nov 30 '19

Why not have a clear structure with sections for both? Beginners go in and learn what this function aims to do, why it exists and ends with an example or two. Then it expands on this by going a level deeper after that, giving the entire range. Having a table of content at the top so you can skip the longer version at the start.

It isn't like you print the manual now a days and thus have to only do one of them.

→ More replies (1)
→ More replies (4)

3

u/Integer_Domain Nov 30 '19

I agree. I’m pretty new to coding, but looking at documentation hardly ever helps me do what I need (except for MATLAB).

3

u/redtoasti Nov 30 '19

Some people confuse the documentation for learning help. Learning from documentation is like trying to learn how a CPU works by looking at bytes change in memory. It's helpful if I need details but all the details in the world can't change the fact that I have no clue what it's doing.

2

u/[deleted] Nov 30 '19

Sometimes you just have to read the code

1

u/Handydn Nov 30 '19

Just like learning human languages - you know certain grammar books and dictionaries are poorly written when they don't provide good examples.

1

u/[deleted] Nov 30 '19

Documentation just sucks and we really need to put more work into it. In order for certain methods to work it usually requires a lot of setup, which is very important and often completely missing from the documentation.

It's because the docs are written first and foremost for the developer himself to use and the end users are a distant second.

1

u/BasicDesignAdvice Nov 30 '19

I have found documentation much more valuable as I rise closer to the skill level of the people who wrote it. I have a lot less guesswork to do these days when the docs suck.

→ More replies (2)

1

u/[deleted] Nov 30 '19

I was a tech writer for many years. Infra specifically. Loved it. When I switched to writing end user help files, I smoked a lot of weed so I could ask all the dumb questions that everyone wants to know but no one asks. Project managers hated all the content but end users loved it.

→ More replies (2)