A design pattern that defines a family of algorithms, encapsulates each one, and makes them interchangeable at runtime. It allows the algorithm to vary independently from the clients that use it, promoting flexibility and code reusability.
Named after military strategy where different tactics can be chosen based on battlefield conditions, first documented in the Gang of Four book (1994). The pattern emerged from the need to avoid large conditional statements and make algorithms pluggable.
The Strategy pattern is like having different driving routes to work - you can choose highway, scenic, or fastest route depending on traffic conditions, and your GPS app doesn't need to be rewritten for each new route option! Payment processing is a perfect example: credit card, PayPal, or cryptocurrency are just different strategies for the same goal.
Complete word intelligence in one call. Free tier — 50 lookups/day.