What is coding?

An introduction to programming
by Halit Celik & Sylvain Fankhauser

Halit

Sylvain

  • Powercoders student (2018 batch)
  • Working at Cruncher (Lausanne)
  • Has been in Switzerland for 3.5 years.
  • Formerly a tour guide
  • Working at Liip (Lausanne)
  • Web developer (I build websites) for 15+ years
  • Powercoders coach (2018 batch)

Today's schedule

1. Boring slideshow (you are here)

2. Fun robot exercise (hopefully)

3. Exciting coding workshop

4. Apéro! 🤤

What is coding?

“Computer programming is the process of designing and building an executable computer program for accomplishing a specific computing task

Wikipedia

Do you know any programs?

(hint: I'm sure you do!)

“A computer program is a collection of instructions that performs a specific task when executed by a computer”

 

Wikipedia

Specific task: place a phone call

Instructions:

1. Take phone

2. Place call

I don't know how to do that!

What number should I call?

Placing a call

Specific task: place a phone call to 079 719 14 66

Instructions:

1. Take phone
2. Press power button
3. Unlock phone
4. Locate "phone" app
5. Touch "phone" app icon
6. Dial number (touch "0" key, touch "7" key, etc.)
7. Touch "call" icon

I don't know how to do that!

Placing a call

Specific task: place a phone call to 079 719 14 66 with unlock code 123

Instructions:

1. Take phone
2. Press power button
3. Swipe up

4. Touch "1" key

5. Touch "2" key

6. Touch "3" key

7. Touch "OK" key
8. Locate "phone" app
9. ...

Placing a call

Robot exercise

  • Make pairs of 2 people
  • One person is the robot, the other is the programmer
  • Only the programmer knows the task the robot should do
  • The robot is not allowed to do anything else than the instructions.
  • The programmer must get the robot to accomplish the task, using only instructions on the sheet
  • When you're done, get a different sheet and switch roles!

🤖👨‍💻👩‍💻

Did you notice...

  • It's helpful to repeat an instruction multiple times (eg. "Make 5 steps")
  • You had to adapt the instructions when the environment changed

Repetitions and conditions are very useful when writing a program!

Let's code together!

Go to scratch.mit.edu/create

Example of a sequence

 

Program is waiting for a user interaction...

Click Keyboard Hover Other?

Where did the event happen?

Button Text Input

Which button is that?

Go to the box 1 and increment the existing number by 1

Example of a sequence

Go to text input 1 and take the value!

Keep it in mind!

Then go to text input 2 take the value.

Now multiply first value with the second one.

But... What if there is no value in the text input?

If there is no value, insult the user.

Some truths and lies about coding

  1. Coding is black magic
  2. You need very good math skills
  3. You need patience
  4. Women can't code
  5. You need long studies
  6. You'll never know everything about coding
  1. Coding is black magic
  2. You need very good math skills
  3. You need patience
  4. Women can't code
  5. You need long studies
  6. You'll never know everything about coding

Thank you!

Copy of What's coding?

By halitcelik

Copy of What's coding?

  • 161