Updated FAQ (markdown)

Benoît Blanchon
2016-08-17 20:01:24 +02:00
parent 2ebfd47a54
commit c899244ba6

6
FAQ.md

@@ -144,13 +144,13 @@ The recommended practice is to do the JSON handling in a dedicated function, wit
This means that you cannot return a `JsonArray` or a `JsonObject` from that function, because they would contains dangling pointers to what used to be the `JsonBuffer`.
Instead, you should convert the content of the `JsonArray` to a custom array or `vector`; or the content of the `JsonObject` to your own data structure.
This seems like a constrain, but remember that you're programming for an embedded platform with very limited resources; and that requires special techniques.
This seems like a constraint, but remember that you're programming for an embedded platform with very limited resources, and that requires special techniques.
A positive side effect of following this recommandation is that the code is safe and memory efficient. It also encourage the separation of responsibilities: the function is only in charge of the JSON serialization an no specific JSON data leaks elsewhere is the program.
A positive side effect of following this recommendation is that the code is safe and memory efficient. It also encourages the separation of responsibilities: the function is only in charge of the JSON serialization and no specific JSON data leaks elsewhere is the program.
See issues [#72](https://github.com/bblanchon/ArduinoJson/issues/72), [#87](https://github.com/bblanchon/ArduinoJson/issues/87), [#115](https://github.com/bblanchon/ArduinoJson/issues/115), [#135](https://github.com/bblanchon/ArduinoJson/issues/135)
See [ArduinoJson: Avoiding pitfalls](https://github.com/bblanchon/ArduinoJson/wiki/Avoiding%20pitfalls)
See [ArduinoJson: Avoiding pitfalls](https://github.com/bblanchon/ArduinoJson/wiki/Avoiding%20pitfalls) and [FAQ: What's the best way to use the library](https://github.com/bblanchon/ArduinoJson/wiki/FAQ#whats-the-best-way-to-use-the-library)