Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's great to hear! I'm sure I could find it, but are the libreoffice coding standards written down (and could you send them my way)?

On the topic of coding standards, there's an excellent github repo https://github.com/isocpp/CppCoreGuidelines which even quotes Bjarne Stroustrup as saying "Within C++ is a smaller, simpler, safer language struggling to get out." There are hundreds of recommendations, like 'ES.31: Don't use macros for constants or "functions"'.



So we don't really have strong coding standards (kind of tricky when you inherit a 10 million LOC codebase written over ~20 years), we just try to be pragmatic and improve the code where we can.

So we have a collection of plugins, see here: https://cgit.freedesktop.org/libreoffice/core/tree/compilerp...

Which verify a variety of things.

We focus on 2 things: finding dodgy code and using APIs correctly. We don't try to modify the C++ language, just restrict accidentally straying into some of the really nasty corners.

But I like to keep an eye on experiments like yours for ideas :-)

e.g.

no c-style casts: https://cgit.freedesktop.org/libreoffice/core/tree/compilerp...

use the comma-operator sparingly: https://cgit.freedesktop.org/libreoffice/core/tree/compilerp...

is your loop variable really big enough: https://cgit.freedesktop.org/libreoffice/core/tree/compilerp...

calling virtual methods from destructors is dodgy: https://cgit.freedesktop.org/libreoffice/core/tree/compilerp...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: