This is an interesting topic to chat about sometimes. (hint hint) I completely get how you think the two 'mentalities' of yours contradict.
There is nothing inherently wrong with 'defensive programming'. It is part of your job description as lead developer to see potential problems before they arise and predict to some extent what the future could bring.
I would like to suggest though that you stop calling it defensive programming and call it anticipatory programming or something.
Anticipatory programming takes the negative vibration of defensiveness and turns it into something positive; the suggestion that you know what you're doing. You take the future into account even when developing in/for the present.
wrote some stuff about it, good place to start.
My coding paradigm: some poor bastard is going to have to work with this some day, and it will probably be me. Code accordingly.
Seriously, experience is a good teacher. It's not always the deciding factor, but it is something to listen to.
Yes, there’s no replacement for experience. :) The challenge I find as a senior dev is how to help give junior devs the opportunity to fail safely so they too can gain experience. It’s a tough balancing act. :/
Assume the next person to look at your code is a psychopath and knows where you live
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.