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.