My first Javascript program

Embarrassingly for a techie, my coding skills are somewhat lacking – despite various dabblings, my focus largely having been system administration without a firm basis in basic programming logic. :(

Clearly, if this is something I’m wanting taught in schools, I should make an effort to learn and understand about it myself however there are plenty of bits of code that I aspire to make small modifications to, yet lack the knowledge to do so.

Codecademy‘s high profile launch of CodeYear, provided the perfect, gentle opportunity, to quickly get to grips with some really basic concepts without feeling patronised or rushed or guilty of wasting someone’s time.

I’ve just completed the Codecademy week 1 courses, and my biggest success so far is putting together this simple Javascript FizzBuzz game program. Not a ground breaking achievement, but considering this is (apparently) a frequently used interview task, it certainly feels like something has been accomplished!

Onwards!

Javascript (execute in Firebug debugger)

// What number shall we play up to?
var number = 100

// for the numbers 1 through 20,
for (i=1; i<=number; i++) {

// if the number is divisble by 3 and 5, write "FizzBuzz"
if ( i % 3 === 0 && i % 5 === 0 ) {
console.log("FizzBuzz");
}

// if the number is divisible by 3, write "Fizz"
else if ( i % 3 === 0 ) {
console.log("Fizz");
}

// if the number is divisible by 5, write "Buzz"
else if ( i % 5 === 0 ) {
console.log("Buzz");
}

// otherwise, write just the number
else {
console.log(i);
}
}

Bright New Future for UK ICT Classes?

In response to School ICT to be replaced by computer science programme and Michael Gove to scrap ‘boring’ IT lessons

I’m very pleased with Michael Gove’s announcement on scrapping the existing ‘Information and Communication Technology’ curriculum. I think this is a great  step forward for young people and technology, and has the potential to increase interest in what is a vital area of skills for British youth.

With the launch of  ‘Code Year’ and the Guardian’s campaign to address issues with digital literacy, it is good to see the government giving this part of the curriculum the attention it both needs and deserves. Indeed this initiative comes at a great time and with the Raspberry Pi – an affordable British learning computer for exciting young techies – becoming available soon.

With all that said, I am still somewhat nervous about some of the details of this announcement.  The omission of a reference to open source software and solutions is disheartening, especially whilst referring to “an open-source world” and a changing and open curriculum. I hope that the Department for Education is aware of the potential positive benefits of looking at open alternatives to proprietary ‘solutions’.

I do welcome the premise and direction. Mr Gove is exactly right when he asks us to:

“Imagine the dramatic change which could be possible in just a few years, once we remove the roadblock of the existing ICT curriculum. Instead of children bored out of their minds being taught how to use Word and Excel by bored teachers, we could have 11-year-olds able to write simple 2D computer animations using an MIT tool called Scratch.”

As someone who now works in the technology sector but who suffered from poor ICT tuition at school, I hope that the government is able to deliver on these proposals; it is something that students in the UK deserve, that the economy of the UK will benefit from and something that has been ignored for too long. I have been campaigning for changes like these since 2009, they are very welcome and I am keen to see how they are implemented and developed.

Tim Dobson
@tdobson

Education Spokesperson
Pirate Party UK

Join the party

Press contact: campaigns@pirateparty.org.uk / 0161 987 7880

First posted on the Pirate Party UK Website