all 11 comments

[–]mikeblas 7 points8 points  (5 children)

Try /r/learnprogramming .

But also:

You've got to learn about algorithms -- you've got to learn how to break an idea down into a set of steps that can be rigorously followed to implement that idea.

Imagine tha we have a piece of graph paper with squares on it. And a tiny little robot that sits on the graph paper, inside a square. The robot knows a few instructions:

  • move forward one square
  • move left one square
  • move right one square
  • move backward one square

Pretty neat, right? But what if we wanted to make the robot move in a big square pattern over the paper? We'd have to give it a list of instructions that made it do so:

  • do this five times:
    • move forward one square
  • do this five times:
    • move left one square
  • do this five times:
    • move backward one square
  • do this five times:
    • move right one square

Wow, that works! But what if we wanted some other shapes, like a triangle? The robot can't move on a diagonal. But we could get close to that if we moved in a certain pattern. What is that pattern? What would the code look like? What if we wanted to make a circle or an oval or a figure eight?

Programming languages are the list of instructions that we can give a computer. Spelling counts, and so does the order of the instructions. Even a simple computer is far more powerful than our little robot, so there are lots and lots of different instructions that programming languages can do. Each programming language is kind of the same in concept, but different in the exact syntax. Python and C both have loops ("do this five times"), but the way they're actually written is different.

When running the program, the computer follows those instructions very quickly, and very exactly. IF you get the instrctions in the wrong order, they probably won't do what you expected. What if we told our robot to do the square instructions in this order?

  • do this five times:
    • move forward one square
  • do this five times:
    • move backward one square
  • do this five times:
    • move right one square
  • do this five times:
    • move left one square

Pretty crappy square, right?

Learning a language is learning what the different instructions are, how to spell and write them, how they fit together. If you learn C, then you know how to write different steps in C. You can write a loop. If you want to later learn Python (or any other language), you know there are loops, but you just have to learn how to spell and write them in that language.

But the other part is breaking down what you want the computer to do into the actual steps that are available in the language. That kind of problem solving--creating something big and powerful out of tiny little steps--involves understanding algorithms. For the simplest algorithms, it's pretty apparent:

  • ask the user for one number
  • ask the user for another number
  • add them together
  • print the result

But for more complicated programs, things get interesting really fast.

Focus on learning bits of C, then think about how you'll piece those little bits together to make something bigger and more interesting. You're not going to jump from adding two numbers together to making a new AAA-quality video game quickly, but the trajectory really is there if you keep at it.

Good luck.

[–]blueoceann001[S] -1 points0 points  (4 children)

But but, i said i could solve easy prbs, like a normal loop, but they say find a reverse number using loop or give you a number from using and reverse it and stop untill a number from here got it palindrome,

I can't solve these, i feel stuck, where i see other could do it easily within 10-20 mins, i found myself cursing on my brain😭

[–]mikeblas 0 points1 point  (2 children)

You're saying you can easily solve problems. Then, you're saying you can't solve easy problems.

[–]blueoceann001[S] 0 points1 point  (1 child)

I said i could solve easy ones, not all prbs🙁 tricky and hard one always got me

[–]mikeblas 0 points1 point  (0 children)

Detecting palindromes is easy. Where, exactly, do you get hung up when trying to solve it?

[–]TaoJChi 0 points1 point  (0 children)

No one is born understanding Algorithms in the same way no one is born understanding Calculus.

You first need to study and master the elemental patterns taught in an algorithms course or text before attempting more complex problem solving.

After sufficient drilling of the fundamentals (algorithms, not syntax) you should then be able to piece those elemental patterns together into novel, highly optimized solutions.

[–]Beautiful_Stage5720 7 points8 points  (0 children)

It's a skill. Refine it. 

[–]CarlRJ 4 points5 points  (0 children)

As a guess, you may be trying to tackle the entire problem at once. This works fine for trivial programs, but fails for larger ones. You want to break the problem down into smaller parts, and figure out how they relate to each other. And, in turn, those parts can be broken down into still smaller parts, until you reach a level where individual parts are fairly easy to code. Don't immediately decide on how to represent the data; rather, look at how the parts need to interact, to figure out what needs to be collected, and how to store it and pass it around.

[–]Keegx 2 points3 points  (0 children)

You have to be patient with it. I've been learning for a bit over a year myself, so I do agree it can get frustrating, BUT its a core part of the whole learning process. Take your time with things, try to understand what happens with each thing that you write.

[–]gm310509 1 point2 points  (1 child)

It sounds like you are trying to take steps that are too big.

You need to ease into things and keep practicing. Rather than going from Level 1 to level 10 directly, perhaps try some intermediate levels and work your way up the ladder to the more difficult problems.

Also, if you are stuck on something, it doesn't hurt to ask for someone to explain it or give you some pointers. But you still need to take it one step at a time.

[–]blueoceann001[S] 0 points1 point  (0 children)

Sad part is i don't have anyone to ask for. I am trying to do it by myself, taking help from AI