Logo
Logo
Home
Archive
AI Agent Notes
Advertise
YouTube
Login
Sign Up
Logo
  • Home
  • Posts
  • 🦥 How To Ask Better Programming Questions

🦥 How To Ask Better Programming Questions

Dec 4, 2024

Hello friends!

Welcome to this week’s Sloth Bytes (late edition).

🦥 No selling out today

I am genuinely considering selling feet pics, so if you work at a company with a marketing budget please forward this to your boss immediately or the feet come out.

Save yourself and learn more about sponsoring

Baby sloths are born with everything

Giphy

Baby sloths are born with their eyes open, their claws sharp, and their teeth fully formed. They don’t really have a development period.

The Art of Asking Better Programming Questions

One day you’ll have to ask a question about programming, and when that day happens you’re going to waste time because you don’t know how to ask it.

Let me save you the embarrassment and help you create better questions.

You can also use these when asking AI questions.

The XY Problem: What Not To Do

❌ "How do I detect if a user has stopped typing?"

✅ "I'm implementing a search that should only call the API when the user finishes typing. This is my current code: "

Always explain your end goal - you might be solving the wrong problem!

The Perfect Question Formula

  1. Context First

❌"My code isn't working. Help!"

✅"I'm building a Python web scraper that needs to handle pagination. Currently using BeautifulSoup. The first page works, but it breaks on page 2. Here's my code: … "

  1. Show Your Work

❌"I can't get my sorting to work. What's the best way to sort?"

✅ "I'm trying to sort a list of dates, here’s what I’ve tried:

dates = ['2024-01-01', '2023-12-31'] 
sorted_dates = sorted(dates)

It’s not working as expected:

#Expected
['2023-12-31', '2024-01-01']
#Actual
['2024-01-01', '2023-12-31']
  1. Include Error Messages

❌ "I'm getting some weird error about None or null or something"

✅ I’m getting the following error

TypeError: 'NoneType' object is not subscriptable at line 23: data['users']

Where to Ask Questions

  1. Stack Overflow

    • Tag properly

    • Use code formatting

    • Include minimal reproducible example

  2. GitHub Issues

    • Search closed issues first

    • Follow issue templates

    • Include package versions

  3. Discord/Slack

    • Use code blocks

    • Right channel/thread

    • Be patient

  4. ChatGPT of course

Question Checklist

  • Did you search for existing answers?

  • Did you Include environment details?

  • Did you Add relevant code?

  • Did you described expected vs actual?

  • Did you format properly?

  • Did you proofread for clarity?

Red Flags in Your Question

❌ "Can anyone help?"

❌ "URGENT!!!"

❌ "It's not working"

❌ "Here's 300 lines of code"

❌ "Fix this for me"

Writing Good Question Titles

❌ "JavaScript help needed"

❌ "URGENT: Code not working!!!"

✅ "TypeError when accessing nested JSON in Express middleware"

Real-World Examples

Before:

Help! Code not working! var x = [1,2,3] need to make bigger

After:

I need to append elements to array in JavaScript I have an array:

const x = [1,2,3] 
// I tried
x.add(4)
//But I keep getting this error
// x.add is not a function
//Expected output: x should now be [1,2,3,4]

Environment: JavaScript (Node v16)

Additional tips

  1. Screenshot errors if they're visual

  2. Recreate the error

  3. Update your question with solutions you've tried

  4. Answer your own question if you solve it!

Remember

  • Every great developer started as a beginner

  • Clear questions save everyone's time

  • Good questions build your reputation

  • Teaching others reinforces your knowledge

If you want to keep learning

  • Get better at programming without writing more code — improve by reading code, reviewing decisions, and explaining concepts out loud.

  • Debugging techniques — gather the context, reproduce the problem, and isolate it before asking someone else to save you.

  • How to write good code comments — practice explaining the why behind code clearly and concisely.

  • How to contribute to open source — put those communication skills to work in issues, pull requests, and real codebases.

Advent of Code Has Started!

World Labs' AI can generate interactive 3D scenes from a single photo (4 minute read)

Fei-Fei Li's World Labs has announced its first project: an AI system that can generate video game-like, 3D scenes from a single image.

The Browser Company teases Dia, its new AI browser (4 minute read)

The Browser Company, the company behind Arc Browser for both desktop and mobile, teased its new web browser called Dida.

Why we switched to Astro (and why it might interest you) (10 minute read)

Follow the first article of a series in which we'll try to summarize our journey with Astro, sharing many cool little tricks and details we found out (or totally came up with) in the process.

Raspberry Pi 4 vs Pi 5: What's Changed? (7 minute read)

The good-old Raspberry Pi 4 or the newer Raspberry Pi 5? Let's know the differences to decide better.

Thank you to everyone who submitted 😃 

RelyingEarth87, Viidka, JamesHarryT, pyGuy152, sonvalle, agentNinjaK, dropbearII, ravener, GiantMango, pavan-15-hub, and last one:

Invert Colors

Create a function that inverts the rgb values of a given list

Examples

color_invert([255, 255, 255])
output = [0, 0, 0]
# [255, 255, 255] is the color white.
# The opposite is [0, 0, 0], which is black.

color_invert([0, 0, 0])
output = [255, 255, 255]

color_invert([165, 170, 221]
output = [90, 85, 34]

Notes

  • Must return a list.

  • 255 is the max value of a single color channel.

How To Submit Answers

Reply with

  • A link to your solution (github, twitter, personal blog, portfolio, replit, etc)

  • or if you’re on the web version leave a comment!

That’s all from me!

Have a great week, be safe, make good choices, and have fun coding.

If I made a mistake or you have any questions, feel free to comment below or reply to the email!

See you all next week.

Keep Reading

Read all
arrow-right
envelope-simple

Join 50k+ developers and become a better programmer and stay up to date in just 5 minutes.

© 2026 Sloth Bytes.
beehiivPowered by beehiiv