Day 84: 17 November 2020
The sixth OpenClassRooms project concerns the back end programming, that means to write the code for a fictitious server.
This project is built using the MEAN web development stack: The back end uses the Node.js / Express / MongoDB while the front end is written in Angular.
23 days ago, I started to study for the first time the entire back end.
That's right, I've never used this tools before. The only stack I knew was the LAMP and my knowledge is antiquated.
But thanks to my previous knowledge was easy to make mental associations and I grasped the basic concepts very quickly.
When I have to learn something, any topic, I feel more confortable if I follow a progressive approach, that is, I start with an empty folder and I slowly add feature and abstraction layers.
In this case, I already had the front end coded by someone else with a framework that I have never seen before.
My confusion also augmented due to the numerous keywords and methods that I encountered all at once for the first time.
So I had to mentally categorize each keyword with the respecting framework or node package.
For this reason I needed to study and review the course multiple times to really understand what I was doing and also what I was doing wrong.
Whenever I find myself repeating a task, I often use different resources about the same topic to increase the memorization of concepts.
I stopped copy and pasting blocks of code into the editor but instead I also write them on paper. By pressing buttons and using pen and paper I use more my brain in particular the muscle memory.
It's true that we should not memorize the entire documentation and that cheatsheets are useful tools, but we also need to be realistic and we should consider the waste of time looking for the correct sintax. Time is important and it must become second nature to be able to think directly in code.
Writing the code by hand, letter after letter, the worst enemies are now typing errors! I have to pay attention to every letter I write and I have to ask myself why every single symbol is present.
module.export or module.exports ?
_id or id?
Once I write a working piece of code that I consider 'a solution' I commit and push on GitHub. Afterwards, using GitLens (VSCode extension) I study the differences, line by line.
I have followed this MongoDB video tutorial on youTube (schema attributes trim and default!).
When two days ago I changed the sauce schema, I broke everything.
So today I reverted these modifications and I found a typo in the deleteSauce method. I also fixed the modifySauce method to handle an image file as user's input.
Finally the front end and the back end are properly connected. We can now create multiple sauces with a title, an image and other informations.
The user that created the sauce can now modify and delete it.
I still have to write the method to manage the likes and review the whole project following the OWASP directives.
**Link to tweet:**