From just writing code, no.
Now, the question is can we make some kind of formal verification language that forces checks everything and doesn't allow bugs? Maybe?
But that's assuming the underlying hardware and firmware doesn't have flaws that can break those assumptions too.
I remember languages like Casl and vdm, But they where harder to implement and very complex, You mean something like those languages ?
That just shifts bugs up one layer, into the specification that you then verify