Have you ever thought about what happens behind the scenes when you write code? 🤔 How does a programming language actually understand what you typed? It mainly happens in 2 important steps: ✅ 1) Lexer (Lexical Analyzer) The lexer scans your code and converts it into tokens — small meaningful units like: - keywords (let, if) - variable names (x, name) - numbers (10, 3.14) - operators (=, +) - symbols (;, {}) 📌 Example: let x = 10; becomes tokens like let, x, =, 10, ; ✅ 2) Parser (Syntax Analyzer) The parser takes those tokens and checks if they follow the language rules (syntax/grammar). Then it builds an AST (Abstract Syntax Tree) 🌳 — a structured representation of your code. Why does this matter?, Because this is how tools like these work: ✨ Compilers ✨ Interpreters ✨ ESLint ✨ Prettier ✨ TypeScript 📌 In simple words: Lexer = breaks code into words Parser = understands the sentence structure If you're learning compilers, JavaScript internals, or TypeScript — knowing this concept is a big win 🚀 #Programming #JavaScript #TypeScript #WebDevelopment #ComputerScience #Coding #Developer #Learning
Code Understanding: Lexer & Parser Basics
More Relevant Posts
-
Lately, I realized something important about learning programming 👇 AI makes coding faster… but if you only copy & paste, you don’t actually learn how to think. So I decided to change my approach: Understand the problem before writing code Break big tasks into small steps Focus on logic, not just syntax Use AI as a guide, not a replacement Struggling, debugging, and feeling confused is not failure.... it’s literally how real developers grow. From now on, I’m training myself to think like a programmer, one problem at a time. Slow progress, but real progress 💪 #WebDevelopment #FrontendDeveloper #LearningInPublic #ProgrammingMindset #ReactJS #JavaScript #ProblemSolving #BuildInPublic #DeveloperJourney
To view or add a comment, sign in
-
Most bugs aren’t dramatic. They’re quiet. Subtle. Almost invisible. Today’s lesson? Curly braces in JSX. I had a Pressable component wrapped like the attached image, and for a moment wondered why people didn’t just write code like that. I mean, it worked perfectly, and didn't break anything. No crashes. No warnings. No red screens. But here’s the thing — those curly braces were doing absolutely nothing. In JSX, {} means: “Evaluate this JavaScript expression.” And yes, <Pressable /> is an expression. So React evaluates it and renders it. But if you're not: Mapping over data Rendering conditionally Using a variable Running logic …then those braces are just noise. Not harmful. Just unnecessary. Code like that will not cause any issues, performance or otherwise, but someone else will read it and wonder if you learnt to code from a monkey. There are rules that won’t break your code, but will break your Lead Dev’s trust in you. A lot of programming languages come with semantics. Rust is the most cult-like I have dealt with so far, because most tutorials I have seen will hammer on how the structure should be, even before teaching you the code itself. Knowing these things help you read other people’s code. And helps people read your code. And that, a lot of times, is the difference between a good developer and a great developer. That small distinction keeps your codebase disciplined. Because engineering isn’t just about making things work. It’s about making them clear. Write code like someone else will inherit it. Because they will.
To view or add a comment, sign in
-
-
🚀 𝐉𝐚𝐯𝐚𝐒𝐜𝐫𝐢𝐩𝐭 𝐢𝐬𝐧’𝐭 𝐡𝐚𝐫𝐝. 𝐓𝐡𝐢𝐧𝐤𝐢𝐧𝐠 𝐥𝐢𝐤𝐞 𝐚 𝐝𝐞𝐯𝐞𝐥𝐨𝐩𝐞𝐫 𝐢𝐬. 🧠 Anyone can memorize syntax. 📚 But real learning starts when: 👉 logic breaks 👉 errors appear 👉 nothing works as expected 𝐓𝐡𝐚𝐭’𝐬 𝐰𝐡𝐞𝐫𝐞 𝐉𝐚𝐯𝐚𝐒𝐜𝐫𝐢𝐩𝐭 𝐭𝐞𝐚𝐜𝐡𝐞𝐬 𝐬𝐨𝐦𝐞𝐭𝐡𝐢𝐧𝐠 👇 ✨ How to break problems into steps ✨ How to think before writing ✨ How to debug instead of giving up 𝐓𝐡𝐚𝐭’𝐬 𝐰𝐡𝐲 𝐩𝐫𝐨𝐣𝐞𝐜𝐭𝐬 𝐦𝐚𝐭𝐭𝐞𝐫 𝐦𝐨𝐫𝐞 𝐭𝐡𝐚𝐧 𝐭𝐮𝐭𝐨𝐫𝐢𝐚𝐥𝐬 🔧 Because code doesn’t grow skills — problem-solving does. 💡 🔁 Frameworks change. 🔁 Syntax evolves. ✅ Logical thinking stays forever. 🤔 𝐐𝐮𝐞𝐬𝐭𝐢𝐨𝐧: What taught you more watching tutorials or building projects? 👉 To learn more, follow JavaScript Mastery! #JavaScript #WebDevelopment #LearningByBuilding #Coding #DeveloperMindset
To view or add a comment, sign in
-
🧠 Coding is not about syntax — it’s about thinking logically. Anyone can memorize keywords. Good developers understand how data flows and why decisions matter. Logic first. Code second. That mindset changes everything. #Coding #JavaScript #ProblemSolving #DeveloperMindset
To view or add a comment, sign in
-
-
🚀 How JavaScript Executes Your Code — Behind the Scenes Here’s the real flow. 👉 1. Parsing (Before code runs) Your code is first checked for errors and converted into a Syntax Tree (AST). 👉 2. JIT Compiler JavaScript uses a Just-In-Time compiler. It reads your code and prepares it for execution. 👉 3. Bytecode → Machine Code The engine converts your code into bytecode, then into machine code (CPU language). 👉 4. Execution Finally, the machine code runs and your program starts working. So the pipeline looks like this: Code → Parsing → Syntax Tree → JIT Compiler → Bytecode → Machine Code → Execution Keep learning. Keep building. 💪 #JavaScript #WebDevelopment #FullStackDevelopment #MERN #Programming #Developers #Learning #CodingJourney
To view or add a comment, sign in
-
-
Before frameworks. Before languages. Before fancy tools. There’s mindset. Many of us jump directly into React, Node, Python, or any new technology. But real software engineering starts much earlier with the way you think. Programming is not just writing syntax. It’s: • Designing precise pseudocode before touching the keyboard • Breaking problems into smaller logical steps • Ordering your thoughts clearly (logic without order is still chaos) • Turning repetition into loops and helper functions • Automating instead of repeating manually This way of thinking is what transforms code from “it works” to: → easy to read → easy to maintain → easy to scale → and built to last What I loved about Brilliant.org is that it doesn’t teach tools, it trains your brain. It focuses on foundations, and honestly, going back to “scratch” feels like the best possible way to learn, because sometimes the fastest way forward is rebuilding how you think. If you’re starting your programming journey (or even if you’re not), don’t underestimate the power of fundamentals. Strong foundations make strong engineers. #Programming #SoftwareEngineering #Learning #ComputerScience #Mindset #Brilliant #ProblemSolving
To view or add a comment, sign in
-
-
Sometimes the best learning projects start as “just for fun.” I built a VSCode extension for fun that counts every React component inside a folder and its subfolders. But the interesting part wasn’t the counting. I had to figure out: • How to reliably detect React components • How to parse large JS/TS files safely • How to traverse an entire project efficiently That led me into studying Abstract Syntax Trees and building the extension using Babel for accurate code analysis instead of fragile string matching. What started as curiosity turned into a full static analysis tool that scans entire React codebases and provides insights into component distribution and hook usage. Instead of relying on regex, I parsed files into Abstract Syntax Trees using Babel to accurately detect function and class components across .js, .jsx, .ts, and .tsx files. To traverse large projects, I implemented a depth-first search and used a hash map for efficient file tracking and caching. The extension ended up being used by hundreds of developers. #vscode #React
To view or add a comment, sign in
-
Here's what nobody tells you about learning multiple languages I used to master one language, then jump to the next. 🔄 Big mistake. You miss 80% of the value. 📉 Languages teach patterns, not syntax. 🧠 Here's the real strategy: - Learn JavaScript → TypeScript (types next) ➡️ - Python → Go (performance jump) ⚡ - One frontend + one backend beats 5 half-learned langs 🎯 Depth in 2 > breadth in 10.💡 The secret? Solve real problems across languages, not toy tutorials. 🛠️ Your next language should solve a problem your current one can't.🚀 #coding #programming #developer #softwareengineer #tech #learning #languages #productivity #careergrowth #buildinpublic #webdevelopment #devlife #techcommunity #growthmindset #softwaredevelopment #successmindset #innovation
To view or add a comment, sign in
-
When I started learning 𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁, I used for loops everywhere 😅 The code worked… but it was long, hard to read, and easy to mess up. Then I learned array methods and everything changed. 📌 What I practiced in this code: 🔹 push() → Add an element at the end of an array 🔹 pop() → Remove the last element 🔹 shift() → Remove the first element 🔹 unshift() → Add an element at the start 🔹 map() → Create a new array by transforming values 🔹 forEach() → Perform an action on each element 🔹 filter() → Get only the values that match a condition 𝗪𝗵𝘆 𝘁𝗵𝗶𝘀 𝗺𝗮𝘁𝘁𝗲𝗿𝘀 Earlier, I used to think loops were the only way to work with arrays. Now I see how these methods: ✔ Reduce code ✔ Improve readability ✔ Make logic easier to understand 👉 Writing small practice code like this helped me understand how arrays actually behave, not just memorize syntax. Learning step by step, one concept at a time because Consistency > Speed. #Javascript #Learningtocode #Webdevelopment #Frontend #Programming
To view or add a comment, sign in
-
-
Ever feel like your team’s code is a bit of a tangled mess? That was us, not too long ago. Production issues were popping up more often than we liked, and figuring out what went wrong felt like an archaeological dig. It was slowing everything down, honestly. We knew we needed a change, but where to start? My focus shifted towards instilling more disciplined coding practices. It wasn't about pointing fingers, but about building better habits together. We started talking about object-oriented principles and standard design patterns, really digging into how we structured things. I tried to lead by example, sharing insights and offering guidance on our PHP and Python/Django services. It was a lot of back and forth, explaining the ‘why’ behind each suggestion. And you know what? It’s made a noticeable difference. The number of unexpected bugs has gone down. Things are just… more manageable now. It feels good to know the codebase is more robust and that we’re all better equipped to tackle those tricky incidents. It’s a relief, frankly. What have you found most effective in improving code quality within your teams? Would love to hear your thoughts. #SoftwareDevelopment #EngineeringCulture #TechLeadership #CodingPractices #Teamwork
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development
Interesting