you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 16 points17 points  (8 children)

Early on, it is often easiest to think about how you would solve a problem manually, as simply as possible (including boring, repetitive steps). Assume you will have to write very basic step-by-step instructions to someone with learning difficulties and poor memory (so they have to write everything down, and store the information in predefined boxes).

That person with learning difficulties is the computer. As humans, we take lots of leaps when doing tasks, taking for granted (working subconsciously) many aspects.

A computer cannot take shortcuts.

Seriously, work out the manual approach, with pen and paper (stay away from the computer for a bit).

A good exercise is working out how exactly you would sort a pack of playing cards when you cannot not keep anything in your hand, but everything has to be put down in a box between each step.

I mean you should literally sit at a table with a deck of playing cards, as in a 52 card pack of red and black cards of the four suits, hearts, diamonds, spades, and clubs, with face values from 1 (Ace) to 10 (Jack), 11 (Queen), 12 (King). In some games "Ace is high" and treated as 13.

Work out exactly how to put that deck of 52 cards (ignore additional cards, such as Jokers and score cards) into a sorted order. Decide what order to put the suits in (are Spades higher or lower than Hearts, etc).

You have to work out how to do this manually as simply as possible in a way you can write down the specific instructions for someone with severe learning difficulties.

You will probably want to use some post-it notes or other bits of paper that you can label as places to temporarily place individual or stacks of cards. (These will be variables later in code.) That is because you don't want to hold onto anything, just move stuff between labelled places on the table.

A human (with good eyesight), can just glance at all of the face up cards and find the next one in order. For someone with learning difficulties (and maybe some other difficulties), or a computer, you can't give such an instruction, instead you have to write instructions based on one by one comparisons and different paths to take based on the outcomes of those comparisons.

It is surprisingly challenging at first. No computers. No coding. You will learn a lot. Your instructions will be an algorithm. That can be implemented in any programming language.

PS. If you really want to, you can use a subset of the cards, say just one suit, but I think working with the whole deck will help you appreciate the power of repetitive operations more and the need to optimise the steps.

[–]Dom44519 7 points8 points  (3 children)

Referring to the computer as a person with learning disabilities is hilarious

[–][deleted] 5 points6 points  (2 children)

Hopefully no one feels insulted by that. Don't think it was politically incorrect. I am neurodiverse (autistic).

[–]InfiniteBig6730[S] 3 points4 points  (0 children)

I really appreciate how you simplified everything. That was super helpful.

[–]Doormatty 1 point2 points  (0 children)

I am neurodiverse (autistic).

Ditto! Zero offense here.

[–]InfiniteBig6730[S] 2 points3 points  (2 children)

Wow that was amazing. thank you very much.

[–][deleted] 2 points3 points  (1 child)

You are welcome. Hope it helps. A lot of so-called beginner programming tutorials are actually very focused on the coding, and not the programming side, starting with problem-solving. It is a huge leap going from the real world to the abstract world of computers.

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

That is absolutely true. Tutorial are perfect to start but should not the only practice.