If you’re a mathematician or physicist and you solve a problem wrong, your paper won’t tell you.
But it’s comparatively easy to spot errors (or dead ends) as you go, and then you try to find ways of fixing them (which is harder). It seems similar to programming in this respect, maybe the greatest difference is that in programming you often work with a vast code base, and the problems can occur because of its peculiar properties you knew nothing about (or have long forgotten). Also, debugging is typically much easier in terms of cognitive load (while design can get challenging).
But it’s comparatively easy to spot errors (or dead ends) as you go, and then you try to find ways of fixing them (which is harder). It seems similar to programming in this respect, maybe the greatest difference is that in programming you often work with a vast code base, and the problems can occur because of its peculiar properties you knew nothing about (or have long forgotten). Also, debugging is typically much easier in terms of cognitive load (while design can get challenging).
It takes discipline, and it seems to only fit a certain type of mind, but test-driven development will let you spot errors as you go.