The problem is that if you are actually do know best, everybody else has to make that mistake and learn, and while doing so, is halting progress that could be made in the right direction.
In my world as a software developer, I've found that if my group of colleagues and the boss has very different culture and skills than you do, it's very hard or impossible to influence change. Because the entire group would have to be on the same level of technical experience OR have enough respect for titles or experience to follow someone else, in order for progress to happen.
I agree with you, it is important to let the person fail and learn. But sometimes, this can be costly and fixing it may be hard.
My approach is to ask the person question and understand what is the objective trying to be achieved, and hope with the answers given, the person realize it is doing a mistake.
I also hope that the person respect my experience and is able to learn from my mistakes and do not need to do the same mistakes in order to learn.
But I do not always succeeds in these endeavors. Once a colleague was developing some page objects for Selenium tests and creating classes with only one attribute, which was the full URL of the page. Of course tests would not word when executed in several environments and to have this files were useless. But to fix exactly this, I saw it required more knowledge on OO design than a simple talk could give.
The problem with Socratic questioning is that it assumes a teacher-student type of relationship, or at least a superior-subordinate one.
If that's not the case, and once someone recognizes what it is that you're doing, they may become rightly offended at the arrogance you're displaying by choosing the teacher role for yourself.
“Socratic questioning” implies only a collegial relationship. If you cannot walk over to a colleague and ask them questions about their work without them getting offended, your office politics are extremely unhealthy.
Or else you are probably wearing an expression of disapproval when you ask them these questions. If you go in with an honest “I want to learn and understand” stance, normal people will generally be happy to answer.
Of course you can and should always ask your colleagues questions in order to understand their point of view and way of thinking.
But that's not what Socratic questioning is. It is specifically when you ask pointed questions, pretending that you don't know the answer already, in order to make the student work out the line of thinking herself, or perhaps force her to flesh out her thinking more completely.
It's more about making the askee think than transferring information. As such, trying to mask that behind "I'm just asking questions" is rude.
I have the understanding from experience that people will always give a reason for doing something that I could not imagine.
So 1st, make questions, understand what is the objective with that code you see on screen.
2nd, make more questions too see if other use cases were considered.
3rd, there are best practices, literature that provide a common way of working, discuss how to apply this.
There are no ways of understanding without making questions.
On this specific case, besides the lack of OO design knowledge, there were also a misunderstand on the page object pattern , how web apps are build and what is the web app and what is part of the browser.
And this is why I also talk with my team on my ideas to develop something before or while developing it. It should not be a surprise, no matter how nice and commented the code is.
You can go into a session like this with your mind made up and still legitimately ask these questions. This questioning should hopefully show the other party why they are wrong or show you why they are correct. Either is a great outcome and the questions are the same either way.
I think that 1st we have to understand that to solve this, every solution is slow.
1st I send some links on OO designs and SOLID principles.
2nd I made a few comments on the code review that tacked more real problem like maintenance, change of URL since we were still in development phase and other pages and dialogs that do not have a URL and how this mixed with the rest that have.
3rd was to have design discussion pior development - which we did not have.
For last, some hours during week with the whole team to talk on design and coding, in order to have evryone on a similar level of knowledge.
This is so spot on it hurts. At my last job, everyone was going about building things completely wrong, and to them it was completely normal! I found it very difficult to work with them because they didn't view me as their superior, so they weren't receptive to me teaching them anything, and whenever I would suggest an idea on a design, they wouldn't have any opinions because they didn't know any better.
They would often times ask me to explain why it should be done one way or another, and have me to it in a 30 minute meeting. In reality, it would take us reading a few volumes of computer science text books before they had enough knowledge to understand where I'm even coming from.
The article describes a situation where your co-worker is potentially doing something unproductive, and how you can get them to change.
The situation where your own boss is making a mistake, and you yourself have to carry out their instructions is much trickier, as you might find yourself being blamed for the inevitable poor outcome.
In my world as a software developer, I've found that if my group of colleagues and the boss has very different culture and skills than you do, it's very hard or impossible to influence change. Because the entire group would have to be on the same level of technical experience OR have enough respect for titles or experience to follow someone else, in order for progress to happen.