Designing A System
We always love to just jump in and start coding away at problems before we are ready to.
We create anew project, start coding our vision just to just realize hours later that we didn’t think it through and need to throw away code.
Next time you think about starting a new project stop. Analyze the problem first. Make a design documentation. I know what you’re thinking about, a design documentation for my side project? That’s way too much!
It doesn’t need to be an actual formal document, it can be a txt file where you write down your ideas so you have a frame of reference later.
- Architecture and Why
Of course this applies mostly to medium/big projects. On a small and time constrained project this might not be viable, but you should still do a minimum of analysis. You are going to save time when you realize that like you coded it it’s not going to work and you need to rewrite the whole thing. If you planned you would have noticed the problem in the planning phase and alreasdy solved it even before writing a single line of code. Of cource there are a lot of problems that only ememrge once you start coding, those are fine, but don;t have those on top of avoidable ones too.
- Database Scheme
If you’re using a database take time planjing out your models and relashinship. You can optimize access time, decide if you should having an index on a column or on another and which foreign key constraints to apply.
- API Endpoints
If you’re using or serving an API take time to define your api and write it down so you don’t have to change it on course and forget. You’d never want to publish a documentation that doesn’t apply to your api because you added something at the very last moment
If you have User Accounts and an auth system first ask yourself. Why? Do you need it? If you don’t just don’t have it! But if you do, remember that you need to abide to GDPR and store the passwords securely. Use a known and recognized framework. Don’t roll your own please..
Next decide how your application will authenbticate, if with tokens, OAuth, password grant. Each has its own pros and cons. Keep in mind that most applications are visible, it is trivial to extract a key from your application, have other safeguards in place to protect your server.
The next time you’re building something take the time to dive keep on the design side before jumping into coding. You will thank yourself for that later on in the project.