Answer the question
In order to leave comments, you need to log in
How to parse someone else's code?
I want to make a small video player for mkv files. I found a library on github for working with the format. There is almost no documentation, only theory about the structure of the format and examples for reading informational headers. To read the necessary data, I did not find it. I tried to get into the VLC code to see examples, but I realized that without knowing how the library itself works, I won’t go far. Therefore, I want to ask knowledgeable people how to deal with situations when, having only the source code of the library on hand, understand how it works? I've searched for information on this topic both here and on other forums, but all the answers assume that I'm already quite familiar with all the components of the code.
Answer the question
In order to leave comments, you need to log in
How to parse someone else's code?
Probably it will sound strange but I read some code "from right to left", or from the end to the beginning (PHP), seriously, sometimes it's clearer for some reason.
In 99% of cases, programmers are users of someone else's code. And for this they do not need to dive into the implementation. For good, you need to understand the purpose of the library. Its API. And see the unit test cases as it is tested. There will be an obvious application.
Therefore, the author does not need to parse the code. Moreover, for modern projects, the code has exceeded hundreds of megabytes (for a minute, War and Peace takes barely 5 megabytes) and it is pointless to study it all.
Specifically, the mkv format. This is an analogue of xml only binary. It doesn't need to be cracked or broken or reverse engineered. This is a completely open format. Its specification has been published. And reading it will give more benefit than picking the code. You will understand the spec - and it will immediately be clear what the code does.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question