Wednesday, September 26, 2007

Reading Mozilla Source Code

What can I say? Reading the Mozilla source code seemed to pose as a large scale challenge. Before I ever looked at the source code I was pretty confident with my programming knowledge. However, after looking at the source code (cpp files in particular) I was in awe. All the use of defines, typedef pointers (i think?), and extern C? made me run around in circles to understand just one method which to me seemed would be easy. The javascript and XUL was pretty straight foward and easily understandable so I was able to grasp some of what was happening. For those of you who really want to get involved with the code I would suggest reading the Mozilla structure and Styles in our weekly course schedule.

All in all, the basic idea that I could acquire after checking out the source code is that Mozilla works on 3 parts. The C++ code does all the actual work for most of the part, the javascript is called by different interactions with the UI, and the XUL files are basically used to display what you see on the screen. Please don't misunderstand me, not every process requires all 3 sections to do something however some actions cannot be done by javascript alone.

Here are the links to some of the information listed there:
Mozilla Source Code Directory Structure
A good way to understand the directory structure, however I like to use it as an index to navigate around MDC

Mozilla Style Guide
Portability Rules for C++
These two links were probably the most useful for me by giving me sample code to enforce the information

1 comment:

PascalAschwanden said...

I hear ya. I've been digging into the mozilla source code, quite a bit, as well. I've got my own mozilla blog on friendster if you wanna check it out some time.