A
A
Andrey_Epifantsev2020-06-20 03:16:17
Kotlin
Andrey_Epifantsev, 2020-06-20 03:16:17

Kotlin: how to use the documentation?

The Kotlin documentation that Google leads me to, like this one , is very inconvenient. We have a long document describing several dozen functions without any table of contents or list of these functions.

If I need some specific function, then scrolling through this long file is completely inconvenient, I have to search by words at random. For example, I need to reduce the size of the string stored in this class. First I try to search for the word 'size'. After reading the description of several functions, I see that this is not it. Then I guess to search for the word length and finally find the right setLength function.

Documentation for other libraries and languages ​​usually contains a table of contents or list of functions at the top of the page. For example:
std::string in C++- the list is divided into sections, you can quickly cover it with a glance, and go to a detailed description of the functions you are interested in.
Or another example:
A string in Qt also has a list of contents, sorted alphabetically. You can quickly view it and jump to the functions you need.

Am I somehow using the Kotlin documentation incorrectly? Maybe there you need to press some button and from somewhere on the side the table of contents will come out or descriptions of all functions will collapse and I will see their list? Or maybe this is a wrong link and this documentation is not intended for users of the language, but for users of the language, the documentation is actually somewhere else?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Yudakov, 2020-06-20
@AlexanderYudakov

In Android Studio, write:
"hello".
- and after the dot, the studio itself tells you everything.
Contextual search works right there.
5eee17d63f608039130291.png
Would you like a detailed description of the method?
Click Ctrl + Q.

A
Andrey_Epifantsev, 2020-06-21
@Andrey_Epifantsev

There is such a line of code:
val variant1 = StringBuilder()
in the next line I write:
variant1.size
a hint pops up with a single function: trimToSize. How about changing the size?
You also need to guess what to look for by the word length.
And if you press Ctrl-Q, then a window pops up with the function signature. It does not contain any detailed description:
5eeeaf3e150bc732083645.png
The IDE prompts me the signature in the input process.
Here is a detailed description in the documentation.
The only plus that I found in Ctrl-Q is that if you click on a class in this window, a description of this class will open, which for some reason is not in the official documentation.

A
alekseyHunter, 2020-07-22
@alekseyHunter

It is necessary not to "guess", but to know the methods of the base classes.
If you don't know, you learn during the Studio's hints.

not in the official documentation

Study other documentation from developers, the same Metanit or StartAndroid.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question