3 ms·
> Interesting to see a mix of C and C++ in the same codebase, that always makes me curious if there is some internal/mental "pressure" to convert the C code to
by rodarima 3y ago
> Interesting to see a mix of C and C++ in the same codebase, that always makes me curious if there is some internal/mental "pressure" to convert the C code to C++ since that does seem simpler in many ways if you're already using C++.
The initial Dillo was fully written in C and it used GTK+. As it moved to FLTK it began rewriting parts in C++.
> Also, does anyone know why the functions have a (to me, incredibly random) "a_" prefix? Like this, from "dicache.h" [1]:
This is something Jorge came up with around 1999[1] for the C part, so the "a_" prefix states functions that are used outside the module (like public in C++), while the others are not. The choice of "a" is explained as:
> Why the "a_" prefix?
>
> Because it reads better "a_Menu_create" than "d_Menu_create" cause the first one suggests "a Menu create" function!
[1]: https://dillo-browser.github.io/old/NC_design.html https://dillo-browser.github.io/old/NC_design.html
I don't think this alone is a good choice, as one should better use "static" to enforce it.
- unwind 3y agoWow! Thanks for responding, and providing such an awesome answer. Yes, that sounds very much like a lack of "static", which makes it even more confusing. It sounds unlikely that someone would start a browser project in C and not know about static. I would not agree that it reads "better", it just makes it more random. Adding a letter that at least hinted at what was meant would have been better, if we're for some reason are limited to a single letter (like "p_" for public).