Re:Dynamic Programming is not Black Magic
by glimshe on Sunday January 14, 2024 @06:54AM
(#38989627)
Most of the time I hear the term being used by other people (not you :) ), I feel it's for showing off and look smarter than everybody else - "Look, I used dynamic programming to solve that problem", when in fact they were just employing what I'd consider the natural and intuitive approach for solving the problem. There was nothing they actually "used", besides happening to identify that the problem could be broken into progressively smaller subproblems.
[ Parent
| on HN ]
Well aren’t you cynical.
> happening to identify that the problem could be broken into progressively smaller subproblems.
Which is what dynamic programming is about. And no, not everyone is capable to do that, especially since not all problems solved at work are Leetcode.
Sometimes people really have to spend hours or days to understand how to split a problem. Only then optimizations can be applied or become "obvious".
Like usual, solutions are "so obvious" when someone has done a lot of heavy lifting to simplify the problem, improve the context, etc.
Re:Dynamic Programming is not Black Magic
by bcrosby95 on Sunday January 14, 2024 @10:56AM
(#38991554)
Do you feel similarly if someone says they used an iterative, recursive, or greedy algorithm?
Dynamic programming is a whole chapter in CLRS - a book which many of us used when we got our computer science degree. It's not about showing off, it's the name of the technique.
Re:Dynamic Programming is not Black Magic
by throwaway2037 on Sunday January 14, 2024 @10:23PM
(#38997127)
As I interpret the GP, the person is peacocking or gate-keeping by (humble)bragging about using dynamic programming to solve a problem. For all we know, they Googled for an efficient algorithm and copied the result. I have done it before, and I have no shame about it. If a teammate asks me how I knew about that dynamic programming algorithm, I would reply: "Are you joking? I could never program that myself. Thank you Google." Except for a few algorithms, most are solved using iterative or recursive.