#100DaysOfCode Day 45/100 Tonight I promoted some information for the weekend and emailed myself a bunch of resources. Big snow coming to New England :) The resources focused on suggested folder structures in React, some alternatives, and style guides for JavaScript from both Google and AirBnB. I also looked up some more suggestions for Cursor. So far, I’m finding that less complex functions in shorter files seem to net better results. I also risked the “Allow Everything” command in Agent mode and saw its capabilities and risks. It broke something :) One cool thing was running the complexity report on the scripts comprising the complexity report. Some functions were ridiculous, 50-350+ complexity. A few context windows got everything below 10 decision points per function. I’m almost done covering all decision points for my codebase. I want to use my test descriptions and function names to compile a larger list so that I can cover practically all iterations of decision point creation in JavaScript/React/TypeScript. That way I can write a test file covering ideally all possible use cases just to try my best to eliminate decision points that aren’t broken down into the complexity table. I also want to rebuild the breakdown table so that every decision point type is within its own header: - if, else if, ternary, catch, case, ?., ??, &&, ||, default params, loops of each kind, base, and maybe something else I’m forgetting I’ll then explore with restyling or adding in some filtering/sorting for the table in case users want to filter out less complex items. I have some more to do, but I really look forward to exhausting complexity. It’s a fun visual report that leverages ESLint and JavaScript syntax. Maybe I’ll look at cognitive too for good measure idk. Really trying to tackle architecture to make the right lintings an cursor rules. Exploring attributes like file size, function size, max statements, and how they can be enforced by ESLints is going to inform me on how I can best look at for an just understand what’s going on. Really looking forward to better understanding feature va share separation or concerns too, things like “unidirectional codebase architecture” and whatnot. Lots more to go. They can get back to just having ideas and running with them. No use going past the point of no return.
React Code Optimization Day 45: Simplifying Complexity
More Relevant Posts
-
🚀 Day 6 of My JavaScript Journey: Scope & Dates Scope controls where variables can be accessed, while Date helps manage time-based operations in real-world applications. Today I learned: 1️⃣ Scope Types: ✔ Global Scope ✔ Function Scope ✔ Block Scope (let & const) 2️⃣ Hoisting behavior with var, let, and const 3️⃣ Date Object & Methods: new Date(), getFullYear(), getMonth(), getDate(), getHours(), getMinutes() 💻 Problems I Solved: 1️⃣ Create variables in different scopes and test accessibility 2️⃣ Format current date into readable format 3️⃣ Extract specific parts like year, month, and day 4️⃣ Build a simple digital time display logic 5️⃣ Understand hoisting differences between var, let, and const 🚀 THE CHALLENGE: Can you guess the output of the following code? function test(){ var x = 10; } console.log(x); (Drop your answer in the comments! 👇) 💡 Takeaway: Proper scope management prevents bugs and makes code secure. Date objects are essential for scheduling, timers, and real-time applications. 📂 SEE IT IN ACTION I’ve added scope examples and date manipulation scripts on my GitHub. Check out the full repository here: 👉https://lnkd.in/dWS4PPfK #JavaScript #WebDev #GitHub #CodingTips #SoftwareEngineering #WebDevelopment #LearningJourney
To view or add a comment, sign in
-
-
Day 179: Peeling Back the JavaScript Layers 🧅 Today was all about moving beyond "how to code" and diving into how JavaScript actually works under the hood. I spent the day dissecting objects, the prototype chain, and the evolution of asynchronous patterns. 🧬 The Prototype Power I finally stopped looking at __proto__ as a mystery and started seeing it as a roadmap. Understanding how objects inherit properties from their parents—and how we can extend built-in objects with custom methods like getTrueLength()—is a total game-changer for writing dry, efficient code. ⏳ The Async Evolution: Escaping "Hell" We’ve all seen it: the pyramid of doom known as Callback Hell. Today, I practiced refactoring those nested messes into clean Promises and eventually into the sleek, readable Async/Await syntax. It's not just about making the code work; it's about making it readable for the "future me." 👯 Shallow vs. Deep Copy One of the most important lessons today was realizing that the Spread Operator (...) isn't a magic wand for copying. Shallow Copy: Quick and easy, but nested objects are still linked to the original. Deep Copy: Using JSON.parse(JSON.stringify()) to completely sever ties and create a truly independent clone. Key takeaways: Object Mastery: Using Object.values() and hasOwnProperty to navigate data safely. Array Essentials: Re-mastering map, reduce, and Array.from(). The 'New' Keyword: Understanding how it establishes that hidden link to the constructor's prototype. If you’re not understanding the prototype chain, you’re only using 50% of JavaScript’s power! #100DaysOfCode #JavaScript #WebDevelopment #CodingJourney #SoftwareEngineering #AsyncJS #Prototypes #BuildInPublic
To view or add a comment, sign in
-
🚀 New Article Published! If you work with JavaScript or build APIs, JSON is something you interact with every day — but most teams get it wrong in subtle ways that hurt performance and reliability. I just published a deep dive on efficient JSON usage in JavaScript, including: ✅ How JSON really works under the hood ✅ Performance pitfalls common in APIs and backend code ✅ Best practices you can apply today ✅ When to parse, stringify, and when not to 🎥 I also included an accompanying video for visual learners. https://lnkd.in/gUaz5w_S 🔗 Read here: https://lnkd.in/gvVeV443 Whether you’re a backend engineer, full-stack dev, or just want cleaner JavaScript — this one’s for you. Let me know what you think! 👇
To view or add a comment, sign in
-
Why JavaScript doesn't crash when you call a function before defining it. 🧠 I recently dove deep into the "Execution Context" of JavaScript, and the concept of Hoisting finally clicked. If you’ve ever wondered why this code works: greet(); function greet() { console.log("Hello LinkedIn!"); } ...the answer lies in how the JS Engine treats your code before it even runs a single line. The Two-Phase Secret: Memory Creation Phase: Before the "Thread of Execution" starts, JavaScript scans your code and allocates memory for variables and functions. Functions are stored in their entirety in the Variable Environment. Variables (var) are stored as undefined. Code Execution Phase: Now, the engine runs the code line-by-line. Because the function is already sitting in the memory component, calling it on line 1 is no problem! The Key Takeaway: Hoisting isn't "moving code to the top" (that’s a common myth). It’s actually the result of the Memory Creation Phase setting aside space for your declarations before execution starts. Understanding the "how" behind the "what" makes debugging so much easier. #JavaScript #WebDevelopment #CodingTips #Hoisting #ProgrammingConcepts
To view or add a comment, sign in
-
-
Day 56/100 – JavaScript Closures (Mind = Blown 🤯) Today I finally understood something that used to scare me: 👉 Closures in JavaScript At first, the word itself sounded complicated. But when I broke it down… it actually made sense. Here’s what I learned: A closure happens when a function remembers the variables from its outer scope, even after the outer function has finished executing. Read that again slowly. It means JavaScript doesn’t “forget” everything when a function ends. Example mindset: One function creates a variable. Another function inside it uses that variable. Even after the outer function is done… the inner function still remembers it. That’s powerful. Why this matters: ✔️ Helps in data privacy ✔️ Useful in counters ✔️ Important for callbacks ✔️ Used heavily in real-world applications Big realization today: JavaScript isn’t just about writing code. It’s about understanding how memory and scope actually work. Some concepts take time. But once it clicks… it feels amazing. Slowly becoming more confident with the fundamentals 💙 #100DaysOfCode #JavaScript #Closures #WebDevelopment #LearningInPublic #FrontendJourney
To view or add a comment, sign in
-
-
JavaScript Notes to Escape Tutorial Hell (20/20) 🏁 It’s a wrap. 20 Days. 20 Concepts. One Goal: Mastering the Internals. I started this series to document my own journey from "copy-pasting code" to understanding how the JS Engine actually thinks. Today, I’m sharing the Final Compilation. This isn't just a slide deck. It’s a 350+ Page Handbook covering everything we’ve learned, PLUS exclusive new chapters on Promises, Async/Await, and Promise APIs. The Full Roadmap Inside: - The Basics Execution Context, Call Stack, Hoisting - The Tricky Stuff Closures, Scope Chain, this, let vs var - The Architecture Event Loop, Callback Queue, Microtask Queue, JIT Compilation - Functional JavaScript Higher-Order Functions, map, filter, reduce - The Grand Finale Callback Hell, Promises, Async/Await, Error Handling 🔗 Why a Drive Link? The file is massive (high-quality visuals for every concept). LinkedIn won't let me upload it directly. How to get it? 1. Connect (so I can DM you). 2. Comment "Note" below. I’ll send the Google Drive link straight to your inbox. 📩 This series made me fall in love with JavaScript. I hope this handbook does the same for you. #JavaScript #WebDevelopment #CodingResources #SoftwareEngineering #FrontendDeveloper #Promises #AsyncAwait #LearningInPublic
To view or add a comment, sign in
-
Most people think functions "forget" everything once they finish running. Closures change the rules! While revising JavaScript fundamentals today, closures finally made sense to me. Normally, variables are garbage collected after execution. But closures allow inner functions to access outer variables even after the outer function has finished. In simple words, the inner function “remembers” its outer scope. 💬 Why this matters: • Private Variables : Closures let us protect data by keeping variables inaccessible from outside. • Persistent State : They allow functions to remember values without relying on global variables. • Event Handlers : They help UI elements remember what action to perform later. • Modules : They help organize code and prevent naming conflicts in larger applications. What’s one JavaScript concept that recently clicked for you? 👇 #JavaScript #WebDevelopment #Closures #LearningJourney
To view or add a comment, sign in
-
-
Claims about WebAssembly’s speed are everywhere, but the real question is how it compares under load. Jessica Wachtel walks through a hands-on performance test against JavaScript using a Rust-based image processor.
To view or add a comment, sign in
-
Day 9 of 15 – Learn Frontend in 1 Minute Async bugs usually don’t come from wrong logic. They come from wrong assumptions. Most developers assume: “If I write code top to bottom, it will run that way.” That’s not how async JavaScript works. When you fetch data, set a timeout, or wait for user input: -the code starts the task -execution moves on immediately -results come back later This is why: -variables feel “undefined” -state updates feel delayed -logs appear out of order The mistake is expecting async code to behave like sync code. The fix is not memorizing patterns. It’s changing your mental model. Once you accept that async work finishes later, you stop fighting JavaScript—and start predicting it.
To view or add a comment, sign in
-
-
If you've been following along with JavaScript for a while, you've probably used classes. But TypeScript takes class-based development to another level with full type safety and better tooling support. My latest post breaks down TypeScript classes from first principles: 🏗️ Properties and Methods - How TypeScript adds static typing to your class members ⚙️ Constructors - Parameter properties that cut your boilerplate in half 🔍 Instances and Type Safety - Catching errors before they reach production 📐 Real-World Patterns - From user management to shopping carts with type-safe methods The jump from JavaScript classes to TypeScript classes is smaller than you think, but the benefits are massive. Better autocomplete, instant error detection, and refactoring confidence. Whether you're building APIs, frontend components, or data models, understanding TypeScript classes is fundamental to writing maintainable code. Read the full guide: https://lnkd.in/gf43JCeb #TypeScript #WebDevelopment #JavaScript #Programming #SoftwareEngineering #OOP #TypeSafety
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