How-to setup GDPR cookie consent with Gatsby
January 26, 2020Setting up a GDPR cookie consent with Gatsby can quickly be accomplished by combining two Gatsby plugins.
Hi! I'm Bojan Bedrač, a passionate software developer who lives and works in Vienna, Austria. Follow me on Twitter or buy me a coffee.
Setting up a GDPR cookie consent with Gatsby can quickly be accomplished by combining two Gatsby plugins.
Conditional statements seem easy and there should be no real complexity behind them. On the other hand how many times a simple mistake like this happened to you?
Sometimes we as developers can be tempted to combine multiple conditional expressions in one long worm-like expression that is hard to understand, let alone test. Such cases should either be avoided or follow a coding style guide, which would at the very least improve the readability of a combined expression.
Testability of the code is defined by the openness of the design and loose coupling of the collaborating classes.
IF statements are simple structures. With this coding style tip they can be improved easily.
A simple description would say bad code equals untested or untestable code. While the former is something that can rather easily be overcome, the latter is a completely different story. It is unfortunately present in many legacy applications and takes a big amount of commitment and knowledge to overcome successfully.