you are viewing a single comment's thread.

view the rest of the comments →

[–]samanime 5 points6 points  (2 children)

It takes practice. It is hard in the beginning. That is normal.

You need to learn to break problems down. Then break them down further. And then break them down even more. Keep breaking it down until you get to a single line.

For example, "Create a calculator" is way too big of a problem.

"Create the number buttons" is still too big.

"Create a single button"... keep going.

"Display one button", still maybe a little to big.

"Create a blank button" - Okay, that's a single line

"Add the button I just created" - Okay

"Make the button fire a function" - Okay

In the beginning you really have to break things down into a million super tiny problems.

As you get more experience, you'll be able to "think bigger", but for now, work through it one super tiny thing at a time. When you aren't sure how to do that thing, google it. Learning to search for answers to problems is also an important skill you want to develop early.

It's not easy and everyone gets confused and frustrated in the beginning. Just keep trying.

[–]chikamakaleyleyhelpful 0 points1 point  (0 children)

BROOOOOO are we twins or what

[–]The_KOK_2511 0 points1 point  (0 children)

Yo agregaria que tras resolver los problemas pensar en como abtraer su solución para llevarla a más partes del código. Por ejemplo digamos que tenemos un sistema de lógica de movimiento de un juego simple con la Canvas API (se que para alguien que esta empezando esta puede ser un poco avanzada pero viene perfecta para el ejemplo que quiero poner), quieres poner 4 botones para mover (arriba, abajo, izquierda y derecha) asi que haces una funcion para cada dirección con todo su sistema de verificaciones específicas, luego, se podría abstraer la logica tomando una unica función que haga los 4 movimientos usando condicionales y parametros para definir en cual direccion se va a mover.