How to learn a web framework (time-efficiently)
Tags: webdev, javascript, productivity, nestjs
Published: 2023-01-07 23:07:38

Nowadays, learning has become a continuous activity that you should keep doing all the time (You really die once you stop)

However it's important to keep learning, doing that in the wrong way could be very disappointing as, because we are human-beings, we tend quickly lose the enthusiasm if no quick profits are gained.

And like any other subject, learning is a technique which when done correctly, quick gains are guaranteed.

The following topic will list 10 points which will help to do the learning process quickly and in a controllable and time and effort efficient manner. 

The use case here is about learning Nest.js but the steps should apply on any other topic. The steps themselves are mentioned in details in the book (Soft Skills: The software developer's life manual, By John Sonmez) so you can go for more depth

The format for each point will be like
- Point title
- Brief about it
- Sample answer for it

Let's start ...

**1. What and how big is it?**
This is the first step, to know about what are you going to learn and how big is it. So you can know that it matches your hearings or not and also to be aware of the time and cost to be dedicated for this learning process
 
It’s just another web framework, built over Node.js, also it provides a good structure compared to other frameworks like Express.js. Currently, it's considered one of the most famous Back-end framework for Node.js out there.

How big: 
Nest.js can be used to build various types of APIs like REST and Graphql. Also with database connections to SQL and NoSQL databases

**2- Specific domain to focus on**
Here you will be trying to set limits of the topic you are learning about, just the important parts for your case

How to build a REST API and persist data into Postgresql database

**3- Define success**
Here you are setting the success criteria, this should keep you focused and also helps with measuring your progress
 
I would consider that I have been successful at learning Nest.js when I have:

- Built a REST API
-  While following the convention and best practices around
  - Project structure
  - Code cleanliness
- Connected to database for data persistence
- Secured the API
- Used caching layer
- Wrote some test cases

**4- The plan**
Here I should be adding something like book index for steps and how I should go to reach the success criteria as defined above

I think it should be like:
- Get started with example project
- Use services 
- Connect postgresql
- Set up Migrations
- Understand Requests
- Understand Dependency injection
- Validate request data
- Paginate response data
- Protect routes using Guards
- (Optional): Do request Logging
- Understand Binding Techniques
- Catch Exceptions with Filters
 

**5- Resources**
Here should come most of the resources that you think could be helpful at some points or having a specific advantage like good organization or the publisher is known to be creating good content

Resources list:
- For the syllabus above: 
  - Topics are from: https://courses.nestjs.com/
- https://www.freecodecamp.org/news/learn-nestjs-by-building-a-crud-api/
- https://blog.logrocket.com/full-stack-app-tutorial-nestjs-react/
- https://hashdork.com/nest-js-tutorial/
- https://devm.io/nodejs/tutorial-nestjs-for-nodejs-app-158076
- https://javascript.plainenglish.io/nest-js-part-1-creating-your-first-api-71471ac39d3e

**6- Filter resources**
Here you should keep only the ones that you think should be sufficient as they should achieve your target

Filtered resources:
- https://www.freecodecamp.org/news/learn-nestjs-by-building-a-crud-api/
- https://blog.logrocket.com/full-stack-app-tutorial-nestjs-react/
- https://hashdork.com/nest-js-tutorial/

**7-10 steps are known as LDLT (Learn - DO - Learn - Teach)**
**7- Start learning**
Up to this point, no learning action has been done yet, just planning for the learning. The **Learn** step is where you start to learn about the topics from the resources you have collected

For me, I would go with some reading before diving into the freecodecamp video (it’s a 4 hours 😀 one) but looks like a good one

**8- Do (Like learning by playing, try it yourself)**
Here, you are attempting to try various scenarios which are not very related to the tutorials that you have read, and honestly, you will learn much much from this step.
Also mostly you would come with unanswered questions, write them down for the next step 

I will start to prepare the environment and check the example project structure to check if all good and understandable
Then, I will try to add a new controller with some other routes which have dynamic parameters and try to validate them.

**9- Learn (Fill the gaps)**
To answer the questions for the parts that are found to be not very clear, I should be doing more learning and checking further resources

Example, What should be the best way to validate data 

**10- Teach**
Once a single section has been grasped, I should be trying to make a good explanation of what I have learned in the form of a tutorial, video or explain it to a colleague. This highly helps to keep the information organized in your head and it deeply shows you some gaps in your knowledge

This is like what I have done into this Post about the learning 10 steps process 😀
 
Steps from 7 - 10 should be repeated for each section or topic in your learning plan, so let's assume you have many sections to learn, then each section should have its own 7 - 10 process.

I hope that was helpful
Thanks and Happy Learning