38
Copyright : Futuretext Ltd. London 0 Welcome …. Concepts of programming languages for kids Ajit Jaokar Aditya Jaokar Follow us on facebook below for more videos! We welcome your feedback .. http://www.facebook.com/ConceptsOfProgrammingLanguagesForKids [email protected] Video coming soon Image source: Nasa

Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London 0

Welcome ….

Concepts of programming languages for kids

Ajit Jaokar

Aditya Jaokar

Follow us on facebook below for more videos!

We welcome your feedback ..

http://www.facebook.com/ConceptsOfProgrammingLanguagesForKids

[email protected]

Video coming soon

Image source: Nasa

Page 2: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London

Programming is the new Latin

0

"You can know the name of a bird in all the languages of the world, but when

you're finished, you'll know absolutely nothing whatever about the bird... So let's

look at the bird and see what its doing-- that's what counts. I learned very early the

difference between knowing the name of something and knowing something.” —

Richard Feynman

Page 3: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London

Programming is the new Latin

0

Programming is the new latin ..

But we risk making the same mistakes ..

We risk teaching children merely ‘how to program’ instead of teaching kids how to

think. And the two are not the same. To paraphrase Richard Feynman: we risk

knowing the ‘name of the bird’ in many languages but risk understanding the bird

itself ..

Page 4: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London

Concepts of Programming languages for kids

0

Concepts of programming languages for kids is the first attempt to teach kids the

concepts of programming languages - (as opposed to a single programming language)

.. It started off as a hobby with me teaching programming languages to my son Aditya

(eight years old) - until the techniques we were using were accepted as a paper by a

major educational journal. So, the facebook page, book and videos are an attempt to

create a discussion around these ideas and we value your feedback

A portion of all income will be donated to autism charities

Page 5: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London

Khan academy

0

We are inspired by Khan academy .. And Aditya is a big fan of Khan academy.

“Concepts of computer programming for kids” is a ‘social enterprise’ i.e. the ideas and

content will be freely distributed over the web but it would also take the form of a book/

online tutoring/physical course etc at some point in the future.

Page 6: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London

Published as a paper ..

0

The ideas here are presented in a leading educational publication as a paper.

(May 2012)

Educational Technology Magazine is the world's leading periodical publication

covering the entire field of educational technology, an area pioneered by the

magazine's editors in the early 1960s. Read by leaders in more than one hundred

countries, the magazine has been at the forefront of every important new trend in the

development of the field throughout the past five decades. Its list of published

authors is a virtual "who's who" of the leading personalities and authorities from all

over the world active in educational technology research, development, and

application

Page 7: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London

Constructivism ..

0

Broadly, there are two contrasting approaches for learning – Constructivism which

implies inquiry based teaching vs. direct instruction where the teacher explicitly guides

the student - the Logo programming language used constructivist ideas.

http://en.wikipedia.org/wiki/Logo_programming_language

Page 8: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London

The problem we end up addressing ..

0

The problem we ended up addressing : Re applying some of the original ideas of

constructivism (from the 1960s) to a different problem - namely how to use

constructivism to teach concepts of any programming language to kids(as

opposed to teaching kids a specific language).

Page 9: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London

Jacquard looms ..

0

Programming languages are not new and in fact they predate computers because

programming was used in devices such as Jacquard looms (Jacquard looms used

punch cards –which is a form of programming).

A programming language provides a mechanism for defining two things: Structured

pieces of data and also the ability to perform operations on that data. Thus, a

programming language is simply a way to communicate a set of instructions to a

machine. In most cases, but not all cases, the ‘machine’ is a computer.

Page 10: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London

Why constructivism suits programming ..

0

A constructivist led approach is suited for learning concepts of programming for the

following reasons:

- Programming is by nature constructivist i.e.it is designed to be an enabler – and in

doing so, programming is designed to be ‘invisible’ because programming is mechanism

to solve real-life problems. However, in teaching programming, we separate

programming from real life problems. An exploratory approach suits learning since it

can often be used to relate to real life problems

- A programmer needs to adopt the mind-set of an engineer i.e. the engineer starts with

a set of tools and materials but every problem she solves is different. No two bridges are

exactly the same. Thus, the ‘minimal guidance’ approach of constructivism are suited to

programming because it encourages multiple ways of solving a problem

- Finally, the Web and the Internet lend themselves to a constructivist mode of teaching

since networks lend themselves to exploration

Page 11: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London 10

Programming the mars Rover?

Hello world to Mars Rover?

Many conventional programming languages are used in the programming of the

MARS Rover and it is easy to relate ideas of programming to concrete examples

like the MARS Rover http://onlamp.com/onlamp/2004/08/02/oss_mars_rover.html

http://www.pvdairport.com/main.aspx?sec_id=69 + Discovery

Page 12: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London 11

Why kids understand Javascript …

Javascript – Under the hood for any page ..

JavaScript is ‘real’ to an eight year old who is familiar with the Web (and many

eight year olds are!).

Page 13: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London 12

Three techniques ..

1) Teach more than one real world languages at the same time. We focus

on JavaScript but also include MIT Scratch, C and Raspberry Pi. These

are mostly free and open source languages and combine hardware and

software

2) Teach in two stages and don’t get bogged down in syntax

3) Combine abstractions with non-abstractions and focus on real life

programs

Page 14: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London 13

Some techniques on how we differ ..

1) Teach more than one real world languages: Why confine to only one

language? We expanded our study to more than one language and in the end we

decided to focus on four languages - JavaScript, C, Scratch from MIT and

Raspberry Pi . Each language has different characteristics but they are all real

languages used to solve real problems.

Page 15: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London 14

Some techniques on how we differ ..

2) Teach in two stages and don’t get bogged down in syntax : Programming

is taught in a liner way. Traditionally, you start with the ‘hello world’ program. Then

you learn specific statements like the IF statement, the FOR loop etc. This

approach has the disadvantage that kids get bogged down with syntax but soon

get bored because they are not solving real problems. We teach a lot faster. We

teach programming in two stages. In the first stage, we focus on the basic syntax

for the instruction and in the second stage, we focus on the variants of the syntax.

For example, to teach the idea of a LOOP in the first stage, we explain the loop

concept and in the second stage, we explain different types of loops (FOR loop,

WHILE loop, FOR .. IN loop etc). This means, we approach real problems a lot

faster

Page 16: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London 15

Some techniques on how we differ ..

3) Combine abstractions with non-abstractions: An abstraction is a concept or

an idea not associated with a specific instance. Most people struggle with

programming and mathematics because both these disciplines involve

abstractions. In practise, some abstractions which traditionally are taught later on

are easier to understand upfront – for example Arrays. Kids understand Arrays

because they are visual and are easier to relate to (for example an array can be a

list). Thus, by teaching some elements like arrays earlier, programming becomes

easier.

Page 17: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London 16

Four parts ..

1) Part one includes a series of simple programmes explaining basic concepts

without variations. Ideally, these relate to physical concepts. In part two, we

introduce more changes but in Part one, we simply modify each each program

in a small way.

2) Part Two: Part two first expands on topics covered in part one – for example if

we introduce Loops in Part one, we discuss types of loops in Part two

In part two, we also introduce complex data structures

3) Part Three: Part three covers C, Scratch and Raspberry Pi. We explore the

interfaces between hardware and software. We study types of programming

languages (compiled, interpreted etc) and APIs and we look at algorithms

4) Part four: Part four covers Real life experiences, Agile methodology,

Interviews with programmers

Page 18: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London

0

Programs:

- Most of the programs will be in JavaScript.

- We use programs from the Web

- We used the w3schools emulator to test code

1) Arrays

2) Celsius to Fahrenheit conversion

3) Math object (max, min etc)

4) Date object

JavaScript is an Object Based Programming language.

An Object is just a special kind of data which combines properties and behaviour.

For instance, a Date is an object in JavaScript.

A date has properties (ex today’s date is June 7 – 2012) and it has behaviour (you

can add one day to a date to get the next day’s date etc)

Page 19: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London

0

Page 20: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London 19

Arrays

<html>

<body>

<script type="text/javascript">

var i;

var mycars = new Array();

mycars[0] = "Saab";

mycars[1] = "Volvo";

mycars[2] = "BMW";

for (i=0;i<mycars.length;i++)

{

document.write(mycars[i] + "<br />");

}

</script>

</body>

</html>

Saab

Volvo

BMW

Source: http://www.w3schools.com/js/tryit.asp?filename=tryjs_array

Page 21: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London 20

Temperature conversion ..

<head>

<script>

function temp(form)

{

var f = parseFloat(form.DegF.value, 10);

var c = 0;

c = (f - 32.0) * 5.0 / 9.0;

form.DegC.value = c;

}

</script>

</head>

Source: http://www.howstuffworks.com/question369.htm

Page 22: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London 21

Math Object

<!DOCTYPE html>

<html>

<body>

<script type="text/javascript">

document.write("Rounding " + Math.round(4.7) + "</p>");

document.write("Max " + Math.max(8,7) + "</p>" );

document.write("Min " + Math.min(8,7));

</script>

</body>

</html>

Page 23: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London 22

Date Object

Date and time = Thu Jun 07 2012 08:05:03 GMT+0100 (GMT Daylight Time)

<!DOCTYPE html>

<html>

<body>

<script type="text/javascript">

var d=new Date();

document.write("Date and time = " + d + "</p>");

</script>

</body>

</html>

Page 24: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London 23

Date Object

<!DOCTYPE html>

<html>

<body>

<script type="text/javascript">

var d=new Date();

document.write("Date and time = " + d + "</p>");

document.write("Year = " + d.getFullYear() + "</p>");

document.write("Month = " + d.getMonth() + "</p>");

document.write("Day of week = " + d.getDay() + "</p>");

document.write("Hour = " + d.getHours() + "</p>");

document.write("Minutes = " + d.getMinutes() + "</p>");

document.write("Seconds = " + d.getSeconds() + "</p>");

</script>

</body>

</html>

Page 25: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London 24

Date Object

Date and time = Thu Jun 07 2012 08:08:41 GMT+0100 (GMT

Daylight Time)

Year = 2012

Month = 5

Day of week = 4

Hour = 8

Minutes = 8

Seconds = 41

Page 26: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London 25

Date Object

<!DOCTYPE html>

<html>

<body>

<script type="text/javascript">

var d=new Date();

var weekday=new Array(7);

weekday[0]="Sunday";

weekday[1]="Monday";

weekday[2]="Tuesday";

weekday[3]="Wednesday";

weekday[4]="Thursday";

weekday[5]="Friday";

weekday[6]="Saturday";

var n = weekday[d.getDay()];

document.write(n + "</p>");

</script>

</body>

</html>

Thursday

Page 27: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London

0

Part One

Part one includes a series of simple programmes like shown explaining basic

concepts without variations. These relate to physical concepts. In part two, we

introduce more changes but in Part one, the learner is simply asked to change

each program in a small way.

Contents of part One include

- What is programming

- The programming environment – Web, PC, Mobile, Home, Automotive

- The programming ecosystem – compiled programs, interpreted programs etc

- Object oriented programming

- Javascript overview

- Javascript objects

- Input output and processing

- Variables, Numbers and Strings

- Basic string operations

Page 28: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London

0

- Basic mathematical operations

- Decision statements (IF)

- Loops

- Arrays

- Dates

- Boolean logic

- Events

- Objects

- Functions

Each of these are discussed in a series of simple programs based on real life

problems which the students can modify. Each of the programs below for

example can be modified in simple ways even if you don’t know much

programming

Page 29: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London

0

Part Two

Part two first expands on topics covered in part one – for example if we

introduce Loops in Part one, we discuss types of loops in Part two

We cover the following concepts in Part two

- Numbers and strings

- Conversion of data types

- Types of input and output

- Random number generation

- File input and output

- Types of loops

- Types of IF statements (decision statements)

- Basics of Graphical user interfaces

- Events (Try...Catch, Throw)

- Validation

Page 30: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London

0

Part Two

- Types of events

- Objects

- JavaScript Objects and HTML DOM Objects

- Arrays

- Dates

- Boolean logic

- Events (visitor triggered, timed

- Objects

- Functions

Page 31: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London

Programming is the new Latin

0

Part Two

After this, we explore Data structures.

Data structures are a way of storing and organizing data in a computer.

• The data structures we cover in this book are not exhaustive and indeed not

all are applicable to Javascript.

• However, a formal understanding of data structures and their operations

helps us to understand the concepts of programming.

• Different data structures are oriented for different applications with some

being highly specialized to specific tasks for example B-trees are suited for

implementation of databases.

Page 32: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London

0

Data structures (wikipedia)

• Boolean (for Boolean values True/False)

• Char (for character values)

• Float (for storing real number values)

• Double (a larger size of type float)

• int (for integral or fixed-precision values)

• Enumerated type

• Array

• Record (Structures/ Tuples)

• Union

• List

• Set

• Stack

• String

Page 33: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London

0

• Tree

• Graph

• Hash tables

• Arrays

• maps

• Lookup table

• Linked list

• Binary tree

• Heap

• Hash list

• Graph

Page 34: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London

0

• (Wikipedia) - In computer science, a linked list is a data structure consisting

of a group of nodes which together represent a sequence.

• Under the simplest form, each node is composed of a datum and a

reference (in other words, a link) to the next node in the sequence; more

complex variants add additional links.

• This structure allows for efficient insertion or removal of elements from any

position in the sequence.

• The principal benefit of a linked list over a conventional array is that the list

elements can easily be inserted or removed without reallocation or

reorganization of the entire structure because the data items need not be

stored contiguously in memory or on disk.

A linked list whose nodes contain two fields: an integer value and a link to the next node. The last

node is linked to a terminator used to signify the end of the list.

Page 35: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London

0

Part Three

• Part three covers C, Scratch and Raspberry Pi.

• We explore the interfaces between hardware and software.

• We study types of programming languages (compiled, interpreted etc)

and APIs and

• we look at algorithms

Page 36: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London

0

Part four

• Part four covers Real life experiences

• Agile methodology

• Interviews with programmers

Page 37: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London

0

Constructivism

Constructivism is a paradigm for learning that involves active participation from

the student.

Constructivist learning involves the following characteristics:

- Learning is an active process. The student actively constructs or creates their

own subjective representations of an objective reality. New information is linked to

prior concepts thereby building up a body of knowledge.

- There is an emphasis on personal experiences and experiences within the

environment (real life experiences)

- Learners test hypotheses through social negotiation

- The role of the educator is to be a facilitator and to create a flexible structure

which allows the learners to expand the framework through their interaction. In

other words, the structure of the course is intended be ‘malleable’ by the

learners

- http://www.learning-theories.com/constructivism.html

Page 38: Welcome []...Copyright : Futuretext Ltd. London Published as a paper .. 0 The ideas here are presented in a leading educational publication as a paper. (May 2012) Educational

Copyright : Futuretext Ltd. London 37

Concepts of programming languages for kids

Ajit Jaokar

Aditya Jaokar

Follow us on facebook below for more videos!

We welcome your feedback ..

http://www.facebook.com/ConceptsOfProgrammingLanguagesForKids

[email protected]

Image source: Nasa