[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: What's the easiest and/or simplest part of Linux Kernel?



Le 28.08.2013 03:36, guojzzz a écrit :
The reason why I choose some *formal* projects is that I think codes
are clear and there are less bugs.
I will see on Github and some other projects.

The assumption that clean code is bug-free is wrong. Try to read any source code of any program you think bug-free. It may be clean, or it may be a damned unreadable mess, especially if the project is old.

And if the project is recent, it will not have a long history of bugs and fixes, and so may have tons of bugs, known or not by the users or authors, but, since the project is young, it will have less zombi code, coding style will be more unified, and modern programming techniques are more likely to be used, like OOP*.

Another problem with code probably written by gurus, or which run in environments were high speed and stability is required, is that the code will be highly optimized, maybe with non-standard features, probably with lot of compilation options, etc etc. All of those things makes code more efficient, but harder to understand. Like macros, that most C programmers tend to avoid. And because I have learn C as my first language, I can tell you, that they are true to avoid them, they makes things hard to read and maintain. But they makes things fast, so I would not be surprised if there were a lot of them. And not "childish" ones like the one I made.

So, either start your project, or contribute to small projects first, if you want to learn. Something that you can understand in less than 2 weeks, and start to hack.

* which is doable in C. People saying that C can not do OOP are incompetent or lie. I do not really like C programming, but paradigm have nothing related to syntax, only with writer's minds. Some people may not like OOP, and they will be true, it is not always good to use it.


Reply to: