<p>I am constantly having to learn new things in order to teach them, so I am in this situation regularly.  If I were to teach myself from scratch, I would do a mix of essentially 4 things:</p>
<ol>
<li>My own projects</li>
<li>Premade problems (such as your textbook examples)</li>
<li>Tutorials</li>
<li>Deeper dives into whatever aspect of the language interested me at that moment</li>
</ol>
<p>All four of the activities work together in tandem.  They expand your horizons in different ways, but also have different caveats:</p>
<ol>
<li><strong>My own projects:</strong> these push your ability to figure things out, research, and get things moving. This is where you will experience much of your long-term grown. As an aside, I agree with one of the commenters that a project that doesn't bear fruit is still very valuable.  Many of the reasons for why languages are the way they are, and why we do things the way we do, is borne of the collective pain of projects that failed, and most of those practices won't (can't, really) make sense in your own mind until you've lived through some of the problems yourself.  (Can't figure out why we care about clear variable names?  Wait until you try to make sense of code that you yourself wrote just 7 months ago, and you will suddenly wish that you had left a clearer breadcrumb trail for yourself.)</li>
<li><strong>Premade problems:</strong> these are, essentially, <em>curated study</em>, and if properly organized, will allow you to explore at least a few topics with assurance that you'll visit all is the most important parts of those topics.  (In essence, you will learn at least some things <em>well</em>). (BTW, free or paid courses also fit into this category, and paid courses with instructor feedback are essentially this, but on crazy steroids.)</li>
<li><strong>Tutorials</strong> can get you moving rapidly outside of your knowledge and comfort zone, which is wonderful.  One caveat is that many tutorials on YouTube are, for whatever reason, given by self-learners. Ad a result, there is a lot of very messy code out there under the guise of &quot;tutorials&quot;.  So absolutely look to them to get you moving into new areas and pull you out of ruts, but treat the programming practices you see as somewhat suspect.   You'll find higher-quality information in the textbooks and on stack overflow.</li>
<li><strong>Deeper dives into whatever aspect of the language interested me at that moment:</strong> these are your <em>&quot;strike while the iron is hot&quot;</em> moments.  You learn the most when your are highly motivated, so if something catches your fancy as especially fascinating, jump on it and see what you can grab from the internet's firehose of information.  You may not understand everything you find, but even that is useful, since it sets you up knowing more areas to be explore later.</li>
</ol>
<p>Once you get to the point where you can consistently make small-to-medium sized projects with a fair amount of success, more avenues of growth will open up to you as well.  At some point, you will really need to start getting feedback in order to continue your growth, but you can get yourself up and running without it at the start.</p>

CC BY-SA 4.0
2021-11-28T19:57:49.327Z
2021-11-28T19:57:49.327Z
Ben I.
<p>I often introduce new constructs &quot;in context&quot; by asking a question akin to, &quot;Wouldn't it be useful if....?&quot;   For example, I might introduce dictionaries in this way.</p>
<p>Suppose you are performing an experiment such as tossing a fair coin until a head appears and you are interested in running the experiment 1,000,000 times to see what the distribution looks like.   You don't know right off what range of outcomes you might get, so wouldn't it be useful if, instead of using a list, you are able to index a tally on an arbitrary collection of integers.</p>
<p>A dictionary is handy:  you can enroll an outcome in the dictionary by executing</p>
<pre><code>tally[outcome] = 1
</code></pre>
<p>and you can increase its tally with</p>
<pre><code>tally[outcome] += 1
</code></pre>
<p>In this way, you don't have to worry about creating a list in advance large enough to accommodate such a tally.  This tally-making pattern is useful in a variety of contexts.</p>

CC BY-SA 4.0
2021-11-28T14:29:31.020Z
2021-11-28T14:29:31.020Z
ncmathsadist
<p>Strictly, there is no clear answer. It depends on both you as a student, and what you intend to achieve. If the goal is to learn how to develop software, and you are someone who can learn from practical experience, then yes.</p>
<blockquote>
<p>So I am currently doing textbook styled programming learning. I am reading a chapter. Then solving all programming examples</p>
</blockquote>
<p>This is perfectly fine too, and can definitely help you get started and find the lay of the land quicker. There are some things that you're only really going to learn the hard way and not from a book; but you'll eventually bump into those regardless of whether you used a book or not.</p>
<p>Generally speaking, development lends itself well to practical learning, because most (if not all) of development is something we created because we wanted to get to a certain goal. That is precisely what practical learning teaches you, and that's why it tends to work very well here.</p>
<p>Personally speaking, if you teach me the theory first, I tend not to really learn from it. I need to work at something, be stumped by it, and <em>then</em> look up the theory behind it. When my mind has an active question, it registers the answer so much better than when you try to explain something that I don't yet know if I need it. But that's for me personally.</p>
<blockquote>
<p>my goal is to get a web developer job. so mugging up is right?</p>
</blockquote>
<p><strong>Most definitely</strong>. I may be biased here because I am much better at backends than frontends; but web development, specifically visual layouting, is something that you very much have to learn by trying over and over to get it to look the way you want it to.<br />
Guidance and mentoring definitely helps you get there, but you will definitely also need to learn how to shuffle things around when they're not looking quite right, and that's something you learn from experience more than explanation.</p>
<blockquote>
<p>And what types of projects should I start with. Don't say hangman etc because I can barely code leap year program in python or any other languages.</p>
</blockquote>
<p>You're comparing apples and oranges here. Don't confuse difficult programming with having difficult rules.</p>
<p>Leap year calculation is difficult <em>regardless</em> of whether you're programming it or writing an explanation in English. It's just a really contrived rule set. Having a complex rule set is making things more difficult for you to also learn programming at the same time.</p>
<p>It would be much better to program something which you already innately understand. This means that your mental effort can be focused on how to express what you already know (in English) in code, which is what programming is.</p>
<p>The rules of Hangman are easy to explain in English. If that doesn't apply to you, pick something else that you know very well. The best example are games that young children can play, as these games inherently have a simple set of rules that is easy to remember. Tic Tac Toe, Hangman, even just something silly like &quot;guess what number I'm thinking of&quot; (and I'll tell you if it's higher or lower) would be perfectly fine.</p>
<p>As long as you understand the rules of the game (or application), and know precisely what it should do (when explaining it in spoken language), you can break down most things.</p>
<p><strong>The core skill of a programmer is more in the breaking down of a complex problem into smaller and easier ones than it is in writing the code itself.</strong></p>
<p>Of course you first need to learn the code basics to get started, but you can make myriad games and applications using a very limited set of programming basics under your belt. If you know:</p>
<ul>
<li>Read user input</li>
<li>Write output to the console</li>
<li>Using variables (integers, strings, booleans)</li>
<li>Simple mathematical operations (<code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>, <code>%</code>)</li>
<li>Conditionals (<code>if</code>)</li>
<li>Arrays (or any type of &quot;list&quot; in your language of choice)</li>
<li>Iterations (<code>while</code>, <code>for</code>, <code>foreach</code>)</li>
</ul>
<p>You can create pretty much any game for children.</p>

CC BY-SA 4.0
2022-01-09T13:05:56.383Z
What a well-written Answer! I love it. Perhaps we could put it right out in front of potential students somehow. A little sanity at the beginning goes a long way.
Scott Rowe
CC BY-SA 4.0
2021-11-29T15:45:18.417Z
2021-11-29T15:51:55.723Z
2021-11-29T15:51:55.723Z
Flater
<p>Yes, learning by doing projects is an excellent way to learn programming (and problem solving through programming). Unfortunately the skill to create a good project and the skill to write a program for solution of it are completely different problems. The former skill replies heavily on already having deep knowledge of the latter.</p>
<p>So, your problem is in coming up with problems and you don't have the skill to do that yet and probably won't for a long time if you are still having issues with the syntax and semantics of a programming language.</p>
<p>I don't have a good Python reference for you, but in Java there is a website called <a href="https://greenroom.greenfoot.org/door" rel="nofollow noreferrer">The Greenroom</a> that describes lots of projects. Any of those could be adapted (conceptually) to Python, though with difficulty.</p>
<p>There is one other difficulty, however, and that is that when you make up your own projects and then build them, you may wander too much from the ideal when things get hard since there is not real standard to work towards. If you could find someone experienced in creating <em>useful</em> projects who would feed them to you it would help.</p>
<p>In my own case, I once found a book that described a few projects (in Fortran) that formed the early basis of my programming education: <a href="https://www.worldcat.org/title/computing-problems-for-fortran-solution/oclc/409611" rel="nofollow noreferrer"><em>Computing Problems for Fortran Solution</em> by Teague</a>. I think it would be hard to get a copy of it, but the problems themselves can be solved in other languages.</p>
<p>Note that I've found that the best projects for beginners are those that come with a fair amount, maybe a lot) of already built code, providing a framework for the student in which to work. Starting with a blank page is very difficult when you are still learning.</p>

CC BY-SA 4.0
2021-11-27T05:58:51.103Z
that book is not available currently neither in pdf nor anywhere in nepal(only popular books are available here in nepal that too if you have luck unless they get sold already). Can you guide me a short very short roadmap to learn python and get a web developer job?
zemvua
CC BY-SA 4.0
2021-11-27T06:26:48.490Z
I am currently learning from a textbook and an udemy course of python for absolute beginners plus lots of stackoverflow and articles as you know. I am learning sth and starting to feel confident about my basics, but I am not sure if this is right way. I am solving every programming exercises, mcqs, print the output types of programs. Is this correct way to master the basics? At the moment, my goal is to just master the basics.
zemvua
CC BY-SA 4.0
2021-11-26T14:38:39.557Z
2021-11-26T15:38:46.693Z
2021-11-26T15:38:46.693Z
Buffy
<p>I tried learning by  making projects, but found myself in a place where I would mug up things rather than learning anything.</p>
<p>So I am currently doing textbook styled programming learning. I am reading a chapter. Then solving all programming  examples, maybe programming assignments, if I am interested, some mcqs as well. And find the output kind of exercises to familiarize myself with python.</p>
<p>Is this right approach? Till now I am actually learning stuffs as my base is very strong. But is this sustainable? If I go on doing this, I will have my own python documentation tbh. Is this right approach? I am sceptical. Please guide. Also why didn't I learn by making projects? After what point of time of learning programming should I stumble into making projects? And what types of projects should I start with. Don't say hangman etc because I can barely code leap year program in python or any other languages.</p>

CC BY-SA 4.0
2021-11-27T15:13:35.017Z
Welcome to CSE! What are your goals in programming? _"I tried learning by making projects, but found myself in a place where I would mug up things rather than learning anything."_ -- what makes you think mugging things up isn't educational? Can you provide more details about the projects you've tried and mugged up? Thanks.
ggorlen
CC BY-SA 4.0
2021-11-28T07:43:42.740Z
my goal is to get a web developer job. so mugging up is right??
zemvua
CC BY-SA 4.0
2021-11-28T14:24:21.740Z
Yes, the point of projects is to struggle and learn from the failures as well as the successes, right? (assuming I'm understanding "mugging" correctly). If your goal is to be a web developer, then you'll definitely need to write many project applications (since that's essentially the job). I wouldn't let a few failed attempts affect you. Keep coding and moving forward and you'll eventually build the portfolio you want.
ggorlen
<self-learning>
Is learning programming by doing projects right way to learn programming
# Is learning programming by doing projects right way to learn programming

(Asked by: username_0 on 2021-11-26)

I tried learning by making projects, but found myself in a place where I would mug up things rather than learning anything.

So I am currently doing textbook styled programming learning. I am reading a chapter. Then solving all programming examples, maybe programming assignments, if I am interested, some mcqs as well. And find the output kind of exercises to familiarize myself with python.

Is this right approach? Till now I am actually learning stuffs as my base is very strong. But is this sustainable? If I go on doing this, I will have my own python documentation tbh. Is this right approach? I am sceptical. Please guide. Also why didn't I learn by making projects? After what point of time of learning programming should I stumble into making projects? And what types of projects should I start with. Don't say hangman etc because I can barely code leap year program in python or any other languages.

**Tags:** self-learning

> **Comments:**
> **username_1**: Welcome to CSE! What are your goals in programming? _"I tried learning by making projects, but found myself in a place where I would mug up things rather than learning anything."_ -- what makes you think mugging things up isn't educational? Can you provide more details about the projects you've tried and mugged up? Thanks.  
> **username_0**: my goal is to get a web developer job. so mugging up is right??  
> **username_1**: Yes, the point of projects is to struggle and learn from the failures as well as the successes, right? (assuming I'm understanding "mugging" correctly). If your goal is to be a web developer, then you'll definitely need to write many project applications (since that's essentially the job). I wouldn't let a few failed attempts affect you. Keep coding and moving forward and you'll eventually build the portfolio you want.  

---

## 4 answers

### Answer by username_4 on 2021-11-29. Score: 3

Strictly, there is no clear answer. It depends on both you as a student, and what you intend to achieve. If the goal is to learn how to develop software, and you are someone who can learn from practical experience, then yes.

> So I am currently doing textbook styled programming learning. I am reading a chapter. Then solving all programming examples

This is perfectly fine too, and can definitely help you get started and find the lay of the land quicker. There are some things that you're only really going to learn the hard way and not from a book; but you'll eventually bump into those regardless of whether you used a book or not.

Generally speaking, development lends itself well to practical learning, because most (if not all) of development is something we created because we wanted to get to a certain goal. That is precisely what practical learning teaches you, and that's why it tends to work very well here.

Personally speaking, if you teach me the theory first, I tend not to really learn from it. I need to work at something, be stumped by it, and *then* look up the theory behind it. When my mind has an active question, it registers the answer so much better than when you try to explain something that I don't yet know if I need it. But that's for me personally.

> my goal is to get a web developer job. so mugging up is right?

**Most definitely**. I may be biased here because I am much better at backends than frontends; but web development, specifically visual layouting, is something that you very much have to learn by trying over and over to get it to look the way you want it to.  
Guidance and mentoring definitely helps you get there, but you will definitely also need to learn how to shuffle things around when they're not looking quite right, and that's something you learn from experience more than explanation.

> And what types of projects should I start with. Don't say hangman etc because I can barely code leap year program in python or any other languages.

You're comparing apples and oranges here. Don't confuse difficult programming with having difficult rules.

Leap year calculation is difficult *regardless* of whether you're programming it or writing an explanation in English. It's just a really contrived rule set. Having a complex rule set is making things more difficult for you to also learn programming at the same time.

It would be much better to program something which you already innately understand. This means that your mental effort can be focused on how to express what you already know (in English) in code, which is what programming is.

The rules of Hangman are easy to explain in English. If that doesn't apply to you, pick something else that you know very well. The best example are games that young children can play, as these games inherently have a simple set of rules that is easy to remember. Tic Tac Toe, Hangman, even just something silly like "guess what number I'm thinking of" (and I'll tell you if it's higher or lower) would be perfectly fine.

As long as you understand the rules of the game (or application), and know precisely what it should do (when explaining it in spoken language), you can break down most things.

**The core skill of a programmer is more in the breaking down of a complex problem into smaller and easier ones than it is in writing the code itself.**

Of course you first need to learn the code basics to get started, but you can make myriad games and applications using a very limited set of programming basics under your belt. If you know:

* Read user input
* Write output to the console
* Using variables (integers, strings, booleans)
* Simple mathematical operations (`+`, `-`, `*`, `/`, `%`)
* Conditionals (`if`)
* Arrays (or any type of "list" in your language of choice)
* Iterations (`while`, `for`, `foreach`)

You can create pretty much any game for children.

> **Comments:**
> **username_5**: What a well-written Answer! I love it. Perhaps we could put it right out in front of potential students somehow. A little sanity at the beginning goes a long way.  

---

### Answer by username_6 on 2021-11-26. Score: 3

Yes, learning by doing projects is an excellent way to learn programming (and problem solving through programming). Unfortunately the skill to create a good project and the skill to write a program for solution of it are completely different problems. The former skill replies heavily on already having deep knowledge of the latter.

So, your problem is in coming up with problems and you don't have the skill to do that yet and probably won't for a long time if you are still having issues with the syntax and semantics of a programming language.

I don't have a good Python reference for you, but in Java there is a website called [The Greenroom](https://greenroom.greenfoot.org/door) that describes lots of projects. Any of those could be adapted (conceptually) to Python, though with difficulty.

There is one other difficulty, however, and that is that when you make up your own projects and then build them, you may wander too much from the ideal when things get hard since there is not real standard to work towards. If you could find someone experienced in creating *useful* projects who would feed them to you it would help.

In my own case, I once found a book that described a few projects (in Fortran) that formed the early basis of my programming education: [*Computing Problems for Fortran Solution* by Teague](https://www.worldcat.org/title/computing-problems-for-fortran-solution/oclc/409611). I think it would be hard to get a copy of it, but the problems themselves can be solved in other languages.

Note that I've found that the best projects for beginners are those that come with a fair amount, maybe a lot) of already built code, providing a framework for the student in which to work. Starting with a blank page is very difficult when you are still learning.

> **Comments:**
> **username_0**: that book is not available currently neither in pdf nor anywhere in nepal(only popular books are available here in nepal that too if you have luck unless they get sold already). Can you guide me a short very short roadmap to learn python and get a web developer job?  
> **username_0**: I am currently learning from a textbook and an udemy course of python for absolute beginners plus lots of stackoverflow and articles as you know. I am learning sth and starting to feel confident about my basics, but I am not sure if this is right way. I am solving every programming exercises, mcqs, print the output types of programs. Is this correct way to master the basics? At the moment, my goal is to just master the basics.  

---

### Answer by username_2 on 2021-11-28. Score: 2

I am constantly having to learn new things in order to teach them, so I am in this situation regularly. If I were to teach myself from scratch, I would do a mix of essentially 4 things:

1. My own projects
2. Premade problems (such as your textbook examples)
3. Tutorials
4. Deeper dives into whatever aspect of the language interested me at that moment

All four of the activities work together in tandem. They expand your horizons in different ways, but also have different caveats:

1. **My own projects:** these push your ability to figure things out, research, and get things moving. This is where you will experience much of your long-term grown. As an aside, I agree with one of the commenters that a project that doesn't bear fruit is still very valuable. Many of the reasons for why languages are the way they are, and why we do things the way we do, is borne of the collective pain of projects that failed, and most of those practices won't (can't, really) make sense in your own mind until you've lived through some of the problems yourself. (Can't figure out why we care about clear variable names? Wait until you try to make sense of code that you yourself wrote just 7 months ago, and you will suddenly wish that you had left a clearer breadcrumb trail for yourself.)
2. **Premade problems:** these are, essentially, *curated study*, and if properly organized, will allow you to explore at least a few topics with assurance that you'll visit all is the most important parts of those topics. (In essence, you will learn at least some things *well*). (BTW, free or paid courses also fit into this category, and paid courses with instructor feedback are essentially this, but on crazy steroids.)
3. **Tutorials** can get you moving rapidly outside of your knowledge and comfort zone, which is wonderful. One caveat is that many tutorials on YouTube are, for whatever reason, given by self-learners. Ad a result, there is a lot of very messy code out there under the guise of "tutorials". So absolutely look to them to get you moving into new areas and pull you out of ruts, but treat the programming practices you see as somewhat suspect. You'll find higher-quality information in the textbooks and on stack overflow.
4. **Deeper dives into whatever aspect of the language interested me at that moment:** these are your *"strike while the iron is hot"* moments. You learn the most when your are highly motivated, so if something catches your fancy as especially fascinating, jump on it and see what you can grab from the internet's firehose of information. You may not understand everything you find, but even that is useful, since it sets you up knowing more areas to be explore later.

Once you get to the point where you can consistently make small-to-medium sized projects with a fair amount of success, more avenues of growth will open up to you as well. At some point, you will really need to start getting feedback in order to continue your growth, but you can get yourself up and running without it at the start.


---

### Answer by username_3 on 2021-11-28. Score: 1

I often introduce new constructs "in context" by asking a question akin to, "Wouldn't it be useful if....?"   For example, I might introduce dictionaries in this way.
Suppose you are performing an experiment such as tossing a fair coin until a head appears and you are interested in running the experiment 1,000,000 times to see what the distribution looks like.   You don't know right off what range of outcomes you might get, so wouldn't it be useful if, instead of using a list, you are able to index a tally on an arbitrary collection of integers.
A dictionary is handy:  you can enroll an outcome in the dictionary by executing
tally[outcome] = 1

and you can increase its tally with
tally[outcome] += 1

In this way, you don't have to worry about creating a list in advance large enough to accommodate such a tally.  This tally-making pattern is useful in a variety of contexts.


---

