Lord, we remember that there are some who find themselves working on projects whose value they doubt or whose likely outcome they disapprove.
Help them, Lord, to decide whether to stay on in the hope of effecting change or whether to leave. Especially we pray for those forced by economic necessity to remain in uncongenial work.
May they know your forgiveness,
and may the world of science and technology be ever open to your redeeming Spirit,
that your will may be fulfilled in all that we do. Amen.
(David Welbourn)
1 Operator overloading
You can redefine the functionality of Python built-in operators to work with your class (like +, -, *, etc).
For example, to compare cards of different ranks, you define the methods corresponding to __lt__ (<) and __gt__ (>)
All the operators you can overload can be found in this link.
2 Class inheritance
You can derive new classes from old classes, which is called class inheritance. This is useful if you want to add extra or different functionality but don’t lose what you already implemented. See, for example, a class for an Animal:
class Animal():def__init__(self, age, color):self.age = ageself.color = colordef crossbreed(self, other):return Animal(0, self.color+' and '+other.color)def make_sound(self):print("Animal speaks!")
We can generate some derived classes by putting the parent class inside the parentheses in the class definition
class Dog(Animal): # Dog is a subclass of Animaldef__init__(self, breed, age, color): # reimplementing the constructor methodself.breed = breedself.age = ageself.color = colordef make_sound(self): # reimplementing the make_sound methodprint("Woof woof!")class Cat(Animal):def make_sound(self):print("Meow!")# main chunkfido = Dog('boxer', 2, 'brown')whiskers = Cat(2, 'black')turtle = Animal(1, 'white')fido.make_sound()whiskers.make_sound()turtle.make_sound()
Woof woof!
Meow!
Animal speaks!
We can treat our Dog and Cat as also members of the Animal class! This is what we call polymorphism. For example, if we call crossbreed in any of the Dog and Cat object
But the problem now will be that we can crossbreed animals of different species… which is a mistake! :P
3 Exercise: shapes and areas
Let’s implement a general class called Shape and two subclasses called Circle and Rectangle
Overload the __eq__ operator to compare the shapes’ areas
Override the constructor methods: Rectangle should have width and height, and Circle should have radius
Write methods that calculate the areas of the shapes. When you have only the generic Shape object, area should be equal to zero.
what about trying to implement the rendering of these shapes with turtle graphics?
4 Network power and platform capitalism
In the last two weeks we have been seeing how our acting is mediated by networks - of tools, institutions, cultural standards, and even more today, of digital objects and information systems (remember the semantic web).
One of the effects of this is the establishment of what David Singh Grewal calls network power: the configuration of a network where, in order for anything to work, it need to pass through you.
In other words, the most powerful actors in our world are the “hubs” of the networks that information systems build.
One way of seeing that is by observing the rise of platform capitalism.
Companies dominate and monopolize the market by becoming the main hub through which things are done. e.g.: Google, Amazon, Intel, Uberl, Airbnb.
The value of the product/service is established by the size and reach of its network (e.g.: you use Facebook because everyone is there).
This is all a process of centralizing power over a few actors who have the power to dictate how everything will work.
4.1 The effects of network power
The Bible is clear about a Babelic motif of centralizing power:
“Then they said, “Come, let us build ourselves a city, with a tower that reaches to the heavens, so that we may make a name for ourselves; otherwise we will be scattered over the face of the whole earth.” Genesis 11.4
There are reasons to interpret this narrative as the formation of an unjust and oppressive centralizing power, see, for example, the study by Ari Lamm
“Also it causes all, both small and great, both rich and poor, both free and slave, to be marked on the right hand or the forehead, so that no one can buy or sell unless he has the mark, that is, the name of the beast or the number of its name.” Revelation 13.16-17
4.1.1 1. Cultural uniformization
Suddenly we are forced to comply to the only few means available in order to do anything (ex.: having a smartphone)
This generates economic exclusion, [economic compulsion]https://books.google.com/books/about/Economic_Compulsion_and_Christian_Ethics.html?id=VavWLQP0elQC() and incapacity to live in other terms
All the colors of creation dissolve into a neutral gray in the machinery of technological infrastructure.
Abraham Kuyper, the neocalvinist theologian and social theorist, argued that Christians should resist this societal uniformization, and argued in favor of a social pluriformity. God loves diversity and flourishing in diversity. (See MOUW, 2011)
Yuk Hui, in his book “The problem concerning technology in China”, proposes the urge of a technodiversity: similar to a ‘monoculture’ in agriculture, a ‘mono-technology’ paradigm impoverishes our cultural landscape. Thus, similar to an “ecodiversity”, we need a kind of “technodiversity”.
4.1.2 2. The problem of complicity
“With multiple individuals or parties involved, responsibility for decisions and actions can become diffuse, making it unclear who should be held accountable for a particular outcome. This can lead to a lack of accountability, as no one person or entity is seen as primarily responsible.” - Ibo Van de Poel
Am I culpable if I buy or use a service/product produced by illegal and unjust means?
Surely this should depend on the power I have to make things different…
However, in which “network” should we participate? How can we understand complicity in these big networks of today?
4.2 Resisting network power
4.2.1 1. An ascetic orientation: voices from the desert
Sometimes, we may opt (and only when we can) to reject participating in some technological networks.
With this resistance, we begin to see other other “languages” and aspects of the word which cannot be translated directly to our fixed means and technological systems.
This is not being “anti-technology”, but “non-technology”.
“True freedom is freedom to say ‘I prefer not to’. To resist in place is to make oneself into a shape that cannot so easily be appropriated by a capitalist value system. […] It means recognizing and celebrating a form of the self that changes over time, exceeds algorithmic description, and whose identity doesn’t always stop at the boundary of the individual.” - Jenny Odell, “How to do nothing”
4.2.2 2. A hopeful acquiescence: voices at the city
Sometimes, we cannot resist everything and try to rebuild everything from zero. Sometimes, we need to take part in the sinful structures of our world and suffer with it. Sometimes it is through the network itself that we can show something that goes beyond it.
Dietrich Bonhoeffer calls this the “vicarious participation” of the church in culture.
Ex.: the church flourished in a culture where slavery was the basic infrastructure. First Christians knew that they couldn’t change everything top-down, but through their patience and hope, things changed, from bottom-up.
4.3 Implications for programming
Ascetic orientation: don’t take computers, programming and data too seriously - they can’t do everything and sometimes there is a lot more of meaning and goodness beyond them. Sometimes you don’t need them.
Hopeful acquiescence: use the libraries and infrastructures you need, but keep an eye on injustice, and choose your battles. Sometimes you won’t be able to fight everything, much less start things again from scratch.
Support technodiversity and practices that help limiting today’s network powers. Ex.: open software and open hardware movements usually have interesting directions and solutions. We’ll talk about those in the following weeks.