If it works out for you, who am I to judge you?
But in my case it didn't work out even though I had a separate room in the house set up for this specific task. I had to abandon this arrangement as my productivity and social life suffered and went out looking for a small office to rent and set up accordingly.
I have also tried some coworking spaces but I felt there was something missing and I was not getting the full deal of this approach.
I guess also I'm very conditioned to the usual morning rituals to prepare for the day from washing up, having breakfast, dressing and leaving the house to work. I could not really escape this routine and it took a toll on me till I moved to my cozy office and started to see a markedly increase in my productivity and social life well being.
So, at the end of the day it boils down to personal preferences and what suits and suits not an individual.