Navin Lamsal

· 0 hour ago·

Debugging Like a Pro: Tips and Tricks I Use Daily

Debugging is not just about fixing code—it’s about understanding your system, improving your thinking, and becoming a more mindful developer. In my experience, every bug has a story to tell, and if you listen carefully, you’ll come out smarter on the other side. Below, I’m sharing the real-life strategies I use every day that help me squash bugs faster and smarter.

1. Reproduce the Error Consistently

Before jumping into fixes, I always try to reproduce the issue consistently. Whether I’m working on a frontend app or a backend service, repeating the bug under the same conditions helps eliminate randomness.

  • If it's a UI bug: I replicate the same screen, input, and user actions.
  • If it’s backend: I test the API or function with the same payload or sequence of requests.

This step alone often reveals edge cases I hadn’t considered.

🧠 Pro Tip: Always note the environment (dev/staging/production) where the bug occurs—it could be environment-specific.

2. Read the Error Message (Yes, Really!)

It sounds simple, but reading the full error message carefully has saved me more time than any tool. Stack traces often point to:

  • The file and line number
  • The function name
  • Sometimes even the specific variable or argument that failed

Rather than just Googling the error code, I try to understand what the message is saying. This is especially important for framework-specific errors (like React or Django) that can seem cryptic at first.

🧠 Pro Tip: Look one level above the line where the error happens—it’s often the real culprit.

3. Use Breakpoints and Step Debugging

Console logs are great, but debuggers are better.

In tools like VS Code, I use breakpoints to pause my app at key points. This lets me inspect:

  • Local variable values
  • The call stack
  • Conditional logic flow

You can even set conditional breakpoints to stop only when a variable reaches a specific value.

🎯 Why it matters: Debuggers give you precise insight into what your app is doing at runtime, helping you understand why things go wrong.

4. Smart Console Logging

When I do use console.log(), I try to be strategic about it:

  • I label logs with clear tags (e.g., console.log('[API RESPONSE]', data)).
  • I log only what’s relevant to the bug.
  • I use console.group() and console.table() for structured logging.

This makes it easy to scan output, especially in large applications where too much logging becomes noise.

🧠 Pro Tip: Remove or comment out your debug logs once the issue is fixed. It keeps your codebase clean.

5. Check Network Activity & DevTools

When dealing with frontend bugs, I rely heavily on browser DevTools, especially the:

  • Network tab to inspect API requests and responses
  • Console tab for JavaScript errors
  • Application tab for cookies and local storage values

For instance, a login issue might not be in your UI code—it might be a 401 error from the API due to expired tokens or wrong headers.

🧠 Pro Tip: Use tools like Postman or cURL to test APIs outside your app. It narrows down whether the issue is in the backend or frontend.

6. Rubber Duck Debugging

Yes, I’ve literally explained bugs out loud to a stuffed toy once or twice.

“Rubber duck debugging” works because it forces you to slow down and explain your logic, often revealing the flaw. Even if no one else is listening, just articulating the issue in words can shift your mental gears.

Better yet, explain it to a real human who has no idea what you’re working on.

🧠 Pro Tip: If you can’t explain it clearly, you probably haven’t understood it well enough.

7. Use Git Like a Time Machine

One of the most underrated debugging tools is Git.

I often use:

  • git diff to spot what's changed
  • git bisect to find the exact commit where a bug was introduced
  • Reverting small chunks to check if they affect the issue

This is particularly useful when working on large teams, where code changes come from many people.

🧠 Pro Tip: Make small commits with clear messages. It makes debugging way easier later.

8. Take Breaks When You’re Stuck

If I’ve stared at the screen for more than 30 minutes and made no progress, I stop. I walk away, stretch, drink coffee—anything away from the screen.

You’d be surprised how often the solution hits me once I stop actively thinking about it.

🧠 Pro Tip: If the bug is super stubborn, describe the problem in a note or message to someone—even if you never send it. You might solve it halfway through writing it down.

Other Blogs

Placeholder Image
My Journey into IT: From HTML Templates to Real-World Projects

When I wrote my first lines of HTML, I had no idea where it would take me. At that moment, I was simply trying to make something appear on a screen: a heading, a button, a layout. But those small snippets of code turned into a lifelong passion and opened the door to a career in tech that I had never imagined.

This is my journey from simple college assignments to building real-world applications, working with startups, and stepping into the world of backend development.

The First Step: HTML Templates

Every developer remembers their first project. For me, it was a basic HTML and CSS template, a few sections pieced together with some styling. It wasn’t much, but when I opened it in a browser and saw something I had created, it was a moment of pure joy.

That was enough to spark my curiosity. I started learning more: basic JavaScript, layout frameworks, and eventually, React.js. React completely changed how I looked at web development. Components made sense. I loved the modularity, the logic, and the way it brought my UI to life.

Building My First React E-commerce Platform

As I got comfortable with React, I decided to challenge myself with something bigger, an e-commerce platform. This wasn’t just another template. I built product pages, a working shopping cart, dynamic routing, and even a basic checkout logic. I pulled real data from APIs and learned to manage state using React hooks and context.

This project taught me that it’s not just about writing code, it’s about crafting a good user experience, where functionality and design come together to solve real problems.

Collaboration & Growth: A Crowdfunding Platform in College

During my college years, I teamed up with two classmates to build a crowdfunding platform as our semester project. It was the first time I worked on a serious team-based software project.We split the responsibilities frontend, backend, and planning and together we created features like campaign creation, user accounts, funding dashboards, and admin controls. It was messy. It was challenging. And it was one of the best learning experiences I’ve ever had.

This was the project that taught me about real-world architecture, clear communication, and the magic of teamwork.

Startup Internship: 9 Months of Real-World Exposure

After college, I knew I needed real industry exposure. I joined a startup as an intern, and over the next 9 months, I worked on both internal tools and client projects alongside experienced developers.

Here’s what I gained:

  • Writing clean, maintainable code that others could understand
  • Mastering version control with Git — pull requests, branching, conflict resolution
  • Adapting to agile workflows, task management, and meeting deadlines
  • Communicating within cross-functional teams

It was a crash course in professionalism — and it made me realize how much I still had to learn, and how exciting that was.

Joining MoreTech Global: Scaling Up

Next, I joined MoreTech Global, where I had the opportunity to work on larger, technically advanced projects. Here are a few highlights:

  • Hotel Reservation Platform: Built with Django, complete with check-in/check-out logic, guest reviews, and admin dashboard.
  • Video Conferencing App: A Zoom-like platform using WebRTC (React + Go), real-time signaling, and peer-to-peer video chat.
  • Headless E-commerce CMS: React + Strapi integration for dynamic content, media uploads, and category-product relationships.

These projects taught me about performance optimization, scalability, and the importance of clean UI/UX architecture in modern applications.

My Next Step: Learning Backend with Python

Now, I’ve started the next phase of my journey — diving into backend development with Python.

After years of working on the frontend and full-stack collaboration, I realized how important it is to understand what happens behind the scenes. I want to build APIs, manage databases, and understand authentication, session management, and server architecture at a deeper level. Python has been a great language to start with — it’s elegant, beginner-friendly, and extremely powerful. I’m currently exploring:

  • Flask & Django for web backend
  • PostgreSQL and MongoDB for database management
  • REST API design
  • Authentication & Authorization systems
  • Basic DevOps practices (CI/CD, Docker, etc.)

And I’m loving every bit of it.

What I’ve Learned Along the Way

Here are a few key lessons I’ve picked up so far:

  • Start simple. Build up. You don’t need to master everything at once. Just take the first step.
  • Work with others. Team projects teach you more than tutorials ever could.
  • Learn by doing. Real understanding comes when you build something real not just follow a course.
  • Keep adapting. Tech is always evolving. Stay curious. Keep exploring.

What’s Next?

As I continue learning Python and backend development, I’m also focusing on performance optimization, better database handling, and building apps with real-world use cases.

If you’re just starting in tech, here’s what I want to say:
Just build something. It doesn’t have to be big or perfect. Just take the first step — you’ll figure out the rest along the way.

If you’re working on something cool, want to collaborate, or just want to chat about tech, feel free to reach out. I’m always open to learning, sharing, and growing together. 🙌

Thanks for reading my story!

Placeholder Image
Exploring Tech Categories: A Glimpse into the Future

In the fast-paced world of technology, staying updated with the latest trends and innovations is crucial. From artificial intelligence to virtual reality, the tech landscape is diverse and ever-evolving. In this blog, we'll take a closer look at some key tech categories that are shaping the future and explore mock-up blogs to give you a sneak peek into the exciting world of prototypes.

Artificial Intelligence (AI):

AI is revolutionizing various industries, from healthcare to finance. Mock-up blog: "AI Unleashed: Transforming Industries with Smart Solutions" - A glimpse into how AI is streamlining processes and enhancing decision-making.

[@portabletext/react] Unknown block type "image", specify a component for it in the `components.types` prop

Internet of Things (IoT):

The interconnected web of devices is changing the way we live and work. Mock-up blog: "Living in a Connected World: Exploring the IoT Revolution" - An overview of how IoT is creating smart homes, cities, and industries.

Augmented Reality (AR) and Virtual Reality (VR):

AR and VR are transforming how we perceive and interact with the digital world. Mock-up blog: "Beyond Reality: The Rise of AR and VR Experiences" - A showcase of immersive technologies and their impact on entertainment, education, and more.

Cybersecurity:

As technology advances, the need for robust cybersecurity measures becomes paramount. Mock-up blog: "Guardians of the Digital Realm: Navigating the Cybersecurity Landscape" - An exploration of the latest trends in cybersecurity and how they protect against evolving threats.

Sustainable Tech:

Tech for a better planet is gaining momentum. Mock-up blog: "Green Tech Revolution: Innovations for a Sustainable Future" - A look at eco-friendly technologies and their role in creating a more sustainable world.

Quantum Computing:

The next frontier in computing is quantum. Mock-up blog: "Quantum Computing Demystified: A Leap into the Future" - An introduction to the world of quantum computing and its potential to solve complex problems.

Conclusion:

The tech world is a dynamic and exciting space, with innovations in various categories pushing the boundaries of what's possible. These mock-up blogs provide a glimpse into the diverse topics within the tech landscape, sparking curiosity about the future and the possibilities that lie ahead. Stay tuned for more in-depth explorations into each of these categories in upcoming blogs!

view more blogs

Placeholder Image
5 Essential Tools Every Developer Should Know in 2025

In the ever-evolving landscape of software development, tools play a vital role in productivity, collaboration, and code quality. Choosing the right set of tools can significantly enhance your workflow and help you stay competitive. Based on my personal experience and industry trends, here are five tools every developer should master in 2025.

1. Visual Studio Code (VS Code)

VS Code has become a universal favorite among developers. It's a powerful yet lightweight source code editor developed by Microsoft

Why I Use It:

  • Seamless integration with Git and GitHub
  • Rich extension ecosystem (like Prettier, ESLint, Live Server)
  • IntelliSense for smart code completion
  • Built-in terminal and debugger

VS Code also allows remote development and integrates well with Docker and WSL, making it a versatile choice for both beginners and professionals.

2. GitHub Copilot

GitHub Copilot, powered by OpenAI, is an AI coding assistant that suggests lines or blocks of code as you type. It has redefined how developers approach programming.

Why I Use It:

  • Speeds up repetitive coding tasks
  • Offers instant help when stuck on logic
  • Great for exploring alternative ways to solve problems

It’s like pair programming with an AI assistant that never sleeps

3. Postman

Postman is the go-to tool for API testing and collaboration. Whether you're developing or consuming APIs, it provides a user-friendly interface for sending requests and analyzing responses.

Why I Use It:

  • Supports REST, GraphQL, and SOAP
  • Easily automate test cases with scripting
  • Environment and collection management for complex workflows

For modern web apps, knowing Postman well is a game-changer

4. Docker

Docker helps developers containerize applications, making deployment smoother and more consistent across environments.

Why I Use It:

  • Eliminates “it works on my machine” issues
  • Lightweight and fast to spin up environments
  • Perfect for microservices and DevOps workflows

Containers are the present and future of software deployment. Docker makes them easy.

5. ESLint

Code quality matters, and ESLint is essential for maintaining it in JavaScript projects. It flags errors and enforces coding standards automatically.

Why I Use It:

  • Prevents runtime errors early
  • Promotes clean and readable code
  • Customizable rules to match your team's preferences

These tools aren’t just trendy—they're reliable, powerful, and widely adopted in the industry. Mastering them can make your development process faster, cleaner, and more efficient.

Placeholder Image
AI in Everyday Life: Unveiling the Wonders of Artificial Intelligence

Artificial Intelligence (AI) is no longer confined to the realm of science fiction; it has become an integral part of our daily lives. From personalized recommendations on streaming platforms to voice-activated virtual assistants, AI is seamlessly woven into the fabric of modern technology. In this blog, we'll delve into the diverse facets of AI, exploring its applications that touch us in ways we might not even realize.

AI in Personal Assistants:

Mock-up blog: "Your Virtual Sidekick: How AI-Powered Personal Assistants Simplify Your Life" - This blog offers insights into how AI-driven virtual assistants anticipate your needs, manage your schedule, and provide real-time information, making your daily tasks more efficient.

AI in Healthcare:

Mock-up blog: "Healing with Algorithms: The Role of AI in Revolutionizing Healthcare" - Discover how AI is transforming the healthcare landscape, from diagnostic tools that analyze medical images to personalized treatment plans based on predictive analytics.

AI in Education:

Mock-up blog: "Smart Learning: AI's Impact on Education and Lifelong Learning" - Explore how AI is reshaping education through adaptive learning platforms, personalized tutoring, and intelligent assessments, creating a more engaging and effective learning experience.

AI in E-commerce:

Mock-up blog: "Beyond the Cart: The AI-Powered Shopping Experience" - Uncover the ways AI enhances the online shopping journey, from product recommendations to chatbots providing instant customer support, creating a more personalized and enjoyable shopping experience.

AI in Finance:

Mock-up blog: "AI and Your Finances: Navigating the Future of Financial Technology" - Examine how AI is revolutionizing the financial sector, from robo-advisors making investment decisions to fraud detection systems ensuring the security of your transactions.

AI in Entertainment:

Mock-up blog: "Entertainment Redefined: The Impact of AI on Movies, Music, and Gaming" - Dive into the world of AI-generated content, virtual influencers, and personalized entertainment experiences that cater to individual tastes and preferences.

As we navigate the intricacies of our daily lives, AI stands as a silent yet powerful force, enhancing our experiences across various domains. This blog provides a snapshot of the pervasive influence of AI in shaping the world we live in, offering a glimpse into the exciting possibilities that lie ahead as artificial intelligence continues to evolve. Stay tuned for more in-depth explorations into the fascinating intersections between AI and our everyday existence.

Placeholder Image
Importance of Cybersecurity in Everyday Coding

Why Every Line of Code Should Be Written with Security in Mind

In today’s hyperconnected world, cybersecurity is no longer optional—it’s a core responsibility of every developer. Whether you’re working on a small script, a mobile app, or a production-level backend system, your code is a potential entry point for attackers. The mindset of “it won’t happen to me” is dangerous. Every data breach you hear about—whether it’s leaked passwords, credit card theft, or app takeovers—often begins with a tiny piece of insecure code.

Over the years, I’ve learned to integrate secure coding practices into my everyday workflow. Below are some crucial habits and tools I follow to write safer, more robust code.

1. Always Validate and Sanitize Input

Every input from users should be treated as a potential threat.

User input is one of the most common attack vectors, especially in web applications. If you're not validating and sanitizing inputs, you're essentially handing your database or DOM over to malicious users.

I follow a two-layered approach:

  • Validation: Ensure the input is of the correct type, format, and length (e.g., email, phone number, password).
  • Sanitization: Remove or escape dangerous characters to prevent attacks like:
    • SQL Injection
    • Cross-Site Scripting (XSS)
    • Command Injection

Don’t rely on client-side validation alone—it’s easily bypassed. Always validate on the server side too.

2. Secure Your APIs and Routes

Not all users should see all routes.

For every route or API endpoint, I apply:

  • Authentication: Verifies who the user is (e.g., login systems with JWT, OAuth, or session-based auth)
  • Authorization (RBAC): Verifies what the user is allowed to do (e.g., admins vs. regular users)

I structure access control rules based on roles and permissions. A good rule of thumb: assume users can and will try to access everything so lock it down and use middleware to enforce access rules globally across your routes.

3. Never Store Passwords in Plain Text

Plaintext passwords are a ticking time bomb.

When building authentication systems, I always:

  • Hash passwords with strong algorithms like bcrypt (or argon2)
  • Use a unique salt for each password to prevent rainbow table attacks
  • Enforce strong password policies (minimum length, complexity, etc.)
  • Add two-factor authentication (2FA) for extra protection when possible

Remember: if your database is ever compromised, hashed passwords are your last line of defense and Avoid MD5 or SHA1—they’re outdated and vulnerable to fast brute-force attacks.

4. Manage Secrets the Right Way

Never hardcode your API keys, tokens, or database credentials.

I keep all secrets in environment variables using .env files during development, and secure secret managers in production (e.g., AWS Secrets Manager, Azure Key Vault, HashiCorp Vault).

Why it matters:

  • Hardcoded secrets can leak via version control
  • Leaked secrets = instant compromise of systems (payment gateways, cloud storage, etc.
  • Add .env and .env.local to your .gitignore to prevent them from being committed.

5. Keep Dependencies Up-to-Date

Old libraries are often full of known exploits.

As projects grow, so does your list of dependencies. Unfortunately, many popular packages have vulnerabilities that attackers know about.

I make it a habit to:

  • Run npm audit or yarn audit regularly
  • Use GitHub’s Dependabot or other auto-updating tools
  • Subscribe to security mailing lists of major frameworks I use
  • Before installing a package, check the last update date and open issues on GitHub. Don’t use abandoned libraries.

Final Thoughts: It Only Takes One Oversight

You don’t need to be a cybersecurity expert to write secure code—but you do need to be aware. A single vulnerable input or exposed token can be exploited by bots or attackers.

Cybersecurity isn’t a one-time fix—it’s a habit, a discipline, and a team responsibility. Make it part of your daily coding routine, and you’ll build applications that are not only functional but also resilient and trustworthy.

© 2024 Navin Lamsal