Do not, I repeat, do not repeat yourself
If you’ve worked with frameworks in the past, you may be familiar with the Don’t Repeat Yourself (DRY) principle, even though the principle is more focused on coding and coding style. If you’re not, or just need a reminder, the DRY principle simply states that you should not repeat yourself.
You can find out more details here:
https://docs.getdbt.com/terms/dry
As much as we possibly can, we should try not to repeat our code. As an example in this application, we repeated the code on the edit
and new
views. Using the DRY principle, we should refactor our code so that it uses the same form for both actions. In the same manner, instead of building everything on your own and from scratch, you should reuse functions, tools, and even libraries altogether. One task that we as developers have done over and over is to authenticate users. If you have an authentication code that works, you may have even copied it from a previous...