667
edits
Changes
→4. Compare Implementations
==4. Compare Implementations==
Sometimes it's helpful to compare how two different projects implement the same feature. You can often learn a lot by reading the code in a project that does what you want, in order to make another do new things.
We'll compare the code for Firefox, Chrome, and Brave:
* The equivalent code in Chrome is also written in C++, see https://cs.chromium.org/chromium/src/components/url_formatter/url_fixer.cc and https://cs.chromium.org/chromium/src/components/url_formatter/url_fixer.h
Read through both files and try to orient yourself. Don't get hung-up on understanding every single line, especially in the Firefox C++ code, which uses lots of internal string APIs and , [https://en.wikipedia.org/wiki/XPCOM XPCOM base code], etc. Instead, try to find clues as to how each one is doing what it does with input strings before converting them to URLs.
==5. Add Test Cases==