Showing 20 problems with active filters

Debounce vs Throttle - What's the difference?

I keep seeing debounce and throttle functions in JavaScript libraries. What's the difference between them? When should I use debounce vs throttle? Can someone provide simple implementations of both w...

David Miller Programming intermediate 1205 0 72

Understanding Python decorators

I see @decorator syntax in Python code but I don't understand how decorators work. Can someone explain with examples?...

Jennifer Lee Programming intermediate 758 0 45

What is Object-Oriented Programming?

I keep hearing about OOP but I don't understand encapsulation, inheritance, and polymorphism. Can someone explain?...

James Wilson Programming beginner 1105 0 73

How does garbage collection work?

How does garbage collection work in languages like Java and Python? How does it know when to free memory?...

Tom Harris Programming advanced 407 0 28

SQL JOIN types explained with examples

I always mix up the different types of SQL JOINs. Can someone explain with clear examples: - INNER JOIN - LEFT JOIN - RIGHT JOIN - FULL OUTER JOIN - CROSS JOIN What's the difference and when would I...

Patricia Johnson Programming beginner 1651 0 112

Understanding Promise.all vs Promise.allSettled

I'm confused about when to use Promise.all() vs Promise.allSettled() in JavaScript. From what I understand: - Promise.all() fails fast if any promise rejects - Promise.allSettled() waits for all prom...

Jennifer Lee Programming intermediate 955 0 56

What is *args and **kwargs in Python?

I see *args and **kwargs in Python function definitions but I don't understand what they mean. ```python def my_function(*args, **kwargs): pass ``` Can someone explain with examples?...

James Wilson Programming beginner 1307 0 78

Understanding pointers in C

Pointers in C are confusing me. What exactly is a pointer and why do we need them?...

Lisa Park Programming intermediate 475 0 27

How to reverse a string in JavaScript?

I need to reverse a string in JavaScript. For example, "hello" should become "olleh". I've tried using a for loop but my code isn't working: ```javascript function reverseString(str) { let reverse...

Mike Johnson Programming beginner 1643 0 89

Python list comprehension vs map/filter

When should I use list comprehension vs map() and filter() in Python? For example, these seem to do the same thing: ```python # List comprehension squares = [x**2 for x in range(10)] # map squares ...

Emma Wilson Programming intermediate 940 0 54

How to optimize slow SQL queries?

My SQL query is running very slow on a large table (millions of rows). The query: ```sql SELECT * FROM orders WHERE customer_id = 12345 AND created_at > '2024-01-01' ORDER BY created_at DESC; ``` ...

Lisa Park Programming intermediate 950 0 54

Understanding Docker basics

What is Docker and why is it useful? How is it different from virtual machines?...

Rachel Martinez Programming beginner 878 0 58

Deep copy vs Shallow copy in JavaScript

I need to copy an object in JavaScript, but changes to the copy affect the original object. What's happening? ```javascript const original = { name: 'John', address: { city: 'NYC' } }; const copy = {...

Lisa Park Programming intermediate 1052 0 61

Understanding Python generators and yield

I'm confused about Python generators. What's the difference between: ```python def get_numbers(): return [1, 2, 3, 4, 5] def get_numbers_gen(): yield 1 yield 2 yield 3 yield 4 ...

Daniel Kim Programming intermediate 820 0 48