Computing: The Science of Nearly Everything

Computer Science…Research, Education and Policy

Posts Tagged ‘Programming

Interview with ITWales

leave a comment »

I was interviewed last month by ITWales, to talk about computer science education, CAS Wales, the Technocamps project and the future skills and expertise required to underpin the digital economy in Wales.


(full interview here)

Written by Tom

13 March 2013 at 5:09 pm

Barack Obama on computer science and programming

with 4 comments

Watch Barack Obama’s recent Google+ Hangout, in which he discusses the importance of computer science in preparing the USA’s future workforce, in association with the ACM (following on from a successful CSEdWeek in December).

A very clear message about teaching computer science and programming at high school, to develop creators and not just consumers of technology:


(N.B. Obama seems fairly comfortable with computer science, as this interview with Eric Schmidt from 2008 highlights…)

Written by Tom

16 February 2013 at 2:41 pm

The Times: “Program or Be Programmed”

with 8 comments

A lot of computer science in The Times today: a full-page article on page 3 entitled Play the game, but write the software too (£), a four-page pullout on learning how to code, as well as the following leader (£) on page 2:

Program or be Programmed

The best time to start learning the language of computer code is now

void draw() {
    background(255);
    stroke(0,0,0);
    line(0,0,60,hour());
    line(0,0,120,minute());
    stroke(255,0,0);
    line(0,0,180,second());
}

The world divides into a majority of people for whom the preceding four lines are meaningless and a minority for whom it is clear at once that, given the right breaks between them, these lines will create on your computer screen a simple clock.

For the majority, the world of software is a built world that, like a city, helps us to organise and to consume. But it has been built by others. For the minority, software is merely a curtain that can be pulled aside to reveal a wild world of confusion, trial and error, but also of potentially unlimited creative and commercial potential. It is time for Britain’s schoolchildren to be granted access to this world.

For a brief period in the 1980s, British schools and universities punched far above their weight in the production of graduates who spoke the language of computers. This was partly a legacy of Britain’s pioneering role in the fundamentals of computer science and partly thanks to the BBC Micro, which appeared in most schools in the country but required a basic understanding of code for even its most basic functions.

The Micro generation went on to dominate the creative side of the computer gaming industry, but mainly in other countries. Since then Britain’s top three universities for computer science — Oxford, Cambridge and Imperial College, London — have kept their rankings in a global top 20 predictably dominated by the United States. But for a wasted generation, computer science in schools has languished at the expense of something else entirely.

As Michael Gove lamented in a speech in January, the national curriculum’s vision of Information and Communications Technology (ICT) had atrophied to little more than a primer in the use of Microsoft Word and PowerPoint. What pupils got, if they could stay awake, were simple skills that conferred little competitive advantage and in most cases could anyway be self-taught. What they needed was a rigorous but rewarding grounding in code as a foreign language.

At the Education Secretary’s invitation, industry has produced a blueprint for a new computer science curriculum. It would start early. By the end of primary school, pupils would be able to build an app for a mobile phone. By 16 they would be able to write a program to solve a Sudoku puzzle. By 18, if they took computer science at A-Level, they would be able to write the code to guide a van along the shortest route between two points on a digitised map.

Under this scheme, coding would start at 7. Its advocates say this would produce, eventually, the number of computer-literate graduates that British employers need; equip all pupils with the ability to compartmentalise and sequence their thinking as coding requires; and reflect the new reality that no rounded education is complete without an introduction to programming.

It is a compelling case. Some schools may respond that they cannot possibly have enough qualified teachers ready for a curriculum by 2014, when the successor to ICT is due. That is no reason to push back the deadline. It is a reason to speed up the necessary training. That clock on your computer screen is ticking.

While it has been widely reported that industry have taken the lead on developing the new ICT Programme of Study in England, this is not quite correct. It has been coordinated by the BCS and the Royal Academy of Engineering on behalf of the Department for Education, with input from key stakeholders across education, academia, government and industry. They may have been indirectly referring to Computer Science: A Curriculum for Schools, the CAS curriculum which has been endorsed by industry and the examination boards.

N.B. The Times also cleverly demonstrated that programming is non-trivial, by inserting a couple of typos in the code fragment at the start of the article…

Useful methods in Android 4.2: isUserAGoat()

with one comment

android.os.UserManager, a new class added in Android 4.2 (Jelly Bean) which manages users and user details on a multi-user system, has exposed a very useful public method:

isuseragoat()

(source and an explanation)

Written by Tom

15 November 2012 at 12:49 pm

Posted in Technology

Tagged with , , ,

Codecademy Cymru

with 5 comments

codecademy logo

Fancy joining Mike Bloomberg (Mayor of New York), New York University and millions of people across the world (including the people of Colombia) in learning how to code? While learning how to program should be the start, not the end, 2012 seems like a pretty good year to do this.

Codecademy, one of the largest online interactive platforms for learning how to code, think the same way as Computing At School: everyone should be exposed to programming and computer science — especially kids. Codecademy can help you learn how to program, create your own courses and support programming in schools. And this is where Codecademy is partnering with CAS Wales: Codecademy Cymru — to create a bespoke and adaptable environment to support the teaching of Computer Science and ICT in schools across Wales — the first official Codecademy collaboration in Western Europe!

Codecademy is really excited to partner with teachers in Wales to make the learning and teaching of coding easier than it has ever been before. It is fantastic that the Computing At School teachers have embraced Codecademy, and we look forward to seeing the results from the students!

Zach Sims, CEO and co-founder of Codecademy

We are looking for teachers across Wales who would like to join the Codecademy Cymru trial phase to see how it can best be used to support your students. For example, the Web Fundamentals and Javascript Fundamentals courses could be used to support Key Stages 2-3, leading into the Python course for supporting the new GCSEs in Computer Science. However, there is flexibility to find how we can best support your school and your students (as well as helping Codecademy to develop the necessary support functionality and processes) — we need your help!

Interested? Please complete the Codecademy Cymru expression of interest form.

Written by Tom

24 October 2012 at 12:11 am

Programming is the start not the end: let’s develop computational thinking and problem solving skills

with 26 comments

(N.B. This is the original unedited version of an article published online today in The Telegraph)

I wholeheartedly support the high-profile initiatives to get more children programming, especially as part of the rethinking of the ICT curriculum in UK schools. The publication of the Royal Society’s report Shut down or restart? in January highlighted the unsatisfactory state of ICT education in the UK, recommending that every child should have the opportunity to study the rigorous academic discipline of computer science. With the disapplication of the existing ICT Programmes of Study and the development of a new programme of study as part of the National Curriculum Review in England, we are at an exciting crossroads, with a real opportunity to make computing and technology a key focus of our education system. But if there’s one lesson we should take away from the problems of the past 15 years it is that we must not focus on transient and superficial technology skills. Computer science is not programming (and vice versa) and we should be wary of teaching programming just for the sake of teaching programming, without thinking about why we want to get kids to program.

When Michael Bloomberg, Mayor of New York City, tweeted in January that he was going to learn how to program, there were strong opinions expressed implying that programming is not for everyone. This is untrue. One of the reasons that programming is increasingly perceived to be a 21st century literacy in our technology-dependent society is because it is ultimately empowering, developing the ability to manipulate and control your digital world. But the key message is that learning how to program is not the endpoint, but part of the journey of equipping children with the necessary digital skills to solve problems. Our high-level aim should be to develop technology-independent skills and techniques, such as data literacy and computational thinking.

Computational thinking is a way of solving problems, designing systems and understanding human behavior that draws on concepts fundamental to computer science. Computational thinking includes a range of mental tools that reflect the breadth of the field of computer science. Computational thinking means creating and making use of different levels of abstraction, to understand and solve problems more effectively; it means thinking algorithmically and with the ability to apply mathematical concepts to develop more efficient, fair, and secure solutions; it means understanding the consequences of scale, not only for reasons of efficiency but also for economic and social reasons. And this is why it is important to teach computer science in schools: we need to embed principles and theory to develop a deeper conceptual understanding of how technology works and how it can be leveraged to solve problems. There is a quote commonly misattributed to Edsger Dijkstra: “Computer science is no more about computers than astronomy is about telescopes.” — this is where computational thinking fits in, abstracting away the technology.

Hence, there is an important balance to strike between focusing on developing practical programming skills (i.e. being able to write code for a specific task) and embedding a deeper understanding of languages and constructs: principles of programming. We know technology changes quickly, so we need to make sure that when “Technology X” appears, we have transferable knowledge and a deeper conceptual understanding of how it works and how it can be used.

But there are significant challenges ahead in changing the status quo and enthusing and engaging children in schools. Programming is a creative endeavour and offers a tangible way for children to express themselves by hacking, making and sharing. We now have the hooks to use in schools e.g. Raspberry Pi, Arduino, .NET Gadgeteer, LEGO Mindstorms, etc, offering opportunities for embedding computing across the curriculum. But we also have to recognise the importance of developing this deeper conceptual understanding, the problem solving and analytical skills, as well as knowledge of the underpinning theoretical foundations of computing.

So let’s change the focus from just writing code to developing the crucial thinking skills and the ability to solve problems. To quote Jeannette M. Wing, Professor of Computer Science at Carnegie Mellon University: “Computational thinking is a fundamental skill for everyone, not just for computer scientists. To reading, writing and arithmetic, we should add computational thinking to every child’s analytical ability.

NASA’s Magellan spacecraft and Perl’s pack function

with 2 comments

I recently found this description of the origin of a number of the pack format specifiers in Perl’s pack function (which takes a list of values and converts it into a string using a specified rule template). Larry Wall recalls that they were added for processing data from NASA’s Magellan spacecraft (launched in 1989, also known as the Venus Radar Mapper):


+=begin comment
+
+Larry recalls that the hex and bit string formats (H, h, B, b) were added to
+pack for processing data from NASA's Magellan probe. Magellan was in an
+elliptical orbit, using the antenna for the radar mapping when close to
+Venus and for communicating data back to Earth for the rest of the orbit.
+There were two transmission units, but one of these failed, and then the
+other developed a fault whereby it would randomly flip the sense of all the
+bits. It was easy to automatically detect complete records with the correct
+sense, and complete records with all the bits flipped. However, this didn't
+recover the records where the sense flipped midway. A colleague of Larry's
+was able to pretty much eyeball where the records flipped, so they wrote an
+editor named kybble (a pun on the dog food Kibbles 'n Bits) to enable him to
+manually correct the records and recover the data. For this purpose pack
+gained the hex and bit string format specifiers.
+
+git shows that they were added to perl 3.0 in patch #44 (Jan 1991, commit
+27e2fb84680b9cc1), but the patch description makes no mention of their
+addition, let alone the story behind them.
+
+=end comment

N.B. I’m a big fan of Perl — this kind of ad hockery perfectly encapsulates why!

Written by Tom

27 August 2012 at 2:09 pm

Microsoft’s 0xB16B00B5

with 9 comments

Last week on the Linux Kernel Mailing List, a minor question was raised about the suitability of certain magic constants in the support code in the Linux kernel for Microsoft’s Hyper-V virtualisation environment. This was widely reported a week later. So how did a hexadecimal string cause so much offence? Well, it turns out that the constant passed through to the hypervisor was 0xB16B00B5, or in English, BIG BOOBS. And this was not an exception: when the code was originally submitted it also contained 0x0B00B135 (BOOBIES). While this looks to be a puerile joke, it could be potentially problematic because Azure (Microsoft’s cloud computing platform) may depend on this constant, so changing it could break things.

Even though the Linux kernel itself contains a fair amount of profanity, Microsoft swiftly apologised: “We thank the community for reporting this issue and apologize for the offensive string. We have submitted a patch to fix this issue and the change will be published in a future release of the kernel.” (in fact, the patch changed the string to its decimal representation: 2976579765). However, as Matthew Garrett notes on his blog, this can be easily attributed to straightforward childish humour (and the use of pseudo-English strings in magic hexadecimal constants is hardly uncommon; you can even generate hex poetry, if you so wish), but sniggering at breasts contributes to the continuing impression that software development is a boys club where girls are not welcome.

Lots of Irritating Superfluous Parentheses

with 4 comments

After seeing last week’s xkcd, I was reminded of the delights of learning Lisp (or in my case, Scheme) as an undergraduate. I’m a big fan of declarative programming in general — I think exposure to functional and logic programming languages develops your problem solving skills and refines how you think about programming, by focusing on the logic of a computation without getting distracted by its control flow (although this discussion has been going on for many years). It has served me well: I used logic programming (Answer Set Programming) extensively in my PhD and I dabbled with OCaml whilst a research intern at ARM; although I have used very little Haskell, I know a man who does. There seems to be a wider trend of functional programming techniques moving into the mainstream, especially with the release of F# as part of Visual Studio 2010.

Anyone who has used Lisp for any amount of time will fondly remember its enthusiastic use of parentheses. But you can embrace the Lisp philosophy a little too much. Parenthetic is a programming language that only uses ( and ) as code; all other characters are considered comments. Parenthetic uses Lisp-style expressions where parentheses enclose expressions; programs with unmatched parentheses are invalid. It looks pretty similar to another esoteric language called Parenthesis Hell, and has most of the basic Lisp features, including lambda for anonymous functions. To demonstrate a nice simple code example, the following Parenthetic program prints ‘Hello World‘:

((()()())(()(()()))((()(()))((())()()()()()()())((()()(()))((())()()()()()()()()())
((())()()()()()()()()()()))))((()()())(()(()()()))((()(())(())())((())()()()()()()(
)()()()()()()()()()()()()()()()()()()()()()()()()())))((()(()))((()(())(())())((()(
()))(()(()()))((())()()()()()()())))((()(())(())())((()(()))(()(()()))((())()()()()
)))((()(())(())())((()(()))(()(()()))((())()()()()()()()()()()())))((()(())(())())(
(()(()))(()(()()))((())()()()()()()()()()()())))((()(())(())())((()(()))(()(()()))(
(())()()()()()()()()()()()()()())))(()(()()()))((()(())(())())((()(()))(()(()()))((
())()()()()()()()()()()()()()()()()()()()()()())))((()(())(())())((()(()))(()(()())
)((())()()()()()()()()()()()()()())))((()(())(())())((()(()))(()(()()))((())()()()(
)()()()()()()()()()()()()())))((()(())(())())((()(()))(()(()()))((())()()()()()()()
()()()())))((()(())(())())((()(()))(()(()()))((())()()()))))

Pretty expressive, I’m sure you’ll agree.

There has been a rich history of developing bizarre programming languages; for example, Brainfuck, an eight-instruction Turing-Complete programming language, and Ook!, a programming language designed for orangutans (essentially isomorphic to Brainfuck, but with even fewer syntax elements).

Written by Tom

13 May 2012 at 10:00 pm

Will 2012 be the Year of Computer Science?

with 3 comments

2011 was a promising year for computer science in schools, with government ministers (even the Prime Minister) appearing to recognise its importance from both an educational and economic perspective; all in the midst of a uncertain large-scale education review in England. 2012 is shaping up to be just as promising, starting with the publication of the Royal Society’s 18 month study on computing in schools in a fortnight. Computing At School (CAS) have been busy on a number of fronts over the past year, but in particular advocacy at national policy level (along with the BCS Academy of Computing).

However, we have to remain grounded — there is still a huge amount of work to be done (and nothing is yet guaranteed). As well as continuing the policy work, one of the priorities for CAS is to further connect with and support the network of Computing and ICT teachers across the UK, as well as changing the wider public’s poor perception of computer science — into a rigorous, practical and intellectually useful academic discipline (and as a pathway to a wide range of careers). There are also a number of excellent initiatives to support that focus on developing the key skills of computational thinking and programming, as well as genuinely engaging young people with technology: Young Rewired State, Hack to the Future, Apps for Good, Codecademy et al.

After a recent conversation with @BringBackCS, it seemed an opportune time to coalesce Twitter discussions under a unifying hashtag:


I will be using this hashtag to promote Computer Science in 2012; please use and spread the message!

#CSin2012

And why is 2012 especially important? It’s also the Turing Centenary, a celebration of the life and scientific influence of Alan Turing on the centenary of his birth on 23rd June 1912. A number of major events (such as the Computability in Europe 2012 conference) will be taking place throughout the year, with many linked to places with special significance in Turing’s life, including Cambridge, Manchester, Bletchley Park and Princeton. 2012: The Alan Turing Year and the Year of Computer Science.

We can only see a short distance ahead, but we can see plenty there that needs to be done.

Alan Turing, Computing Machinery and Intelligence (1950)