Some of my fondest memories from childhood are the times my dad let me tag along on his weekly trips across the expanses of Northern Ontario in his 18-wheeler. As you might imagine, a daily ritual on these trips was one of washing up in some dingy restroom1 before eating a greasy breakfast (“two eggs sunnyside up, bacon soft, rye toast please”).
All these years later, the biggest lesson that stuck with me was “leave it better than you found it.” In other words, not only “clean up after yourself,” but also “clean up the mess you found.2” After all, the next guy’s going to appreciate a clean space to start his day.
Old code is like a dirty truck stop restroom.
As part of working on code guidelines for my day job, I read a bunch of the code standards and adjacent posts. None of the documentation, blog posts and idioms (DRY, KISS, etc) really touch on legacy code. I suppose it makes sense since they are generally aspirational documents. At the same time, I think these documents are incomplete without touching on it.
As programming languages and platforms mature and fads of the moment fad away, it’s becoming more and more common for developers to run into old code. Maybe even code that’s predates code standards in a given language. This is certainly the case in my day-to-day.
While it’s relatively straightforward to install IDE tools to format you code properly and keeping it simple can be easy when you don’t have to consider a decade of backwards compatibility. It’s less obvious when you’re not working with a clean slate. What do you do when you encounter ugly code? What about when repeating yourself it the shortest path to a complex fix? Should you re-write an entire library because doesn’t hold up to code standards?
I propose adding LIBTYFI3 to the lexicon of idioms.
If the code is ugly and misformated. Fix it4.
If you’re repeating yourself or having trouble keeping it simple. Step back and assess what you should actually be refactoring. You’ll probably learn something about the application in the process.
If variable and functions are named poorly. Fix them.
If comments are missing. Add them!
If tests are missing. Add them.
In other word, if code is not holding up to current standards, rewrite as much as possible as long as it’s tangentially relevant to your task.
Obviously this is going to take more time than a quick fix. Perhaps, if your task is truly a critical fix you should skip some of these steps. But stakeholder should understand that legacy projects are complex and taking time to do it right will lead to a better product in the long run.
1 – Lest you question my Dad’s parenting choices, I can assure you small town Northern Ontario truck stop restrooms in the 80s/90s were not nearly as sketchy as the image you probably have in your head from movies and TV.
2 – This rule did not apply to toilets.
3 – Libby-fi? Sounds like some poorly thought out Liberal social network.
4 – But please for the love of god, isolate style from functional fixes in their own PRs.
Yesterday Facebook surfaced one of my aunts posts in which she alluded to a conspiracy theory that the COVID-19 death numbers are being fabricated. Normally my response to these sorts of posts on Facebook these days is to simply hit the “snooze for 30 days” button.
But this was my favourite aunt who I’ve respected since I was a child. She is not a “crazy aunt,” she is level-headed and well educated. Facebook has also never shown me a post of hers like this before, so I assumed she still had her wits about her.
I decided to spend some time with a thoughtful and researched reply. It was as follows.
There are a bunch of ways in which this statement doesn’t pass the smell test:
1. “We can’t know that the people who died, died from Covid19” I don’t think that the statement is true. I think we can know in the vast majority of cases. People are not randomly getting some a combination of symptoms similar to: kidney failure, pneumonia, meningitis, etc. Doctors know what the symptoms look like, they even have a test for the disease. If someone has the symptoms, they test postive for the disease and then subsequently die, it would be silly to say that they didn’t die of the disease.
2. “ANYONE who tested positive with COVID at the time of death has been marked as a COVID death.” I believe this is consistent with the way that causes of death are typically attributed. For example, if someone suffering from HIV/AIDS dies of a pneumonia, their cause of death will be recorded as “HIV/AIDS.” Same with people suffering from cancer. If someone with lung cancer dies of lung failure or pneumonia, their cause of death will be listed as “cancer.” Perhaps in an obituary it may be listed as “complications of cancer.” But in terms of statistics and epidemiology, deaths are attributed to the deadly diseases the victims were suffering from. So the statement “we can’t know that the people who died, died from Covid19” is not relevant because it’s consistent with the way that we normally attribute causes of death.
3. “…even if they died from any other cause.” If someone dies in a car crash what is their cause of death? Cars don’t have some sort of ability to suck our souls out of our bodies. A car crash will cause various injuries which will end our lives. Those injuries are the direct cause of our death, but the car crash is the reason we received the injury, so we say that the car crash was the cause of death. If an unwell person becomes infected with COVID and their body is unable to go living with the added stress of fighting off COVID, then COVID is the factor that tiped the scales of fate, so we would say that COVID caused their death.4. I think you might be alluding to this idea that non-COVID deaths are being attributed to COVID. Even if this were true, the numbers don’t add up. For example, the average number of deaths in New York City 145 per day. On April 7th, New York City reported 545 deaths. Even if every single death under normal circumstances was being reported as a COVID death in NYC, the numbers would only be around 145. Not 375% higher!
Now there’s no denying that the US media thrives on fomenting fear uncertainty and doubt. They make a living keeping the US public in fear and uncertain of the truth. But I can assure you that the Canadian media and media in most of the rest of the western world do not operate this way. The tone here is not one of fear, it’s one of solemn resignation to a fate beyond our control. It’s one of steadfast dedication to flattening the curve by doing our part.We’ve got this.
Her response was short and polite but I did not sway her opinion.
It’s becoming more clear every day, the USA is a failed state. We are witnessing the fall of an empire.
A friend of mine told me that he literally hits “snooze for 30 days” on every post that comes up in his feed.
It works rather well. The people you don’t care about, you only see monthly. For the people who you do care about, you get a monthly reminder to creep their profile
During my stay in pre-COVID Finland in Feburary I participated in far to many nights of cycle-based pub crawling for a man of my vintage. One night we checked out a local pub called Ravintola House (Restaurant House?) a minutes from our place Pateniemi.
We arrived early for a midnight performance of Kulmakunnan Kutkuttajat. As the regulars started to trickle in the DJ played typical euro-dance-esque. For a few rounds Aura (or was it Karhu) none of the music piqued my interest in particular. IIRC Canada’s own Len made an appearance on the playlist.
Then the Venga Bus showed up and when it drove off suddenly the music took a distinctly tropical turn. It was the last thing I expected, I was so blown away I quickly downloaded Shazam and let it log the playlist for the next hour.
Today I finally transcribed that playlist into Spotify.
You can’t not to chair dance while you give this a listen. Read on for my thoughts, supplementary research findings and ratings.
R3HAB x A Touch Of Class – All Around The World (La La La)
In retrospect, I’m not sure if my Shazam log caught the entire set or when exactly it kicked in, there’s nothing particularly out of place or samba-influenced about this one.
Often when I’m working on code in the evening I’ll throw on an EDM festival live set and this one seems to be a staple banger. I assume it’s popular with the kids.
If the audience wasn’t primarily middle-aged Finnish rock fans and instead college-aged flower lei fans this would be have been totally expected
Verdict: 4/5 – It’s catchy.
Arash feat Sean Paul – She Makes Me Go
Arash is a Swedish Iranian singer who represented Azerbaijan at Eurovision 2009 because wut?!
Sean Paul must have the world’s most terrible yet recognizable voice. I can’t stand Sean Paul.
Suffice to say I was not expecting to hear Mr Paul 9000km from Jamaica. I wonder if you’re random pop star in a non-English-speaking country, can you just hire Sean Paul to appear on your track?
Verdict: 0/5 – I hate Sean Paul.
Madcon – Glow
I assumed this was some Will.i.am produced project that just never heard of before. It’s got that inoffensive 2010s vaguely electronically, rappy formula that Will.i.am has repeated dozens of times. But Madcon is totally Swedish and as far as I can tell, no will.i.am involved. Though they were most certainly “influenced” by him on this album.
Their claim to fame appears to be touring with Gang Starr in the 90s. I gave 2010s Contraband a list, it’s decent.
Adelén – Bombo
I cannot stop listening to this track. ABSOLUTE BANGER!
Adelén is a Norwegian latin pop singer. It’s an English song with an Spanish hook because European are doing absolutely everything they can to prove that borders are meaningless.
P.S.S. Wait, is this a Zumba song? That might explain everything. I don’t care I still love it. Maybe I should try Zumba.
Tones and I – Dance Monkey
This one is popular with the tik-tok-set worldwide. The first time I heard it I thought it was decent. But it’s one of those one hit wonders that relies heavily on repetition and get stale quick.
Verdict: 2/5 – meh.
Mr. President – Coco Jamboo
If I had watched Electric Circus in 1996 I am pretty sure Monika Deol would have played this one every week. But I definitely didn’t watch that. Nope.
Song was the most blatant Ace Of Base imitator of 1996. But it’s tropical reggae fusion beat fits right in with this set. Amazingly.
Verdict: 3/5 (+1 because it was snowing outside).
Eppu Normaali – Vuonna ’85
I wonder if Finland has a CanCon-esque regulation that requires clubs to play a certain amount of Finnish music. Because that track was totally out of place in the set.
Wikipedia lists them as a punk band and I was pretty excited to check out some 80s Finnish punk. Unfortunately this track is the only cut on 1985’s Kahdeksas Ihme that’s vaguely punk. As a standalone it’s catchy.
Verdict: 4/5 (+1 for that weird 80s stereo vocals thing).
Hausmylly – Ikävä Lokakuu
Verdict: 0/5 – Bad 90s eurotrash.
Anssi Kela – 1972
Kela seems to be a big deal in Suomi. His debut album sold 150,000 copies which seems huge. The video for this song has over 2.6M views.
1972 starts out strong with a soft Les Paul and softer drums, an intro that wouldn’t be out of place in mid-00s emo. For a moment I excitedly thought “oh, have i stumbled on Finnish emo?!”
Unfortunately the chorus proves I am totally wrong and this is just standard “rock.” I gave the rest of the album a listen, but nope, no emo to be found.
Back on track with the dancey-dance. I’ve always thought Move Your Body was a more solid track than exceedingly cheesy “blue.” The stronger acid bass ups the banger factor by an order of magnitude. The bridge is more melodic. The string pads suffer a bit from that late 90s thing where SoundBlaster 16 can’t properly reproduce string samples or something. Blah, blah, great track.
Verdict: 5/5 – still holds up.
ICE MC – Think About The Way
I am almost certain that this was another Electric Circus standard. I mean it shouts out Canada after all. The vaguely Reggae styles of Mr MC must have been what earned it a place on this playlist.
Fun Fact – this single was released on the short-lived CD Maxi format.
Verdict: 3/5 – would be better as a happy hardcore remix.
Günther (with The Sunshine Girls) – Teeny Weeny String Bikini
Swedish vocalist + latin influences = the spiritual successor to Bombo. Teen Weeny String Bikini has no redeeming qualities. Dude’s creepy AF voice ruins it. I wouldn’t be surprised if he tried to murder the Carol Baskin of Sweden in a bikini-based feud.
Don Omar feat Lucenzo – Danza Kuduro
Last track on the playlist is legit Latin Pop from Puerto Rico. I recall hearing Danza Kuduro in a few place out and about. Looks like it hit number 1 on every chart in most of Europe (didn’t break top 80 in North America).
It’s a solid banger.
Verdict: 5/5 – Europe is having a real Latin Pop moment and so am I.
I sometime describe myself as “an aspiring cyclist.” I enjoy cycling a lot and recognize all its environmental and health benefits, but unfortunately like most Canadian parents my day-to-day is not very conducive to a cycling-based lifestyle. In Winnipeg, as is the case in most North American cities, the built environment abandoned the bicycle sometime in around the 1950s when we started to replace electric trams with diesel buses. So at best, I can only aspire to be a cyclist.
Earlier this February, I had the pleasure of joining the Counterpoint team in Oulu, Finland for a winter cycling retreat of sorts. Oulu is a city barely south of the Arctic Circle in Northern Finland. It has a population and land area of roughly half that of Winnipeg, yet it boasts and incredible 600km of cycle/pedestrian pathways, including over 100 underpasses. I spent 6 days (logged 100km) exploring the city by bicycle.
In addition the the many underpasses, in the few places where cyclists are required to intersect with a car crossing Oulu’s streetlights are designed to sense cycle traffic and prioritize it by switching the car traffic lights to red. With this system we were able to cycle the 10km from our suburban airbnb to the downtown core without stopping. The cycle path system also includes comprehensive way finding and a west-to-east numbering system making navigation easy, even without Google maps.
Overall it’s an incredibly well designed system, built from the ground up with cycling as a priority. Unlike our systems here where we are largely trying to wedge a cycling network into an environment built for cars.
But unpinning Oulu’s cycling network is something that Winnipeg already has. Something we could adopt in many places around the city without spending massive amounts of money building new infrastructure… two meter wide “sidewalks.”
Every single roadway in Oulu (and I can only assume much of Finland) includes a roughly 2 meter wide light traffic right of way along side at least one side of the car/truck right of way.
Have We Been Overthinking Cycling Infrastructure?
Dedicated protected bike lanes are great and super important for much of the existing road network that we have in cities like Winnipeg. But they’re also very expensive to build and they’re hard to approve since they often involve disrupting the ever-important car. Thing is, in my entire time in Finland I didn’t encounter a single “bike lane.” I’m not sure they actually have any.
And when I got in to my car for the first time after getting back and drove down Ness avenue, it immediately hit me! We already have wide sidewalks all over the city! We are just using them poorly.
Cycling On The Sidewalk
Under current city bylaws it is technically illegal for adults to cycle on the sidewalk. Many parts of the city have <1m wide sidewalks and on those narrow sidewalks it’s understandable, they’re not really wide enough for a cyclist to share with a pedestrian.
Unfortunately, this regulation sends a strange message that bikes are dangerous and completely sidesteps the real problem of sidewalks that are much too narrow.
I’d propose changing this legislation to allow for wider sidewalks to be designated shared pedestrian and cycling pathways. Explicitly, with well placed signage and a proper public awareness campaign. (Oh and while we’re at it get rid of those lame no skateboarding laws too!)
Examples of Poor Use of Space
Much of Ness Avenue has wider than average sidewalks. For some reason the utility poles and signage is in the middle of the sidewalk! Move that junk to the outside edge and suddenly you have cycling infrastructure on Ness! For much lower cost than ripping up the street and building some bike lanes.
Portage Avenue has sidewalks that would be plenty wide for cyclists to share with pedestrians, if it wasn’t for all the random garbage cans, no parking signs and other junk. Moving those out of the way would cost nothing at all. Perhaps we’d need some new regulation to explicitly describe how we are allowed this space. But do that and suddenly we have cycling infrastructure down portage!
Similar story on Southbound Henderson Highway. The sidewalk is plenty wide, but it has all kinds of random, no-sidewalk junk all over the place. Get rid of that junk and SUDDENLY WE HAVE FREE CYCLING INFRASTRUCTURE!
Conclusion: Just Do It
I’m sure I could find many many more examples like these around the city. I seem to recall the city “upgrading” these sidewalks a couple of decades ago so that they could stop replacing grass that was destroyed by the road salt every winter.
A couple of simple bylaw changes and relatively small scale projects to move a couple of light posts and garbage cans and suddenly we’ve unlocked kilometers of cycle paths.
I’m not saying we don’t need dedicated bike lanes and active transportation paths through our beautiful forest. I am just saying that if we see those as the only solutions, we are making the problem more difficult and costly than it needs to be.