Stephen Krashen is a pretty good researcher on this - the summary is that exposure to the language for time (e.g. 500 hours of content you just about understand) is the critical factor. This is training non-conscious parts of your brain's neural network.
Some people like understanding the grammar and structure of a language consciously, and it can help as a mnemonic aid for anyone. But it isn't necessary, or the critical process.
Also, if you're looking for entertaining reading in your target language, grammar books are going to be interesting to you. The goal during language learning is to find interesting content that you understand, and your target language's grammar is a known hobby of yours.
In this claim you implicitly say that you are focusing on "learning by memorizing grammar" if you do not are focusing on "learning by example" - hence the dichotomy, that is false.
The parent commenter never talked about grammar.
I don't follow you. I did not claim that focusing on grammar was a literal opposite of anything. I claimed that in my case "repetitive learning by example" turned out to be less boring than "repetitive learning by memorizing grammar".
In order to translate a randomly generated (thus never seen before, non-memorized) sentence from one language to another you have to understand the grammar in order to create a valid combination of words for your translation.