DEV Community

Discussion on: How to read a documentation?

Collapse
 
aurelkurtula profile image
aurel kurtula

I read them after the fact!

I plan what I need to do, I google all that I need and I get the code running.

Then I get into analytical/writing mode.

Whilst writing the code, I make extensive use of branches. For example, learning ExpressJS for the first time, the hello world gets a branch "step1".

After I get everything done. Or after I'm deep enough. I get back to the first branch and start picking the docs apart.

app.get('/', (req, res) => {
  res.send('hello world')
})

Even for this I use google: "expressjs get" will take me to do right section of the docs right? Once there I'm more confidant, I know that I already coded everything, now I just need to understand what it all means.

The docs say "Returns the value of name app setting, where name is one of the strings in the app". That wouldn't make sense if what you wanted is to send "hello world" to the browser, but now that you already got that, you are free to find it interesting.

Ok I don't really care about app.get('title'); but interesting. Now I see a link to "Path examples", clicking it, aha, that's what I needed, holy, I can set an array. Wait, the example uses array in the use method, let me try to change the hello world to an array:

app.get(['/', '/hello'], (req, res) => {
  res.send('hello world')
})

Haha, it works!

(Honestly, this is not scripted, I genuinely didn't know we can use arrays in there)

Basically I found that reading the docs to learn the basics doesn't work for me (I have a feeling it will work after I ready lots of docs over the years) so for now I'll use them as wikipedias rather than tutorials.

Hope this gives you some ideas.