Stroustrup on the fine details

“An understanding of every language-technical detail of a language feature or library component is neither necessary nor sufficient for writing good programs. In fact, an obsession with understanding every little detail is a prescription for awful – overelaborate and overly clever code.”

Bjarne Stroustrup, The C++ Programming Language

Shouldn’t we worry about how “green” computing is?

People who want to save the planet always talk about how we should all buy EV’s, and convert everything to electricity (even if the source of that electricity is dirty fossil fuels like coal). Or get rid of plastic grocery bags, conveniently ignoring the aisles and aisles of plastics related to cosmetics and shampoos at the store. Or even how eating meat is hurting the planet, while ignoring the copious amounts of rainforests that disappear when people plant palm oil plants.

And nobody talks about how green computing is. And by computing I mean the whole gamut – machines, data centres, networks, mobile devices – they all contain computers and they are all a part of the problem. Even AI has an overhead because it requires a lot of computing power, as does crypto currencies. We don’t teach anything about sustainability in computer science, not nearly like we subconsciously did years ago when we had to achieve a lot with very little computing power. Now, nobody really cares, well except if you work for NASA, because efficiency still counts when you send things into space where there aren’t copious amounts of energy.

Clouds, which everyone takes for granted when it comes to GHG emissions, are a growing concern. Data from the International Energy Agency (IEA) shows that data centers and data transition networks generate 1% of the global greenhouse gas (GHG) emissions. More than half of what the aviation industry produces at 1.9%, and shock-horror. Should we give up some of our data needs to help the planet? Data centres also use copious amounts of water.

Even emails produce CO2 emissions. Here is a simple example for the 320 billion emails sent and received daily in 2021. In this approximation 25% have attachments, which incur 50g CO2 per email, and 75% are normal emails which incur 0.3g per email. There is no free lunch for a paperless society.

What about smartphones like the iPhone? Sure, using plastic-free packaging, and recycled materials in the manufacture of these devices is commendable, but it doesn’t mean these things are good for the planet. Apple’s own estimates pens the CO2 emissions of every single iPhone 14 (128GB) at 61kg of throughout its lifetime. As Sophia Whitham suggests in her 2022 article, If Apple cared about the environment, the iPhone 14 wouldn’t really exist. Like really, it is a superfluous product. It doesn’t really offer up anything much in the way of true progress. No iPhone 14 = no CO2 emissions, and other associated pollution. Consumerism with respect to electronics has a huge impact on GHG emissions. A new series of iPhone’s comes out every year, and most people upgrade every 2 years, but the lifespan of an iPhone can be 4-5 years, and longer if components were easier to upgrade/replace. An iPhone may not be completely bad for the environment, but they could their lifespan could be made more sustainable beyond the factory. Let’s not even talk about the amount of physical e-waste created every year.

Most of the GHG emissions in a smartphone come from production. For the iPhone 14 this represents 79% of its emissions, and most of that likely is attributed to mining the rare minerals that are needed to build the phone. To put this into perspective Apple says “use” accounts for 18%. This means that buying one new phone takes as much energy as recharging and operating a smartphone for an entire decade. So keeping a smartphone for 3-4 years can make a good impact on your GHG footprint. It’s not just about looking at a smartphone in isolation, as there are larger issues that don’t make it into the 61kg for the iPhone 14. We’re now talking about the mobile data these hungry devices use… and hence we are back to talking about data centres.

While smartphones represent the fastest growing segment of ICT, the biggest culprits with respect to GHG emissions are the servers and data centers that feed the smartphone environment. Google searching, app use, video streams, emails, and cloud storage all contribute to this “hidden” carbon frenzy. And this is somewhat of a self-perpetuating cycle – more, smarter smartphones need more data, faster, which in turn requires faster more efficient servers, which in turn requires faster networks, and then smartphones capable of running newer apps. Basically data streams cause GHG emissions and few people think about it. Greenly suggests that taking the data stream into account the real footprint of the iPhone 14 over 4 years is 313kg.

Which is to say, we don’t think enough about how technology impacts the environment, and GHG emissions. We don’t think about it because few people talk about it. People seem to harp on about the impact of cows burping and farting, but ignore technology. In fact farming cows has become incredibly sustainable (removing all meat and poultry production in the US would only amount to a 0.36% reduction in GHG emissions). And even though cows produce methane which is a worse GHG than CO2, methane lasts for approximately 12 years in the atmosphere, versus over 300 years for CO2. Food for thought right?

Let’s start by educating people better, and focusing on a more balanced view on climate change, not ignoring the devices nearly everyone on the planet seems to own, and remembering that tethered data, has a footprint as well.

Wirth on “Good enough software”

“Good enough software” is rarely good enough. It is a sad manifestation of the spirit of modern times, in which an individual’s pride in his/her work has become rare. The idea that one might derive satisfaction from his or her successful work, because that work is ingenious, beautiful, or just pleasing, has become ridiculed. Nothing but economic success and monetary reward is acceptable. Hence our occupations have become mere jobs. But quality of work can be expected only through personal satisfaction, dedication and enjoyment. In our profession, precision and perfection are not a dispensible luxury, but a simple necessity.

“A Few Words with Niklaus Wirth” in Software Development, 5(6) June 1997.

High school GPAs are *way* too high, and that’s a big problem

There was an article on CBC’s website yesterday – What Ontario’s rising high school grades mean for university admissions. In it, a student with a 96% average couldn’t get in to the business program in U.Toronto, Queens or McMaster. How did this come about? Well there are two things at play here.

The first is that pandemic or not, grades have been inflated in high schools for a long time. Far too many students have an average in the 90’s. This is partly from the culture of making everything easy, and having everyone pass. Everybody gets good grades because that is what we have ingrained in students minds – nobody loses, everybody gets an award. Sometimes teachers are to blame here – it’s easy to give people good grades, and avoid the graft o”f actually having to grade work. A result of this culture of “winning”, means that some students vehemently believe they are owed a 95+, even through their work is actually a mediocre 70 (or even less).

It’s not logical that that many people have GPA’s in the 90’s. There aren’t that many smart people about. There is also the issue of elementary/secondary school gifted programs, those programs for students whose parents think their child is more intelligent than their peers. The reality, most aren’t. It seems like it’s just another scheme to make some students think they are better. These programs are actually a complete waste of money – very few of these students who make it to university show any really sign of being “gifted”. But that’s the problem, when lots of students get 90+, it sort of loses its meaning. Then there is the cheating, which is likely fairly rampant. Some schools even have the notoriety of being on a list of known grade inflaters, with student grades are adjusted accordingly by university admissions. But a lacklustre secondary school system is one part of the problem. Universities are the other.

If you think the problem self-corrects in universities, think again. GPA’s in universities are going up, and not surprisingly no one wants to talk about it. I have taught classes where the class average was an A, but there is little one can do for a number of reasons. In courses that are “technical”, i.e. STEM, facts are facts, and therefore unless assignments are exceedingly complicated or the rubrics to grade them are long and intricate, most students “fulfill” the criteria for assessment. Honestly few faculty have the will-power to argue with dozens of students over their “interpretation” of the assignment. Things are a little different in the humanities, where you actually have to have an opinion about things, and back it up with reference material. Then there are the large class sizes, anywhere from 200-500 students, which are the norm in many programs. Complex assessment strategies are prohibitive in these scenarios because there just isn’t the support, and you honestly don’t know how good teaching assistants really are.

There are a lot of courses there that hyper-inflate grades as well. And students constantly beg for more grades, because they “feel” like their assignment is worth 100%. Feelings are not reality. But yes, universities are just as much to blame for graduating some students with over-inflated grades. But incoming cut-offs, well that’s another story. You see universities in Ontario get less government money these days, and it’s hard for them to jack up tuition due to years of tuition freezes, so many have opted for the easiest way to make cash – international students. So let’s say that the fees for a domestic students for computer science are C$10,000 for two semesters, a normal academic year. The same fees for an international student are C$37,000. You can see where this is going.

If the normal admission cohort for a program is 200 domestic students, this brings in C$2 million. However if you bring in 50 international students, while at the same time reducing the domestic admissions to 150, the income stream rises to C$3.35 million. Same amount of students, 1.675 times the revenue. The problem is that it makes competition for the remaining 150 domestic spots tighter, and the best way to weed out more applicants is to increase the cutoff scores. Why not take in 250 students? Because that can cost you more in resources.

This can become a bit of a vicious cycle. Universities increase cutoff scores, high schools increase grades. Of course it seems like we have reached somewhat of a stalemate, because if you need a 98% to get into a business school, what happens next? 99%? 100%? We have built a great house-of-cards, and to fix it school boards have to go back to basics, and actually give students the grades that actually deserve based on their true abilities, not the fantasy world we seem to live in now. That means more realistic, harder assessments. Are we asking too much?

Does university broaden the mind?

“Three or four years spent at a university cannot teach a man to know history; they cannot train him as a politician or publicist or publisher; they can at best begin to lay some foundations for a view of the world and (universities being what they are) are likely to lay foundations which, as later experience shows, need to be broken up. None of this invites blame: the impossible need not be attempted. But if those years do not produce an effective conditioning of the reasoning mind, if they do not teach a man to think better than otherwise he would have done, they may justly be condemned as a waste of time.”

Elton, G.R., “The Practice of History”, Sydney University Press 1967

Wirth on “Good languages”

“Good languages not only rest on mathematical concepts which make logical reasoning about programs possible, but also on a small number of concepts and rules that can freely be combined. If the definition of a language requires fat manuals of hundred pages and more, and if the definition refers to a mechanical model of execution (i.e. to a computer), this must be taken as a sure symptom of inadequacy.”

“A Few Words with Niklaus Wirth” in Software Development, 5(6) June 1997.

Ignore-land

Why do some people choose to ignore facts?

It seems to be an outcome of the world we live in. We live in an age where people think it’s okay to rewrite history. I guess that understanding history is less important than how people “feel” about things that have happened in the past. No one can change history, and as a side-note you shouldn’t try to change history as it is written. The problem is that some people think they have their own notion of some historical events, even though they have done little or no research on the topic… unless of course it is research by means of social media, which doesn’t count in any way.

The thing is that you cannot rewrite history, any part of it. Sure there are parts of history we don’t fully understand, but that is usually because there are few if any artifacts or writings to decipher, or few to no historical records of any sort. Sometimes there were writings, but they are long gone, often destroyed by the likes of city fires. A good example of this is the 1728 fire of Copenhagen where The University of Copenhagen lost some 35,000 texts and a large archive of historical documents. All historians can do in this situation is hypothesize what happened until more evidence is found. So someone that knows nothing about nothing has no basis for making claims about anything.

Sometimes Hollywood or historical rumours perpetuate historical falsehoods, for whatever reason. Good examples include the idea that Vikings wore horned helmets (they didn’t), and Columbus discovered North America (he didn’t set foot in North America, and in all likelihood the first Europeans to set foot in North America were the Vikings). Sometimes ideas change over time – for a long time people believed that rats spread the Black Plague, but a 2018 study by the University of Oslo has found that it actually spread largely by means of human fleas and lice.

History is also something that happened in the past, and as such we should learn from it, but once fifty or a hundred years have past, it is impossible to rectify things that have happened. People must learn from the experience, and move on. History teaches us nothing, because some people refuse to listen to the lessons of the past.