Tag Archives: Programming

Five Programming Top Tips (from a seven year old)

fivetoptips

Earlier today I tweeted the above image of five handwritten top tips from a seven year old female who had been learning programming; these were extremely astute observations and were a delight to read.

After digging a bit deeper, I found the original blog post, describing in more detail the poignant observations of @fjsteele‘s daughter after spending an hour using Hopscotch, a visual programming language for the iPad. In the blog post, he explains that this was his daughter’s first programming lesson and he asked her to write down instructions on how to draw a square, and then use Hopscotch to make one; after that, they tried a triangle:

It was fun to see the `lightbulb’ come on as she tried different blocks, failed, tried something else. It was really fun to watch her discover debugging. She quickly learned not to do too much work before testing it out.

 
Not a bad summary from an hour of programming! What else would you add to this list?

Tagged , ,

Is the Universe a simulation?

From an article by Edward Frenkel in today’s New York Times:

Many mathematicians, when pressed, admit to being Platonists. The great logician Kurt Gödel argued that mathematical concepts and ideas “form an objective reality of their own, which we cannot create or change, but only perceive and describe”. But if this is true, how do humans manage to access this hidden reality?

We don’t know. But one fanciful possibility is that we live in a computer simulation based on the laws of mathematics — not in what we commonly take to be the real world. According to this theory, some highly advanced computer programmer of the future has devised this simulation, and we are unknowingly part of it. Thus when we discover a mathematical truth, we are simply discovering aspects of the code that the programmer used.

 
This hypothesis is by no means new; in Are you living in a computer simulation, Nick Bostrum argues that one of the following propositions is true:

  1. the human species is very likely to go extinct before reaching a “posthuman” stage;
  2. any posthuman civilisation is extremely unlikely to run a significant number of simulations of their evolutionary history (or variations thereof);
  3. we are almost certainly living in a computer simulation.

Also see: Constraints on the Universe as a Numerical Simulation.

Tagged , , ,

What Superman III teaches us about programming

I’ve always had a soft spot for Superman III (1983), the third film in the original franchise starring Christopher Reeve as Superman. While it’s generally regarded as being below the standard of the first two films, it has some great moments e.g. the scene where evil Superman fights Clark Kent.

In Superman III, Richard Pryor plays Gus Gorman, a man with no known computing skills whatsoever, who — when his social security is stopped — turns to programming out of desperation.

become_a_programmer

After completing a programming course (presumably in BASIC or COBOL), Gus soon lands a job at Webscoe Industries, unaware that he’s working for Evil Robert Vaughn. He stays back after work one night, to hack into the work computers and award himself a few extra expenses. But what possible lines of programming genius will it require? What would you need to type in to override all the ruthless security of the Webscoe Payroll Division?

give_me_all_the_money

Err…it’s a good job he did that course.

After receiving a cheque for $85,789.90 and turning up to work in a new Ferrari, it all goes rather downhill: Evil Robert Vaughn coerces him into hacking the Vulcan weather satellite, as well as manipulating the global financial system, damaging the world’s oil supplies by moving every tanker into roughly the same place and replicating kryptonite by tracking down unknown elements in outer space. With the programming educational element of the film done by this point, Gus proposes building a “supercomputer”, eventually leading to the creation of a Robocop prototype.

Read the full Den of Geek analysis of Superman III‘s contribution to the teaching of programming; and remember: all of this computer mayhem came from a man who answered an advert on the back of a book of matches.

Tagged , ,

FuckIt.py: The Python Error Steamroller

Having problems with your Python code? Try FuckIt.py by ajalt:

FuckIt.py uses state-of-the-art technology to make sure your Python code runs whether it has any right to or not. Some code has an error? Fuck it.

FuckIt.py uses a combination of dynamic compilation, Abstract Syntax Tree rewriting, live call stack modification and love to get rid of all those pesky errors that makes programming so hard. All functionality is provided through the fuckit module: add import fuckit to the top of your script, then you can use fuckit in a number of ways e.g. as a replacement for import when a module has errors — just change import some_shitty_module to fuckit('some_shitty_module'):

import fuckit
#import some_shitty_module
fuckit('some_shitty_module')
some_shitty_module.some_function()

Still getting errors? Chain fuckit calls. This module is like violence: if it doesn’t work, you just need more of it:

from fuckit import fuckit
fuckit(fuckit('some_shitty_module'))
# This is definitely going to run now.
some_shitty_module.some_function()

You can also use fuckit as a decorator and a context manager; plus check out its extremely permissive public license.

(also see: FuckItJS, the Javascript Error Steamroller)

Tagged ,

2014 Software Sustainability Institute Fellowship

SSI

I’m delighted to have been named today as one of the sixteen Software Sustainability Institute Fellows for 2014.

The Software Sustainability Institute (SSI) is an EPSRC-funded project based at the universities of Edinburgh, Manchester, Oxford and Southampton, and draws on a team of experts with a breadth of experience in software development, project and programme management, research facilitation, publicity and community engagement. It’s a national facility for cultivating world-class research through software, whose goal is to make it easier to rely on software as a foundation of research; see their manifesto. The SSI works with researchers, developers, funders and infrastructure providers to identify the key issues and best practice surrounding scientific software.

During my fellowship, I’m particularly keen to work closely with Software Carpentry and Mozilla Science Lab to highlight the importance of software skills across the STEM disciplines. I’m also interested in a broader open science/open computation agenda; see the Recomputation Manifesto and the recently established recomputation.org project.

More to follow in 2014!

Tagged , , , , , , ,

A set of top Computer Science Education blogs

Further to my most-read blog post (from May 2012: A set of top Computer Science blogs, 80,000 hits and counting), here’s a follow-up: blogs on computer science education.

As before, instead of a list, it more closely resembles a set: the order is irrelevant and there are no duplicate elements; membership of this set of blogs satisfies all of the following conditions:

  1. they focus on computer science education (research, policy and practice);
  2. they are of consistently high quality;
  3. I regularly read them.
  • Computing Education Blog by Mark Guzdial (@guzdial)

    Mark is a professor in the School of Interactive Computing at Georgia Institute of Technology and a researcher in computing education. His blog is about how people come to understanding computing, and how to facilitate that understanding, cross-cutting research, policy, practice and wider societal issues. And while it is US-focused (as you would expect), it is an excellent venue for the discussion of key topics in computer science education.

  • Teach Computing by Alan O’Donohoe (@teknoteacher)

    Alan is a busy chap: as well as being principal teacher of Computing at Our Lady’s High School in Preston, he’s the founder of both Hack To The Future and Raspberry Jam, the global community of events for everyone to discover the wonders of the Raspberry Pi. His blog tracks his five-year computing journey: from improving classroom practice (listen to his Teach Computing podcasts), contributing back to the community as a CAS Master Teacher, to shaping the development of a new curriculum subject in England.

  • Miss Philbin’s Teaching and Learning Journal by Carrie Anne Philbin (@MissPhilbin)

    Carrie Anne is an award-winning secondary teacher at Robert Clack School in Essex and a passionate advocate for women in technology. She is the creator of Geek Gurl Diaries, a YouTube web series for teenagers who want to be makers and creators of technology (which recently won a Talk Talk Digital Hero Award) and vice-chair of the CAS initiative #include to address diversity issues in computing. Her blog also covers the gamut of classroom practice, the transition from ICT to computing, supporting the wider community, to shaping policy in England.

  • Academic Computing by Neil Brown (@twistedsq)

    Neil is a research associate in the Programming Languages and Systems Group at the University of Kent, working on the BlueJ and Greenfoot projects. He writes thought-provoking pieces on topics spanning computing (and more broadly, STEM) education, programming and socio-technical issues. He also has a second blog on learning and applying mathematics through computing: The Sinepost.

  • An Open Mind by Miles Berry (@mberry)

    Miles is a principal lecturer and the subject leader for Computing Education at the University of Roehampton. He sits on the boards of both CAS and Naace, with wide experience of curriculum development in the UK. His blog, a personal perspective on education, technology and culture, covers a range of interesting pieces on computer science and programming pedagogy, CPD and agile practice.

  • Computer Science Teacher by Alfred Thompson (@alfredtwo)

    Alfred is a high school computer science teacher in New Hampshire, having previously been the K-12 Computer Science Academic Relations Manager for Microsoft and a software developer for 18 years. He currently sits on the board of the Computer Science Teachers Association. His blog covers a wide range of topics, including computer science and programming pedagogy, curriculum development and US education policy.

  • Knowing and Doing: reflections of an academic and computer scientist by Eugene Wallingford (@wallingf)

    Eugene is an associate professor and head of the Department of Computer Science at the University of Northern Iowa. He has been blogging since 2004 on topics across computing, software development, higher education, learning and teaching, as well as managing and leading.

  • Raspberry Pi Blog by the Raspberry Pi Foundation (@Raspberry_Pi)

    These guys need no introduction, especially after the two millionth Raspberry Pi was sold in October! With the huge success and penetration of the Raspberry Pi over the past two years, the platform now exists for the Foundation to fulfil its wider educational objectives. A diverse blog, ranging from technical posts, peripherals and resources, to superb examples of innovative uses of the Raspberry Pi.

  • CSTA Blog by the Computer Science Teachers Association (@csteachersa)

    The Computer Science Teachers Association is a membership organisation (free to join), supported by the ACM, that promotes and supports the teaching of computer science and other computing disciplines in the US, providing opportunities for K–12 teachers and students to better understand the computing disciplines and to more successfully prepare themselves to teach and learn. Its blog covers a wide range of topics across computer science education, programming, curriculum design and education policy,

  • CAS Online by Computing At School (@CompAtSch)

    Computing At School is a membership organisation (also free to join), supported by the BCS, that promotes and supports the teaching of computer science in UK schools. Formed in 2008, it now has over 7000 members from across schools, colleges, universities, industry and government and is the subject association for computer science. Along with numerous high-quality articles in the quarterly CAS newsletter, Switched On, CAS Online provides the UK computer science education community with a wide range of forums, events, policy discussions, consultations and a veritable wealth of resources to support learning and teaching.

This set is most definitely incomplete — please post your computer science education blog recommendations in the comments below. You can also read some of my posts on computer science education.

Tagged , , , , , , , , , , , , , , , , ,

Ten Simple Rules for Reproducible Computational Research

In a paper published last week in PLoS Computational Biology, Sandve, Nekrutenko, Taylor and Hovig highlight the issue of replication across the computational sciences. The dependence on software libraries, APIs and toolchains, coupled with massive amounts of data, interdisciplinary approaches and the increasing complexity of the questions being asked are complicating replication efforts.

To address this, they present ten simple rules for reproducibility of computational research:
 

Rule 1: For Every Result, Keep Track of How It Was Produced

Rule 2: Avoid Manual Data Manipulation Steps

Rule 3: Archive the Exact Versions of All External Programs Used

Rule 4: Version Control All Custom Scripts

Rule 5: Record All Intermediate Results, When Possible in Standardized Formats

Rule 6: For Analyses That Include Randomness, Note Underlying Random Seeds

Rule 7: Always Store Raw Data behind Plots

Rule 8: Generate Hierarchical Analysis Output, Allowing Layers of Increasing Detail to Be Inspected

Rule 9: Connect Textual Statements to Underlying Results

Rule 10: Provide Public Access to Scripts, Runs, and Results


The rationale underpinning these rules clearly resonates with the work of the Software Sustainability Institute: better science through superior software. Based at the universities of Edinburgh, Manchester, Oxford and Southampton, it is a national facility for cultivating world-class research through software (for example, Software Carpentry). An article that caught my eye in July was the Recomputation Manifesto: computational experiments should be recomputable for all time. In light of the wider open data and open science agenda, should we also be thinking about open software and open computation?

Tagged , , , , , , ,

Interview with ITWales

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)

Tagged , , , , , , ,

Barack Obama on computer science and programming

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…)

Tagged , , , ,

The Times: “Program or Be Programmed”

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…

Tagged , , , , , ,