This exists: it's called declarative programming (more on that here.)

The general idea is this, though: you describe what you want, rather than how to get it (you can think of the code more as a...