emeidell

emeidell

Importance of Documentation

I am preparing a meetup Lightning talk on Documentation and the importance of it. I love that in the Elixir docs is states “Elixir treats documentation as a first-class citizen”. I love this but why do we? Does the importance come from bad experience and this is our revenge? (This is not my view but just sparking discussion)

I would love your insight on the why and how would you explain this to someone first coming into this language.

Most Liked

yawaramin

yawaramin

In my opinion, documentation is a requirement for a welcoming community. Sure, you don’t really need documentation if you’re motivated to learn the tech. But good documentation lowers the effort barrier and sends a signal that the community cares about newcomers.

Qqwy

Qqwy

TypeCheck Core Team
  1. The learning point that @yawaramin already mentioned.
  2. Documentation is the only tool we have to convey important information to the user of our interfaces. In many languages, the concepts of ‘Documentation’ and ‘Commenting’ are conflated, but they are different:
  • Comments are something you write in your code to help you and future maintainers understand why you made a certain implementation choice (like picking a less aesthetically pleasing solution because the performance difference mattered here, or make a note that yes, this line is required because otherwise a race-condition would happen in situation X, etc.). Side note: Comments should not tell you what happens (because, hopefully, the code itself already does this).
  • Documentation, on the other hand, is for people using your code, who need to know the rules your code expects of them. This is even more important in a weakly-typed environment than a strongly typed one, because there are less ways to enforce rules on the end user (to ‘make invalid states impossible’) so the only tool we still have is communication between humans.

The nice thing about making documentation first-class (rather than having documentation ‘tacked on’), is that it is a lot easier for people to find and use it! I find myself using iex’s h helper very often, because it is so much quicker than browsing on the internet to look for the documentation of packages/modules that I already have installed on my local system.

dimitarvp

dimitarvp

That was honestly one of the things that made an excellent first impression to me ~2.5 years ago with Elixir.

People on Reddit and HN have called Elixir “a language with good marketing” many times and I find myself in agreement with them… although I think the community should definitely go next-level and prepare several topical Wiki-like posts here in ElixirForum; it’s a natural next step IMO (this post is an excellent example of what I have in mind: HTTP client libraries and wrappers).

Elixir has very no-BS noob experience and this definitely won me over as the jaded C / C++ / Java / PHP / Javascript / Ruby programmer that I was back then.

(Anti-example: deployment. I found Distillery really quick to start with but there’s so many manual steps to do that I have to wonder why are there no wrappers or generators yet. Hell, even if they require 20 CLI parameters I’ll still take it, deployment shouldn’t be such a delicate and brittle job).


So to answer @emeidell – documentation is important because there’s very good tooling that can be built around it (ex_doc; seamlessly building documentation is extremely important for wide adoption, including in corporations) and because it’s a very good marketing tool to show initiating programmers that the language is community-friendly.

Where Next?

Popular in Discussions Top

blackode
Elixir Upgrading is so Simple in Ubuntu and It worked for me Ubuntu 16.04 git clone https://github.com/elixir-lang/elixir.git cd elixir...
New
owaisqayum
I have a sample string sentence = "Hello, world ... 123 *** ^%&*())^% %%:>" From this string, I want to only keep the integers, ...
New
MarioFlach
Hello, I want to share a project I’ve been working on for a while: https://github.com/almightycouch/gitgud Background Some time ago I ...
New
WildYorkies
It seems that the more I read, the more I find Elixir users speaking about all the ways that Elixir is not good for x, y, and z use cases...
New
pillaiindu
I want to convert a Phoenix LiveView CRUD website to a CRUD mobile app. What do you think is the easiest way to do so?
New
AlexMcConnell
The reason that Rails is as popular as it is is because it’s very easy for relatively inexperienced developers to get a lot of work done....
588 19568 166
New
AstonJ
Are there any Elixir or Erlang libraries that help with this? I’ve been thinking how streaming services like twitch have exploded recentl...
New
Crowdhailer
I’ve been hearing much about the new formatter and it’s something I have been keen to try. I find examples buy far the most illuminating...
248 19204 150
New
shishini
I think this twitter post and youtube video didn’t get as much attention as I hoped I am still new to Elixir, so can’t really judge ...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New

Other popular topics Top

senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 41539 114
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 53690 245
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 47930 226
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

We're in Beta

About us Mission Statement