July 2019
Intermediate to advanced
416 pages
10h 6m
English
While we are parsing our content, we need a mechanism to actually store the text that we are creating during the parsing process. We could just use a global string and update it directly, but that would become problematic if we decided to asynchronously add to it later on. The main reason for not using a string is down to Single Responsibility Principle again. If we were using a simple string, then each piece of code that we add to the text would end up having to write to the string in the correct way, which means that they would be mixing reading the markdown with writing to the HTML output. When we discuss it like that, it becomes apparent that we need to have a separate means ...
Read now
Unlock full access