Code & Connect
50 subscribers
25 photos
1 video
1 file
9 links
Code & Connect
🔗 Bridging ideas through code
💻 Sharing insights on programming and tech
🌐 Join us to learn and grow!
Download Telegram
We know that JavaScript is a single-threaded language, which simply means that it can handle only one task at a time.

But if that's the case, how does it handle asynchronous operations (like Promises) and that too pretty efficiently? This is possible thanks to something called the Event Loop. The event loop works in the following manner:

1. Call Stack: When our code runs, functions are pushed into a stack (known as the call stack) and processed one after the other. If these functions call other functions, the new functions are placed on top of the stack, above the parent function that called them.

2. Web APIs/Task Queue: When asynchronous operations (like setTimeout or I/O tasks) are encountered, they are sent to the browser's Web APIs, which handle them separately from the call stack. This means that these asynchronous operations are not handled by the JavaScript runtime itself. The task queue is further divided into two parts: the Macrotask Queue and the Microtask Queue.

• The Macrotask Queue includes tasks like setTimeout, setInterval, and I/O tasks.
• The Microtask Queue includes tasks like Promises (specifically, the .then() and .catch() handlers).

After each macrotask completes, the event loop first checks and processes all the tasks in the microtask queue before doing the next macrotask. This is why tasks in the microtask queue are always executed first, even if they are scheduled after macrotasks.

3. Event Loop: Once the asynchronous task is complete, the event loop checks if the call stack is empty. If it is, the results (callbacks or events, not the original asynchronous tasks themselves) from the task queue are pushed into the call stack to be executed. This cycle continues indefinitely.

This brilliant mechanism allows JavaScript to appear as though it is multitasking, when in reality, it simply juggles tasks in an efficient order.

Credit - Prince Raj
Why do React components need to start with capital letters?

If you’ve ever worked with React, you might have noticed that component names always start with capital letters. But do you know why? 🤔

In JSX, React components are written in a syntax that gets transformed into plain JavaScript using the React.createElement API, thanks to Babel. Here’s where the capital letter comes in:

When Babel encounters a name starting with a capital letter, it knows it’s dealing with a React component and converts it into a React Fiber object (a key part of React’s rendering system).

On the other hand, if the name starts with a lowercase letter, Babel treats it as a string rather than a component. This helps React differentiate between native HTML elements and custom components!

So, always remember to capitalize your component names for React to interpret them correctly. 💡

Credit - Vasudevan LK
Java SpringBoot Roadmap :

➤ 1. Java SE
1.1. OOP.
1.2. Exception Handling.
1.3. Multithreading.
1.4. Collections(List,Set,Map, ... )
1.5. JDBC
1.6. It is required to be familir with hashtag
hashtag#java8 features stream and lambda expressions

➤ 2. DBMS
2.1. Data modeling
2.2. Relational data Model
2.3. Normalization
2.4. Transaction Processing
2.5. Concurrency Control

➤ 3. Java EE
3.1. Servlets
3.2. JSP
3.3. JSTL

➤ 4. Hibernate

➤ 5. Web Service
5.1. RESTful API (The Most popular With Spring)
5.2. It is better to be familiar with SOAP Web Service

➤ 6. Spring
6.1. Spring Core
6.2. Spring Data
6.3. Spring MVC
6.4. Spring RESTful API
6.5. Spring Boot
6.6. Spring Security

➤ 7. Advanced Topics
7.1. Solid principles
7.2. Design Pattern
7.3. Microservices and Spring Cloud

➤ 8. maven and Git

Credit - Rani Dhage
Wondering where to begin with Java Spring Framework? This roadmap breaks down the essentials so you can learn smarter, not harder.

But why Spring?

- Simplifies code and boosts testability
- Vast ecosystem of pick-and-choose projects
- Seamless compatibility with the Java ecosystem
- From simple APIs to enterprise apps and microservices
- Enables rapid development

In the world of Java development, staying ahead means mastering the right tools.
Spring Framework isn't just a tool—it's your secret weapon.

This document provides the concepts needed to master the Spring Framework.

This roadmap may seem challenging at first, but take it one step at a time—start small:

- Learn the fundamentals
- Build simple projects
- Move on to complex applications
- Practice, practice, practice

Remember, mastering Spring is a marathon, not a sprint.

Before you know it, you'll be miles ahead of the rest.

Happy coding!

Stay tuned for my next post, I will point you to some resources that have helped me immensely.

If you liked this post:

Credit - Lahiru Liyanapathirana
What does a typical microservice architecture look like?

The diagram below shows a typical microservice architecture.

🔹Load Balancer: This distributes incoming traffic across multiple backend services.

🔹CDN (Content Delivery Network): CDN is a group of geographically distributed servers that hold static content for faster delivery. The clients look for content in CDN first, then progress to backend services.

🔹API Gateway: This handles incoming requests and routes them to the relevant services. It talks to the identity provider and service discovery.

🔹Identity Provider: This handles authentication and authorization for users.

🔹Service Registry & Discovery: Microservice registration and discovery happen in this component, and the API gateway looks for relevant services in this component to talk to.

🔹Management: This component is responsible for monitoring the services.

🔹Microservices: Microservices are designed and deployed in different domains. Each domain has its database.


Credit - Alex Xu
SQL vs NoSQL Databases: A Comprehensive Overview

In today’s rapidly evolving technological landscape, database management plays a crucial role in organizing, storing, and retrieving data. Two major categories of databases are SQL and NoSQL databases, each suited for different use cases depending on the nature of the data and the scale of the system. Let’s dive into an overview and comparison between SQL and NoSQL databases, highlighting their features, differences, and use cases.