I think it is perfectly fine when it works for you. Also advice for programmer is different then one for newbie.
One big issue with "just do something" is that people are unable to come up with suitable "something". So they don't even start. Building "something" is motivating for some people, but definitely not for all or majority.
Also, people who never coded are pretty much guaranteed to drown in own mess if they attempt to do "something". They will end up with tangled spaghetti they will be unable to make work and they will not know what their issue is.
I realize it's probably not the best way to learn, there's the chance of not learning a simpler or better method. But I personally just don't have the attention span to read through books or take online courses.