Posts

Symmetry

Image
After using the milk, you:

a) return the carton to where you found it in the fridge
b) return the carton to any free space in the fridge
c) leave the carton on the kitchen table

It doesn't matter that you know how to reverse a linked list; any answer other than "a" suggests you aren't a very good programmer.

Details matter, and symmetry helps you manage them.  Return the milk to where you found it. Close files you have opened.  Free memory you have allocated.

During a talk about Java, memory management, and garbage collection, one speaker (I can't recall his name) explained why Java wouldn't be suitable for embedded systems.  Feigning a heart attack, he clutched his chest and collapsed onto the podium.  Moments later, he raised his hand, saying "I'm okay, I'm okay.  It's just my pacemaker doing garbage collection."

C has no such limitation, and simply stated, for every malloc(), there should be a free(). There are situations though, tha…

Remembering Cornell's Ninth President, Frank Rhodes

I graduated Cornell in 1982, but it was Frank H.T. Rhodes' words from his 1987 commencement speech that I remember most:
"I hope that zest for living, and for giving yourself to others, will accompany you on the continuing journey. For if you mortgage all your todays for some vague and gossamer tomorrow, you may find, in the end, that life's greatest joys and satisfactions have eluded you. As you continue life's journey, I encourage you to ride more merry-go-rounds and eat more ice cream. That does not mean a life of hedonism, but it does mean a life lived in the present, which is the only time we have." I was a serious student, and now feel I should have explored more of my surroundings and availed myself more to the resources at Cornell.  Frank Rhodes created programs and opportunities for his students, and I benefitted unknowingly.   I've written about Cornell here, and how I worked with Penny Rhodes one summer at Uris Library, albeit unknowingly.  Hmm, th…

What Would Artificial Intelligence Do?

Image
AI would stop the car in the straightest, shortest, possible line.  That would be my answer to the trolley problem which asks an autonomous vehicle to chose between hitting a pedestrian or avoiding a pedestrian by veering off a cliff and taking you, the occupant, with it.

In the same vein as "Who would win in a fight, Hulk or Superman?" the trolley problem is entertaining but doesn't produce practical answers. As Jason Hong laments in the link above,  "... the problems are framed such that the autonomous vehicle is the only entity with any agency. Or to put it more simply, pedestrians are completely passive and won't try to dodge oncoming vehicles."

Anyone who has done the "hallway dance" would readily agree with Mr. Hong.  Indeed, my wife recounted an accident in her youth when she hit a goat with her car, doing precisely this dance.

We should, instead, focus on long-range embedded road sensors to detect wayward pedestrians, and braking systems …

2020 And The Year of the Rat

Image
Just 3 weeks ago, we welcomed the 2020 New Year.  For some of us, our resolve regarding New Year resolutions might be wavering, but on Saturday January 25th, we get another chance.  Let's welcome Chinese New Year and the Year of the Rat.

This could mean Mickey Mouse and Disney will have a good year.  But let's not forget Jerry Mouse of "Tom and Jerry," Speedy Gonzales, Pinky and The Brain, Ratatouille, and Mighty Mouse (yeah, that includes Apple's mouse).  They all could be in for a fantastic year.

Because this is 2020, I'd like to think those born the year of the rat will have perfect vision and enjoy exceptional clarity this year, not just in tech, but in all aspects of life. Xin Nian Kuai Le!

Apple's Busy End of Year

Image
When IBM produced their desktop operating system -- OS/2 -- it was with a mainframe mindset.  That hurt more than it helped, and OS/2 failed against Microsoft, a company with a desktop mindset.

Ironically, when Microsoft produced their handheld operating system -- Win CE -- the desktop mindset caused them to fail against Palm, a company with a handheld mindset.

The lessons are obvious.  Don't cram a mainframe into a desktop.  Don't cram a desktop into a handheld.  Prowess in one domain can be baggage in another.

For a deep retrospective on the failure of OS/2, see Ars Technica: Half an operating system: The triumph and tragedy of OS/2.  For a shorter take, click on the "We asked for it" image to read my essay which appeared in Computer Language November 1990. And for a riveting read on Palm's battle with Microsoft and the struggle to IPO, visit the Internet Archive for  Piloting Palm, by David Pogue and Andrea Butter.

This year end, we saw Apple with an uncharac…

Programmer Humor for the Holidays

Image
Maybe we programmers take ourselves too seriously.  How else do you explain the infamous Google Manifesto written by James Damore linking programming ability to gender?  Or  Levandowski being charged with stealing Waymo's intellectual property and fleeing to Uber?  Or the growth of the tech-bro culture?

If only a sense of humor could be tested as part of the interview process!  I've found humorists and comedians to be remarkably intelligent, as a good sense of humor requires imagination, a strong grasp of wordplay, and the ability to read a room.

To help with the upcoming holiday gatherings, I've collected a handful of programmer jokes.  Use at your own risk.

Q: How do you get rich with C++?
A: Inheritance!

Q: Why is C a rude language?
A: Because it has no class.

Q: Why do Java programmers wear glasses?
A: Because they can't "see sharp."  (C#, developed by Microsoft, gets grudging respect as Java done right)

The one-liner below is credited to Eric S. Raymon…

Post Processing: Watch Your Language, Jaron Lanier Fixes The Internet

Image
Watch the rise and fall of your favorite programming languages, set to music: Popular Programming Languages 1965-2019.   The lead changed multiple times and the YouTube video ended with the top 3 languages being Python, Java, and Javascript.  Okay, C# came in 3rd if you don't consider Javascript a real programming language.

This was the work of a first year PhD student who mined data from GitHub repositories and historic national surveys.  It's not far from the TIOBE index I wrote about in a previous Post Processing which ranked the top 3 languages as Java, C, and Python.

There is yet another language survey done by Stack Overflow.  It polled its membership, and nearly 90,000 developers responded.  While 90,000 is a healthy sample size, keep in mind those polled still represent a closed environment.

Top 3 loved languages: Rust, Python, TypeScript.
Top 3 dreaded languages: VBA, Objective-C, Assembly
Top 3 languages programmers want to learn: Python, Javascript, Go

These result…