Q:

Developers: Debug This! (Post anonymized code snippets)

Up
0

Calling all devs! 🐛💻

Stuck on a gnarly bug? Code working but just feels… off? This is your space to crowdsource a fresh pair of eyes.

How it works:

  1. Post a short, anonymized snippet of your problematic code (remove any client/project identifiers!).

  2. Describe the goal: What should it do?

  3. Describe the issue: What is it actually doing (or not doing)? Share the error message if you have one.

  4. Let the community help! Others can suggest fixes, optimizations, or better approaches.

RULES:

  • ANONYMIZE: Strip out any client-specific logic, API keys, database names, etc.

  • CONTEXT IS KING: Mention the language/framework (e.g., React, Node.js, Python/Django).

  • BE SPECIFIC: “It doesn’t work” isn’t helpful. “Returns null when the API response is valid JSON” is.

Example Post:

  • Language: JavaScript

  • Goal: Function to filter an array of users and return those active in the last 7 days.

  • Issue: Returns an empty array [] even when there are matching users. No error.

  • Snippet:

    javascript
    function getRecentUsers(users) {
      const oneWeekAgo = new Date() - 7 * 24 * 60 * 60 * 1000;
      return users.filter(user => new Date(user.lastActive) > oneWeekAgo);
    }

Drop your snippet below and let’s debug together!

  • You must be logged in to reply to this topic.