Developer Journal, Mandela Day
Today celebrates Mandela Day, honoring the late activist and eventual head of state Nelson Mandela.
I canât really top that, so I guess we just talk about programming.
Mystic T-Square
GitHub - jcolag/mystic-t-square
If youâd like to skip the boring parts of this discussion of features, you can play Mystic T-Square to your heartâs content, instead. As a word of warning, though, it has features that still need testing and so havenât yet gone public. Put another way, the code there comes from my development version, not the repository.
I added a âloadingâ modal panel until the page has made its required network request(s), grabbing the spinner from the CC0-licensed options from Loading.io; I couldnât exactly ignore the three-by-three grid, after all, given the game. I tweaked the CSS to better match the pageâs styling.
And for the second project in a row, AutoAnimate has failed to accomplish anything useful. It loads onto the page and attaches (or whatever the library calls the process) to the grid on page load, and thenâmuch like my issues with Salaviâdoesnât seem to actually animate things. Clearly, I donât understand the documentationâs explanation of how to make it work.
Most importantly, though, by now, you should have the ability to play the entire game. The remaining clue from a couple of weeks ago said this.
You might recognize the name mystic square, in relation to puzzles and games.
While it has other uses, I meant the term âmystic squareâ to refer to a variation of the 15 puzzle. This, technically, qualifies as an â8 puzzle,â where the Tic-Tac-Toe game plays out on sliding blocks. You might capture a corner, but your opponent can slide that corner square away.
For now, the question-answerer and the block-slider take turns, both manual tasks.
Tying back to the animation issue, one bit of information that some people might find interesting in the development, clicking a non-slidable block shakes it to acknowledge that you clicked, but wonât do anything about it. I used Animate.css for that, since it has a straightforward approach. The good news? It takes almost no code; Iâd reuse the function, if I needed to animate more.
square.addEventListener('animationend', forgetAnimation);
square.classList.add('animate__animated', 'animate__headShake');
function forgetAnimation(event) {
const target = event.target;
target.removeEventListener('animationend', forgetAnimation);
target.classList.remove('animate__animated', 'animate__headShake');
}
However, I donât like that the library comes under the terms of the Hippocratic License. If youâd rather skip to the plans for this weekânot much else happened last weekâthan reading my complaining about a license, click right throughâŚ
A Long Detour into License-Land
For those of you still with meâŚ
The Hippocratic license, as Iâve mentioned, doesnât make much sense to me, since people who donât care about human rights also generally donât care about your Intellectual Property rights. But also, digging deeper, some treaties required for compliance have (among other things) a deep capitalistic and (pardon the term) ânormativeâ bias: Failing to charge for the game or not offer to pay for the libraryâor, rather, the labor that went into creating themâwhich seems inherent to the entire idea of sharing, may run afoul of the license, as I read it.
I donât mean that as a joke or exaggeration. People wrote these underlying documents in the 1960s, with a maybe-subconscious eye towards reinforcing patriarchyâeven while acknowledging that we should pay women equallyâand capitalism. They mention multiple times that everyone must receive a fair wage for their labor.
Fair wages and equal remuneration for work of equal value without distinction of any kind, in particular women being guaranteed conditions of work not inferior to those enjoyed by men, with equal pay for equal work.
This example seems like it requires an economy based on money and labor. If you use Free Software without donating to each project, based on how much effort went into the project based on the hourly wage of a typical developer, then you havenât upheld equal pay for work of equal value, which seems to openly violate Article 7 of the ICESCR.
However, it also demands protection from communal economic activity.
All peoples may, for their own ends, freely dispose of their natural wealth and resources without prejudice to any obligations arising out of international economic co-operation, based upon the principle of mutual benefit, and international law.
To me, this says that, if you support taxpayer-funded government services or international cooperation, and possibly if you work on and distribute software in a communal fashion, then you have a prejudice to cooperative obligations contrary to Article 11, and thus canât follow the license.
It gets worse, though. We also have weird gems about the status of familyâŚ
The family is the natural and fundamental group unit of society and is entitled to protection by society and the State.
âŚand education.
The States Parties to the present Covenant undertake to have respect for the liberty of parents and, when applicable, legal guardians to ensure the religious and moral education of their children in conformity with their own convictions.
They clearly wrote these without acknowledgement of domestic abuse or, oh, I donât know, maybe a massive right-wing backlash against the idea of schools teaching children about unhappy slaves or the existence of gay people. If you opposed the so-called Donât Say Gay (and similar) bills/laws or the fight against critical race theory, then you would defy Article 18 of the ICCPR, and therefore violate the license, because those laws say that they want parents and legal guardians to choose the moral education of children.
Even most fundamentally, the âunobjectionableâ Universal Declaration of Human Rights takes positions that I know for a fact that many of the licenseâs supporters oppose.
Everyone has the right to seek and to enjoy in other countries asylum from persecution.
This right may not be invoked in the case of prosecutions genuinely arising from non-political crimes or from acts contrary to the purposes and principles of the United Nations.
Great work on the first part, A+. However, all the refugees fleeing wars, climate destruction, gang violence, or even identity-based persecution, the UDHR says that they should not qualify for asylum. It doesnât take a neutral view on them, notice, or even ignore them, but actively forbids others from seeking asylum. If you support asylum for anybody whose government has not detained them for opposing government policies, then you probably took a stand against Article 14. Someone who tries and fails to overthrow a democratically elected government, by these rules, has a stronger claim to asylum than someone trying to get away from environmental devastation arising from policies after a successful coup.
Based on the phrasing of the license and its âmandatory documents,â it seems entirely reasonable to ask ifâfor a quick exampleâmy refusal to elevate parents to some sort of infallible priesthood excludes me from using anything released under the terms of the license. It seems even more reasonable to question whether a license that bases its existence in documents that have no interest in art or the public good has any business trying to intermediate between hobbyists sharing our projects. And I might also ask whether such a license can plausibly âdo no harm.â
Licenses, after all, donât work like job postings. You canât look it over and decide that you have more than half the requirements, and that should satisfy people. The ârestrictionsâ in a license represent the price that you pay for permission. If you canât abide by all the restrictions, then you donât have permission.
I should note that I could have missed something important. I canât help notice that the text written on The Hippocratic License page, labeled as The Hippocratic License 3.0âthe page where I got the list of international guidelines to reviewâdoesnât read like a license. Rather, it reads like a sales pitch for a license. However, everyone who uses the license links here, rather than to actual license text, and that page has no link to official license text, so I have to assume that this page describes the legal bond. But also, even if that assumption doesnât hold true, I picked glaring examples in the United Nations documents for clarity, to show that these requirements come from the underlying principles that also produced the âgoodâ requirements, meaning that an ethical actor should have concerns that even the most benign-sounding requirement might carry some unfortunate baggage with it.
I wonât even get into the âcustomizationsâ that only allow for certain political stances, political stances that specifically make the nightly news, and happen mostly âover thereâ for most Americans and Europeans. For example, I wonât, but a really mean person would point out that the license allows you to forbid softwareâs use by companies operating on land taken from Uyghurs and Palestinians, but not on land taken from Native Americans; those seem entirely equal in an ethical sense, except in whom they would exclude.
I apologize for the lengthy digression, but since I used the library, I didnât want anybody to see that as an endorsement of the license, and I want interested readers to know what I got myself into and why. In any case, the Mystic T-Square code accesses the library through a CDN, so I at least wonât find myself distributing it. But Iâd also view the library as a placeholder until something more interesting appears, and I will absolutely pull it out if the developers would prefer that I only use it if I fully agree with their stated principles, or would gladly welcome an audit of how well I conform to their standards and where/why I fall short. Iâd even happily publish the results of the latter.
Regardless, always read licenses before accepting them. Heck, always read licenses before publishing them, because as I said, I know that the people involved would oppose a lot of what they require, if they actually knew what they demanded.
Next
This week, Iâll probably add some small niceties to Mystic T-Square, and also see if I can think of a simple algorithm to play the role of the second (tile-shifting) player.
I should also comment the code. What started as a couple of quick ideas now covers almost five hundred lines of JavaScript code, plus all the HTML and CSS.
Credits: The header image is Nelson Mandela by South Africa The Good News, made available under the terms of the Creative Commons Attribution 2.0 Generic license.
By commenting, you agree to follow the blog's Code of Conduct and that your comment is released under the same license as the rest of the blog.
Tags: programming project devjournal