26

I'd like to ask a question about a particular issue I have when trying to improve my knowledge of programming languages. Specifically, once I have a working knowledge of a language, I find it hard to expand my repertoire because I'm comfortable creating suboptimal code with the tools I already know.

Asking for "good ways to do something" seems inherently opinion-based, but perhaps in a different way from "what is the best x?", so I'm unsure whether it's acceptable. Is this something I should ask about here, or is it best directed elsewhere?

18
  • 51
    Generally such questions aren't going to be well received; they are often opinionated or lack focus. Stack Overflow isn't a learning resource, it's a Q&A site. If you want to learn something, then tutorial website, online learning tools, articles and documentation are what you want.
    – Thom A
    Commented Mar 18, 2022 at 11:06
  • 7
    If you want to specifically ask how to improve specific code, that might be on topic, but you would certainly need to ensure you've done your due diligence first. There is also Code Review, but this is not me suggesting you just post there; take their tour first.
    – Thom A
    Commented Mar 18, 2022 at 11:08
  • 4
    @Larnu okay, thanks. I mainly have experience in the Maths StackExchange, where such questions are still not meant to be asked, but tend to be decently well-received. Glad I checked on here before asking :)
    – Qwertiops
    Commented Mar 18, 2022 at 11:09
  • 3
    "how to learn" might even be more opinion-based than "what is the best x".
    – VLAZ
    Commented Mar 18, 2022 at 11:17
  • 4
    Instead of asking "How to learn X?", ask "How to do X?", but try to narrow the scope of X as much as possible (which would require a non-trivial amount of previous research, which should be evident in the question itself). Although the question is different, you'll end up "learning" nonetheless.
    – yivi
    Commented Mar 18, 2022 at 11:22
  • 2
  • Generally there are many ways to learn: observing, doing exercises, .... You probably thought about recommendations how to best learn specific subjects, not general advice how to learn? Specific recommendations are off-topic. General advice may not be specific to programming. Just be open and reflect about what you're doing and always try to improve yourself and read a lot. Commented Mar 18, 2022 at 14:07
  • 2
    In general, if you are trying to find ways to make an off-topic question fit the rules of the site - just stop and post it somewhere else. Even if you're a word smith and manage to write something that passes a first review, it is still in the end an off-topic question in disguise and it'll reveal itself after it has been posted. From what I can tell you don't need to ask a question though, you need a good book which is seen as the standard for the language. Sometimes that book exists in online form too on the site of the language itself.
    – Gimby
    Commented Mar 18, 2022 at 15:02
  • 3
    @Larnu Yes, Stack Overflow is a learning resource. What's the point of Q&A if no-one learns from it? Just because SO has more rules than other sites doesn't mean that you can't learn here. I've learned a lot by participating in the SO community, and yes, by reading questions and answers that other people have already posted (important point there). Also, using others' code and examples to figure out your own coding problems is good brain exercise. Commented Mar 18, 2022 at 18:28
  • 4
    You can learn from the questions, yes, but it's not a learning resource, @SylvesterKruin . These are different things. You don't visit Stack Overflow to learn, you visit it to answer a question.
    – Thom A
    Commented Mar 18, 2022 at 18:34
  • 4
    @Larnu The first half of that last sentence is definitely not true for me. Quoting the tour: Remember: we're all here to learn (under the Improve posts by editing section). The tab name for Stack Overflow is Stack Overflow - Where Developers Learn, Share & Build Careers. It's even encouraged to answer your own question; what purpose has that besides helping others learn? But I want to know how you would word it; if a Q&A site is not a learning resource, than what is it? Not just a place to hang out. Commented Mar 18, 2022 at 18:51
  • 4
    I think the problem you two are having is a difference of opinion on "learning resource". Larnu is approaching the term more from a "teaching resource" point of view. Stack Overflow is definitely for learning, but it's sucks <expletive deleted> at teaching because teaching is too open-ended. Commented Mar 18, 2022 at 18:55
  • 2
    Apart from the obvious objections to that type of question that would justify closing it (needs detail, needs more focus, opinion-based, seeking recommendations), it implicitly "does not show any research effort". While that is not a reason to close the question, it is certainly a reason to downvote it. I don't see how you could ask such a question without showing a lack of research effort, because if it did show research effort it would no longer be about how to learn something.
    – skomisa
    Commented Mar 18, 2022 at 19:00
  • 3
    Have you read "What topics can I ask about here?". The writing style of that article is loose and informal, and it may do a poor job of explicitly excluding certain types of questions. But after reading that I find it impossible to believe that questions in the form you proposed could possibly come close to being on topic.
    – skomisa
    Commented Mar 18, 2022 at 19:15
  • 1
    One of the fundamentals is simply "learning how to learn". Which boils down to "what level of understanding is required".Pick a subject and ultimately you should at least have been exposed to both during education and your command of the knowledge is reflected in your grades. When you get into the professional realm, whether that be in coding, engineering, law, medicine, what have you, you must demonstrate a mastery of the topic. The top of the cognitive-taxonomy chart. Most of the "good ways to do something" or "which way is best" seek help on how to learn and what knowledge level is needed. Commented Mar 20, 2022 at 8:18

2 Answers 2

32

If you read through the comments to this question you get the vibe "its probably off topic" - I would nonetheless answer with a frame challenge.

Instead of asking "how to get better at X" - which is off-topic, too broad, etc. you can use Stack Overflow to get better.

Pick a language of your choice, put it into [...] in the search bar.

Sort by Score:

UI picture

Now you get the most high voted questions in that language. Pick any 10 of them starting at the top and study them really hard. Read the questions, read the answers - then re-read them. If you know them by heart - pick another 10.

more UI pics

Do that for half a year and you'll grow out of being comfortable creating sub-optimal code and you will improve ... without needing to ask off-topic questions.

You may even get comfortable enough with good and highly voted questions that you can answer / pose your own. Using/teaching what you know will help improve your skills as well.

8
  • Nice way to optimize the resources and purpose of SOF Commented Mar 19, 2022 at 17:11
  • 3
    not what you were asking for at all, but I'd recommend doing this but with open-source projects as well as SO questions. Pick your favorite project and start off by following a few issues & pull requests along to see how that goes. Check out the contributor guide and try to add to the project documentation. Once you get the hang of that, try to start tackling small changes. In settings like that you'll often find people eager to bring in new contributors. If a project is too busy/daunting, find a smaller one that's still under active development. have fun! Commented Mar 19, 2022 at 17:51
  • 3
    Worth pointing out that you can also enter combinations of tags - for example [python][email] if you want to focus on a particular areas within a language. Commented Mar 19, 2022 at 18:35
  • 2
    Well yes, if you "study them really hard", you will surely learn something, but I'm not convinced that using upvotes is a useful criterion, and nowhere close to the best way to invest your time. I just sorted [java] questions by vote. Eighth on the list, with 3,876 votes (!!!) was Proper use cases for Android UserManager.isUserAGoat()? I suspect there's little correlation between the number of upvotes for a question and its value as a teaching tool. Also, many highly upvoted questions are very old, and not necessarily even relevant now.
    – skomisa
    Commented Mar 19, 2022 at 19:02
  • 2
    @Skomisa - should be easy to spot those if you are already a budding dev in that language - skip those. High voted questions often are old and often also cover topics that many people run into and voted on. But I agree, you should not stop thinking while looking at those. Commented Mar 19, 2022 at 19:55
  • 1
    @PatrickArtner Fair enough. A possible variation on your suggestion: among the highly upvoted questions, find ones that you can't answer which require code for a solution. Then study so that you can provide an answer, with code to prove it. Here's an example: How do I read / convert an InputStream into a String in Java? got 4,489 upvotes and 62 answers. A Java novice wouldn't know, and most (but not all) experienced Java developers would. The bottom line: rather than just studying, learn by studying and by doing.
    – skomisa
    Commented Mar 19, 2022 at 21:05
  • 1
    Maybe also pay attention to people who post high quality/well received answers and learn from them. This can take a bit more knowledge and time to filter out well received that might not be of high quality.
    – QHarr
    Commented Mar 20, 2022 at 0:00
  • 2
    Good advice. Studying the code of good coders can improve your own style. And don't just read their code, play with it. Try making small changes and adding extra features.
    – PM 2Ring
    Commented Mar 20, 2022 at 0:22
7

It is pretty clear that your question is really about "How to learn" rather than "Programming". As such it is off-topic for Stack Overflow.

The question of "how to learn" is best addressed by professional psychologists and/or educators who have actually studied different ways of learning knowledge, behaviors and so on. Stack Overflow is not about these things, and the people who would try to answer questions like this on Stack Overflow tend to have (at best) rudimentary understanding of the science of learning and of educational theory and practice.

The question would (possibly) be on-topic on the SE site for Computer Science Educators. In general, questions about self-learning are on-topic there, though as @kaya3 commented:

"Questions there are still expected to be not either too broad or so narrowly personalised that they would be useless to anyone other than the original asker, but many "how can I learn X?" questions can be asked there."

The question might also be on-topic on the Workplace SE site if you were asking this from the perspective of improving your skills on the job.


As for the specifics of the question that you apparently want to ask:

  1. You probably want advice that is tailored to you. Unfortunately, that is difficult on a Q&A site. You probably need to have a face-to-face conversation with someone who knows you and your style of working.

  2. Based on what you wrote in the question ("Specifically, once I have a working knowledge of a language, I find it hard to expand my repertoire because I'm comfortable creating suboptimal code with the tools I already know.") ... it seems that you already know what the root cause of your problem is. If you are correct, then (to my mind) the solutions are self-evident:

    • Learn to be uncomfortable with creating suboptimal code: be more self critical, and do something about.
    • Get someone to code review your work and/or mentor you; i.e. find someone who will help you feel more uncomfortable.
    • Stop looking for a "magic bullet". Learning takes effort. Becoming a better programmer takes effort.

    But the flip-side is that "suboptimal" isn't always a bad thing. Often, the most important thing is getting the job done (the outcome), not doing the job in the most efficient way possible. This applies both to the code itself, and the processes involved in creating and maintaining the code.

1
  • 4
    "The question would possibly be on-topic on a site for Computer Science Educators, though (technically) it is about learning rather than teaching." Just to add to this: there is a CS Educators Stack Exchange where questions about self-learning are on-topic. Questions there are still expected to be not either too broad or so narrowly personalised that they would be useless to anyone other than the original asker, but many "how can I learn X?" questions can be asked there.
    – kaya3
    Commented Mar 21, 2022 at 3:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .