Z
Z
zim322015-11-11 01:04:00
MySQL
zim32, 2015-11-11 01:04:00

How to understand the source code of a project like Mysql?

Well, in general, people deal with such projects as Mysql, for example, where you open a file - and there are 20K lines of code.
And there are many such files. Already even set the LXR on this business with grief in half. Doesn't help yet)

Answer the question

In order to leave comments, you need to log in

4 answer(s)
N
nirvimel, 2015-11-11
@zim32

How do people generally deal with projects like Mysql, where 20K lines per file

These people at Oracle quickly figured out that they could lose their jobs if someone other than themselves could figure out their code.

M
Maxim Moseychuk, 2015-11-11
@fshp

Looking up the usage and definition helps a lot. Every IDE has it. Implemented in Vim/Emacs/Other plugins.
Well, do not expect that you will learn the source codes just by reading them, and you will thoroughly understand them. That doesn't happen.
First, decide why you need to watch the source. Low performance - we trim the profiler, look for bottlenecks. We climb into the code, optimize, test. We repeat a couple of iterations.
Lacking functionality? For example, we want to add a new type. We are looking for modules that implement similar functionality. We make our type in the likeness of the existing ones. Testing the server, replica. We set the profiler, etc.
And now you have already figured out some parts.
And without a goal to climb into the code in order to "become a specialist" - nothing will come of it.

S
Sergey, 2015-11-11
Protko @Fesor

1) we understand why each file is needed, we try to figure out the big picture, what the project consists of (what components, modules, etc.). Numerous articles and official documentation can help us with this. describing the architecture of the project.
2) you need to go deeper only for some reason and not just like that. Let's say if you are interested in some specific things. For example...why would you want to learn a MyISAM device just for the sake of it if not many people use it anymore?
In general, fshp said everything correctly.

K
KaminskyIlya, 2015-11-11
@KaminskyIlya

Of course, if you set a goal: to sort out a project that was being done by a large team of specialists, then little will come of it. Especially in the absence of good practical experience in the language in which the project is written. But if you set a goal to master exactly this-this-project (it doesn’t matter, MySQL, Linux core, Eclipse IDE, ReactOS, ...), then it’s quite. At first, any of them seems like a giant maze that you will never learn by heart. But trust me, this is just the beginning.
And yes, I agree with fshp :
You need to learn how to assemble this project. Then learn how to make changes (in your sandbox) in order to conduct experiments. And only after confidently mastering the practice of making working edits to the project, move on to more serious things in it.
In general, the very idea and desire to thoroughly understand the structure of the well-known open source project is worthy of praise. Either way, you will gain invaluable experience. Learn to be tolerant of someone else's code, to understand or anticipate the train of thought of other people. Maybe you also have to "in a hurry" to study someone else's project already on the instructions of the employer. Who knows, if you understand this project thoroughly, maybe join the Oracle team and become one of the lead developers? ;)
P/S
I don't want to throw a stone at the side of the MySQL team, but a 20K line of code file is, IMHO, a sign of "smell code". But who am I to judge. ;)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question