Footgun
ELI5 — The Vibe Check
A feature or tool that makes it really easy to shoot yourself in the foot — meaning it's easy to make a mistake that hurts you. Like a function that deletes everything if you forget one argument. Languages and APIs can be full of footguns.
Real Talk
A footgun is a programming feature, API, or tool that is prone to misuse, leading to bugs or unintended consequences. JavaScript's == (loose equality) and PHP's type juggling are classic examples of language footguns.
Show Me The Code
// JavaScript footgun:
0 == '' // true 🤯
0 == '0' // true 🤯
'' == '0' // false 🤯
// Use === instead!
When You'll Hear This
"That API is a total footgun — one wrong parameter and it wipes the database."
Related Terms
Anti-Pattern
Anti-Pattern is the opposite of a design pattern — it's a commonly used approach that looks like it solves a problem but actually makes things worse.
Bug
A bug is anything in your code that makes it behave wrong.
Error Handling
Error handling is the art of planning for things to go wrong and dealing with them gracefully instead of letting everything catch fire.