The truth is that switching languages is hard. It’s not very hard but I find myself relying a lot on Google. I seldom remember how to handle substrings in Swift and I sometimes forget, but not often, that the double-equals comparison operator does not work for strings in Java (because Java is a terrible language). The interesting things is that all programming languages support the same features in different ways and writing the code to get things done is fairly easy – I don’t forget how to design software, just the minor details. It’s good to learn to program in a single language, preferably not one that doesn’t use “==” to compare string data, but it’s also good to think of designing software as something that is more than simply “speaking” a language.
If switching languages is just a nuisance then what is difficult about writing software for me? Well, it’s the API to the OS to design the UI that is the trouble. Every time I need to add an interesting feature to our app (the one I work on for my employer), I need to learn some new API features and I need to learn on multiple platforms. Our business app does not play sounds for any reason and the last time I wrote code to play a sound was an experiment in our Windows app about four years ago. Adding a beep to the barcode scanner screen of the apps meant researching how to add a sound file to the project in both Android and iOS and then finding the code to play a short sound on both platforms. Each is different so nothing I learn for one can be used for the other. Neither of these is the same as the Windows API so nothing I did for the Windows app is useful. This same experience with the audio playback features of the OS plays out the same for other features on an almost daily basis for me. And once a feature is done, I never ever need to remember how it works because I now have that code that I can just copy if I need to play sounds for some other reason.
Fortunately, the UI design tools are finally starting to be easy to use. Although Xcode has some really weird features, it seems to be the easiest to use for creating the user interface for the apps. Android Studio does a reasonable job of showing me the results of my design choices but I still find myself writing the XML by hand most of the time. And Visual Studio also let’s me write XAML (XML-ish) data by hand with a reasonable preview of the results. All of the tools have some serious flaws but they are all totally usable after years of practice.
My point in all of this writing that the languages are the first thing to become easy – they all have essentially the same features like “if”, “for”, etc. and functions, variables, etc. – and designing code doesn’t much depend on the language. The next thing to become easy is the UI design tools because changing from one ti the other is like switching from writing a document in MS Word to using MS Excel to create a a spreadsheet. The design tools are all different enough that remembering how they work is actually easier than remembering other things. The harder parts are remembering the library function that are available for the languages. Like I mentioned earlier, I can’t always remember how to get a substring in each language because they are all fairly similar and keeping them separate in my mind is difficult because of that similarity. I don’t use many math functions but I do use a few string functions like “split”, “substring”, “find-substring”, etc., and they are always hard to remember in detail. Finally, the most difficult part of all this platform switching is learning the new stuff like how to play an audio clip, how to scan a barcode, etc.
So C# is the top choice. Students do not have to worry about how strings are stored in memory and they certainly don’t need to worry about freeing memory that they no longer need… usually. C# is available on Windows computers which can be very cheap, and the basic tools are free from Microsoft. C# is used for Unity so students can see how learning C# might lead to a job that seems interesting.
I was writing about what I like about Swift and that I’m going to be writing some code in C# later today but those things seem unimportant for this post. Even going on about what language would be good to teach was a bit of a tangent to the topic at hand. In the end, all I can say is that the difficulties in switching languages and platforms every day might not be what you expect. But it’s rewarding to be able to do it and it seems like it’s a skill that not many will have.