r/AskProgramming • • Oct 14 '20

Programmers, who write documentation, why make it soo abstract with little to none explanation and examples? Do you like people suffering?

65 Upvotes

35 comments sorted by

36

u/[deleted] Oct 14 '20

If you write a module or program it it obvious (for us) what to do. It it sometimes hard to image what the “standard” user expects/thinks what to do. For instance in an office at my conpany, MS PowerPoint is used to edit images.....instead of using PhotoShop or Gimp.

14

u/[deleted] Oct 14 '20

MS PowerPoint is used to edit images.....instead of using PhotoShop or Gimp

huh? lol

That explains it. Thanks.

12

u/[deleted] Oct 15 '20

I worked on a project once that had a Technical Writing Guy, from an entirely different department, whose job it was to handle the big picture stuff for the documentation. It worked out pretty well. One problem with writing documentation is not just describing the functionality bit-by-bit, but also telling a story about what the software does. If you just write a blurb about each function, the user won't understand the why, or how it all fits together. Programmers aren't authors. We mostly chose not to go in to creative writing for a reason. We don't want to think about building the narrative.

The reason most projects don't have good documentation is that the company decided not to hire someone to do it.

2

u/[deleted] Oct 15 '20

The reason most projects don't have good documentation is that the company decided not to hire someone to do it.

That also makes sense. Because someone dedicated to creating documentation you end with:

Abstract crappy documentation or like u/NachoBalloney and u/

turtle_dragonfly said, documentation with negative sides.

1

u/0rphon Oct 15 '20

Programmers aren't authors

the exact words i was about to type

1

u/EternityForest Oct 15 '20

It's kind of scary how many projects can't be explained in five minutes. Especially frameworks and tools.

Like, there are many incredibly complicated projects with millions of lines, but they have five minute elevator pitches, or at least one or two of the features do.

A lot of modern stuff is just a "Backend rules engine for IoT" or a "Decentralized application marketplace", and it takes 15 minutes of research to have even a vauge high level overview of what it does.

Like, come on! If you want me to be interested, write at least one example of why I'd use it, and how it fits in to the system it's for.

20

u/turtle_dragonfly Oct 14 '20

Another to add: once you document something, it becomes a promise that you have to keep in the future, which is a burden.

For instance, Java documented its String.hashCode method, describing how it worked. People wrote code based on the assumption that it would always work that way, since it was documented. Now, they can't easily implement a superior hash algorithm, because it would break backwards compatibility.

7

u/[deleted] Oct 14 '20

Now, they can't easily implement a superior hash algorithm, because it would break backwards compatibility.

Wow. Okay I see the weight of examples now. You have opened my eyes. Thanks

22

u/deelyy Oct 14 '20 edited Oct 14 '20

Lack of time, lack of motivation.

Also, if anyone can learn how to do my job who will pay Me?

Also, there is a direct corellation between how detailed examples is and amount of work spend to keep it up to date with every little change.

Also, who will define the level of details in examples? Suppose we want to create documentation for creation of GUI interface. Should we add examples how to create buttons? How to create windows? How to include our library in project? How to setup IDE? How to compile some project? How to download and install IDE? How to install OS? Etc, etc..

16

u/[deleted] Oct 14 '20

Yes! Be thankful I am using your library! Do you know how many Instagram followers I have? /s

0

u/[deleted] Oct 15 '20

[deleted]

5

u/deelyy Oct 15 '20

Speaking for myself, I love writing detailed documentation. Because I know for 100% that after some time I will forget all details for sure.

...on my prev job some cool software architects (after confrontation with me) told me directly that they do not have fuc$king time to even write one sentence in developer chat about changes that was made on framework level, because they so fuc#king busy.

I`m still feeling salty about this.

3

u/samketa Oct 15 '20

Finally, someone like me who loves to write documentation! I honestly enjoy it.

My outlook with everything, and not only code- if I build something, the people who use that thing should also have an absolutely great time, and it is my responsibility to make their experience great!

Writing great documentation is crucial to good user experience, and I value that!

2

u/Emerald-Hedgehog Oct 15 '20

Here's a song about time. It goes:

Time. UUHHHHHH TIME.
Never enough time.
Maeks mi cri evry tiem.
Writing code, out of time.
Documentation doesn't rhyme with time.

The end.

1

u/[deleted] Oct 15 '20

Love IT!

11

u/maestro2005 Oct 14 '20

Do you have an example, or are you just speaking abstractly?

4

u/portol Oct 15 '20

documentation becomes really good when your customer starts going over it. was in telco, our customer went through our documentation with a fine comb.

4

u/embar5 Oct 15 '20

Programming is kind of like art, the artist is often doing it for self amusement and personal interests unique to himself

5

u/bartonski Oct 14 '20

To play devil's advocate a bit here... the definition of abstraction is 'To remove specifics'. Some things are, by their nature, abstract, and adding specific examples can act to obscure a generality that needs to be there in order to fully express the abstraction that's being documented -- if you're learning about how to use pointers in C, you can give examples of pointers to strings, arrays of integers, various data structures and so forth, but until you talk about the pointer as a memory location that can address anything, you haven't really told people what a pointer is. Once that's been made clear, function pointers start making sense, because those can live at a memory address just like anything else, but there's no straight line between strings and function pointers until you divorce yourself from the specifics.

1

u/PainfulJoke Oct 15 '20

In addition to a lot of the other points here, adding a specific example risks that example going out of date really quickly.

If you change the code the example might break and it's unlikely you'll remember to update the example.

It's not an excuse, but it does make it hard to write examples in documentation at times.

1

u/EternityForest Oct 15 '20

The real problem is that programmers absolutely love breaking changes. They're so obsessed with removing code, and they expect users to pretty much be constantly doing major development, not just bug fixes and a few new features here and there.

Software is never done anymore, people make major internal changes constantly without really adding any new functionality or performance.

1

u/[deleted] Oct 15 '20

Programmers only know how to program, they find it hard writing essays about documentations. This is me: I find it so hard to write comments and later forget what the code is about.

1

u/hugthemachines Oct 15 '20

Quite a few programmers consider writing documentation a kind of suffering. As a programmer you will just have to accept that there will be a lot of code reading to understand how programs work. It is not optimal for you but it is a quite common reality. It is like why are handymen "never" tidy. :-)

1

u/[deleted] Oct 15 '20

They do it couse they cant or dont want to write GOOD documentation or they do not understand they own code but they have to explain it somehow to others xD

1

u/JMurph2015 Oct 15 '20

Docs written by engineers working on that project generally don't account enough for the fact that in the back of their head, they understand what is going on and how it all fits together, but your users may not. So you could write a doc that describes what something does, but without the context it makes no sense.

Another issue is that sometimes the interfaces you're talking about are extremely abstract and general, which means that while yes there are some specific use cases that you may see frequently, it just doesn't do the interface justice to pigeonhole it like that. Imagine (a toy example to be clear) you were writing docs for a generalized sorting algorithm which relied on external comparison functions to do all of the sorting (as is the case in most languages standard libraries). Now 90% of the time people are going to use that interface to sort array-lists of strings. However documenting it in those terms would be entirely underselling the functionality of that interface because it's (hypothetically) actually capable of sorting arbitrary containers of arbitrary types.

1

u/FloydATC Oct 15 '20

Explaining a topic you know very well to an imaginary person you know absolutely nothing about is difficult even for a professional writer, because you can only guess how much detail is needed.

Can you assume the reader knows what an InternalThingyClassFactoryEmitter2 is? Or what exactly is a string? Or the difference between an integer and a floating-point number? Or the difference between an object class and an object instance? Do they even know how a computer works? Do they understand english or do they need even the most basic things like counting explained as if to a child?

Explain too much, and they will complain and demand a summary. Explain too little, and they will complain and demand more explanations and examples. There's no pleasing everyone.

1

u/troido Oct 15 '20

Writing the documentation in an abstract way is the easiest way to document everything that the code can do.

More documentation/examples is more effort to write and to keep up-to-date. Most programmers don't want to put in that effort when they have technically described everything.

1

u/EternityForest Oct 15 '20

Do they like people suffering? Quite possibly from the looks of some stuff they write.

But lack of documentation isn't the problem, it's the need for it in the first place.

There are so many metrics people use to evaluate code quality, but minimal need for documentation is a pretty good one.

If you have to call 15 functions to show an image on the screen, you might just be using the wrong library.

1

u/knoam Oct 15 '20

If you have to call 15 functions to show an image on the screen, you might just be using the wrong library.

Or the problem has more inherent complexity than you realize going in, and then you need the documentation to explain that. On the other hand a good library should have reasonable defaults rather than ask me questions I don't know the answer to. Like Convention Over Configuration.

1

u/EternityForest Oct 15 '20

Inherent complexity can almost always be hidden or automated away somehow, so long as you don't mind adding functions for the most common but special cases.

1

u/knoam Oct 15 '20

Try writing some documentation yourself and you'll see what happens. You accumulate a wide variety of functionality, so you come up with an abstraction to cover all the cases. The wider the variety, the more abstract the abstraction. Then when you write the documentation, you're looking at the code and you want to be accurate so your explanation is equally abstract.

Now you the user want the documentation to explain how to handle your precise case without getting into the complication of everyone else's cases or having to learn the abstractions.

The solution I think is recognizing that these are two types of documentation that both need to be present. Examples maybe should be in a different place than API docs. Also there needs to be feedback on the documentation since different people come at it from different perspectives. And I would have something very high level that lays out the big picture concepts. Definitions and diagrams.

1

u/bluearrowil Oct 18 '20

Honestly this is a problem everyone faces. As a collective we are bad at writing documentation and explaining concepts. Of course there are exceptions, like the React team is pretty good at explaining things.

Also, engineers don’t like writing documentation.

-1

u/timNinjaMillion2 Oct 14 '20

Documentation is like a cookie recipe. Yes, I expect you to follow directions. If you throw in a pound of raw hamburger.... it probably won’t work as described, however feel free to experiment. Maybe I got something wrong. Documenters aren’t perfect. They expect you to come with a level of skill and expertise.