• Advertisement
Sign in to follow this  

About installed modules

This topic is 669 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

While I was installing new modules and using them a thing popped out of my mind. How am I supposed to know what a module can do and how to properly use it. I mean like the openpyxl module, All I know is that it can be used on spreadsheet and some of its functions. So what about the rest of the function it has and how to use them? To be specific the one that is not in said in the book I'm using? I tried using the help(module) and dir(module) but its either hard to understand, doesnt say anything useful, or it has what I'm looking for. I have few collections of installed modules so It would be difficult to look for all of their documentation. I even tried to look for the link for their documentation using a disposeable mini program but I realized not all README files have a documentation linked into it.

Share this post


Link to post
Share on other sites
Advertisement

This is in general a difficult problem.

 

The proper solution is that the author of a module explains in a separate document how it works, and what you can do with a module.

That leads to a lot of text, like docs.python.org

 

Some authors do a little less explaining, like at http://www.pygame.org/docs/

It's a mix of tutorials and document links, that together is mostly complete.

 

The majority of programmers however, does not see the need to document anything. You typically get a random example, or a "hello world" kind of program, and that's it.

If you happen to need just that one example, it's fine. In all other cases, it's very not fine (in my experience).

 

One step further, as you say, there is no documentation whatsoever.

 

 

If there is documentation, there is the problem that it may be old, but I'll ignore that for now.

I don't know if you ever browsed documentation like I linked above, but in general, it takes some time getting used to it. After that it's great. You can find any detail that you need.

 

The last two cases, a few example, or nothing at all, you have a problem. Basically, the author says, "I don't care about you, I  know how it works, that is enough." While it's not what you want to hear, but on the other hand, if that is his opinion, fair enough.

The next problem is then, do you want to use software where it's author doesn't care about its users?

 

You can decide the software is no use to you, and try to find something else. The alternative in this case, is basically, figure it out on your own. Read everything you have, open the source code, and read the names of the functions, the classes, and the code and their comments (if it has comments). Study the example, try them, and try to change it towards what you need to have, and see if it works. Basically, you're reverse engineering the code, trying to get an understanding how it works. This can cost a lot of time, and even then it may fail.

 

 

I don't want to decipher how I am supposed to use code if the author neglected to explain it. Not having proper documentation for me is enough to discard the software. Others are willing to invest the time, and try to use the software anyway.

 

 

So in the end, it's up to you. Taking undocumented software means you will spend a lot of time on understanding it. Not taking the software means you have to find something else to solve your problem, and there may not be anything else. The third option is to write it yourself of course, but that also takes a lot of time.

Edited by Alberth

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement