Fun with Swift operator overloading

There is this guy in one forum, writing all his sentences ending with at least two periods, mostly three… Always… This might help him, integrated into some text editor… Saving his keyboard strokes…

extension String {
   static postfix func ... (str: inout String) -> String {
      str = String(str.map {
         $0 == "." ? "…" : $0
      })
      return str
   }
}

var sentence = "Operator dotdotdot. For those. Who want to write. All sentences. With several periods."
let hisStyle = sentence...
print(hisStyle)
// Prints: "Operator dotdotdot… For those… Who want to write… All sentences… With several periods…"

What about adding a copyright at the end of text the user enters, using this brand new copyright operator, <©>

postfix operator <©>
extension String {
   static postfix func <©> (str: inout String) -> String {
      str += " © Antti J."
      return str
   }
}

var originalText = "Life is a b***h and then you die."
var copyrighted = originalText<©>
print(copyrighted)
// Prints: "Life is a b***h and then you die. © Antti J."

Well, back to some more serious work.

Giving feedback in corona times

Remote teaching challenges the way I have given feedback to students. Sometimes the things to comment are largish software design models with associated documentation. When teaching face to face, it is easy to explain, point with fingers, talk together. But in isolation, that is not possible. Commenting their work in writing takes a long time and leaves room for misinterpretations.

As I mentioned in the previous post, I decided to experiment giving audio comments instead of written ones. I look at their documents and UML models, and record my comments into an audio file. The file is then shared from cloud to the student group. For me this is faster than writing. Students are able to follow my thoughts since I take care to pinpoint what I see when I record the audio. Video conferencing could be an option but requires everyone to be there at the same time. Comments on recorded video? – does not provide enough added value, in my opinion. Furthermore, I am able to comment thoroughly (face to face teaching is usually in classroom hours, which are limited) which may benefit the quality of the work. Negative side is that students must tolerate my an hour or so long ramblings about their work in the worst case… I have now given feedback to 16 student deliveries, perhaps around 12-13 hours of comments.

Anyways, as this seems to work, I may continue giving audio feedback after the corona virus isolation ends. Whenever that may happen…

Not a real student feedback recording. I already deleted those from my machine.