This subject is not for everybody immediately clear on Stack Overflow, so I'd like to write a few words from experience.
Once I've just asked what you propose in your question:
https://stackoverflow.com/questions/24279377/best-practices-for-forming-javascript-library
So have a look what's happened:
- Some people found the question good, so it got upvoted.
- More people (with more experience) marked the question as opinion based. RobG friendly invited me to rephrase the question so that it would be more concrete, with more context and so on.
- Some people gave answers that, by luck, were great for me.
- Then the question got closed.
That time, I gave it some thoughts but I didn't find a way to really improve the question.
Today, I understand that this question doesn't belong to Stack Overflow (as Yannis commented), but it belongs to the Programmers forum. There, you find all that tell-me-your-experience-questions, which is a wonderful enrichment for everybody who is under the real pressure of productive software development, where the results do count and the tactical errors can bring you in serious troubles.
Today, I think I can draw a better boundary and hence I could write a new question that would be accepted. Here is the boundary:
REJECTED:
"What are best practices to refactor some methods into a library?"
ACCEPTED:
"I'm trying to refactor some methods into a library like this:
...code...
Now can't get rid of that error:
...error...
I debugged and found that the XY in fact has the YZ as it should, so I'm puzzled.
Does somebody see what's wrong here?"
But, as you can see, the new question is not of the same depth. It doesn't belong to SO.
In order to ask questions with more dimensions that need some experience, I'm enrolling to the programmers forum soon.
Having all this said, I'd like to suggest that people that comment questions in SO as off-topic write some short but concrete hints where the question belongs to. It took me some time to discover that there are many forums on Stack Exchange and to see that there are even several technical and/or scientific forums.
So instead of writing a comment like this:
"This is off topic. Doesn't belong here. - TheDummyName"
better write:
"This belongs to (Link to forum). Go and ask there. - TheDummyName"
Like this, some people willing to learn would adapt faster.
Finally, yes, I agree with you. If you browse through literature for programmers, you'll find much literature for easy subjects, that can be handled with a few lines, and you'll find much less about many-layer, multidimensional complex matter that has no thumb rules but needs tactical thinking to make the right decisions. I'm seeing the same. So if you make some great experience, if you find out something, consider writing an article :-) I cannot count how much I have learnt by articles and texts that are contributions of other people, I feel grateful sometimes. For this reason alone, I'd like to participate and enrich the amount of knowledge somehow.
Hope that helps :-)