What is programming? How would you visualize it? Probably a bit like in the Wachowski sisters' film The Matrix (2000): lines of different codes forming a world, or simply a program. But that's not the closest you'll get to coding. No, there are much stronger metaphors for this activity, including pasta.
Metaphor in computing
The question of metaphor in computing is not a new approach. In order to better address, among other things, notions of interface, it has been necessary to think about concepts. "Windows" is no stranger to thinking in terms of different windows leading to Internet browsers, word processors, videoconferencing software and so on. The operating system was conceived as a house that would open onto different points of view and computer tools.
As a result, many applications today try to offer metaphors that will appeal to users. "Paper", an iPad drawing application, plays on the impression of working with a real sheet of paper. Software that lets you see a company's financial results will be described as communicating its pulse. Of course, a company is not a living thing, but playing on this image illustrates the extent to which the user will be able to follow the data almost in real time. Some try to compare their creation to a city, a factory or a garden.
But beware of such metaphors, as software specialist David B. Black reminds us. Black. The wrong vision of a program will lead to major errors. Among other things, he is wary of house analogies. Many call themselves "architects" of their application. Admittedly, this specialist designs plans, but for a tangible object that, sooner or later, can no longer be altered. This is quite the opposite of software, which is invisible from the outset and must evolve constantly.
Those who see their creation as a factory are taking risks. If factories are capable of producing the same thing over and over again, a good program must be able to bend to the different requirements of its users.
Programming is like...
So, if computing in general uses metaphors, it's not surprising to see programming adopting analogies too. For example, this site specializing in agile programming (known as Scrum) will compare the approach to, among other things, a bolt that holds elements together, a foundation on which to build for the long term and a direction in which the team of programmers can embark.
Teaching code can draw on various comparisons to reflect on with learners:
- Like mechanics: learning the workings of a programming language and its logic
- Like an organism: understanding the subtleties of complex code structure
- Like a brain : grasping the intelligence behind programming
- Like a transforming flow: how code can help solve problems
- Like a culture: what cultural context does programming fit into?
On this last point, Simon Fraser University professor Jon Corbett has literally thought out code using Nêhiyawêwin, one of the Cree dialects. His idea was to decolonize the programming, which was practically all in English, in order to offer it to First Nations peoples. A Métis himself, he realized that programming was a way of telling a story that a computing machine could understand. So his programming language takes into account the concept of the narrator and certain ancestral rites. In his version of the code, there is an equivalent of "burning herbs to purify the body", which corresponds to a function for emptying hidden and physical memories.
The code can therefore be explained in many ways. Examples can be seen on this page of drawings specifying an API (application programming interface) or JavaScript code. The metaphor of lasagne is often used to illustrate the difficulty of modifying code. As in this pasta dish, each layer appears to be in order, but adding or removing things carelessly could lead to the meal being crushed. Tortellini are a good example of how program architecture is created in small sauce packets (source code) to design software. The whole thing is basically governed by the SOLID acronym created by software engineer Robert C. Martin.
And if the pasta metaphor sounds far-fetched, it's even possible to use popular culture as an analogy. The Star Wars universe can be used to talk about variables (with the different colors of sabers in the saga), the principle of loops to make a droid like BB-8 roll, and so on.
Not many comparisons are off-limits when it comes to introducing programming. All that's needed is to find the approach that will win out according to the chosen objectives, and the learners can then discuss, reflect and act around this image given by their teacher.
Photo: Maik Jonietz / Unsplash
References :
Black, David B. "Summary: bad software metaphors lead to bad results." Blackliszt. Last updated June 5, 2023. https://www.blackliszt.com/2023/06/summary-bad-software-metaphors-lead-to-bad-results.html.
Corbett, Jon. "Cree coding." Pinnguaq. Last updated April 28, 2023. https://pinnguaq.com/fr/stories/cree-coding/.
Craig, William. "5 reasons why metaphors can improve the user experience." WebFX. Accessed September 29, 2023. https://www.webfx.com/blog/web-design/5-reasons-why-metaphors-can-improve-the-user-experience/.
"Cree coding decolonizes computer programming." SFU Research. Accessed September 29, 2023. https://www.sfu.ca/research/scholarly-impacts/cree-coding-decolonizes-computer-programming.
"How do you use metaphors to communicate your software design to non-technical stakeholders?" LinkedIn. Last updated September 1, 2023. https://www.linkedin.com/advice/0/how-do-you-use-metaphors-communicate-your-software.
"May the code be with you: teaching code with Star Wars." Code Week. Last updated: May 4, 2023. https://blog.codeweek.eu/may-the-code-be-with-you-teaching-code-with-star-wars/.
"A picture worth a thousand programs." Maggie Appleton. Last updated 2021. https://maggieappleton.com/programming-pictures.
"Programming with pasta." Patrick Corbett. Accessed September 29, 2023. https://www.pmcorbett.tech/work/strained-pasta-programming/.
Slotte Dufva, Tomi, and Mikko Dufva. "Metaphors of code-Structuring and broadening the discussion on teaching children to code." ResearchGate. Last updated September 2016. https://www.researchgate.net/publication/308276346_Metaphors_of_code-Structuring_and_broadening_the_discussion_on_teaching_children_to_code.
"System metahors can be powerful." PremierAgile. Accessed September 29, 2023. https://premieragile.com/system-metaphors-can-be-powerful/.
See more articles by this author