I write software for a living (in case it wasn’t obvious). You can read about my job history in other posts and see that I spent 18 years using C++ in the biotech industry before my current app developer job. In those 18 years, I did sometimes write in JavaScript but that was about the most diversity I experienced. I eventually took on a project to port Java to C# for Windows Phone and eventually ended up writing the same app in Swift for iOS while also doing extensive work in Java for that original app I ported. I now switch between three or four languages weekly and at least once a month program in the other one or two languages I mentioned. In addition to the C#, Swift, Java, and JavaScript programming I do for work, I also write in C++ for my Linkage Mechanism Designer and Simulator software.

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.

I should mention that I not only write code for iOS, Android, and Windows; I also write code for a web-based version of the app. The website generates pages with data on the server using Java code running in a Tomcat environment and it uses JavaScript for all of the things that happen at runtime within any single page of the site. The Java for the server does not interact with the operating system and I don’t even know for sure that the system is Linux and not Windows; either of those would work fine. The JavaScript does interact with the OS on the device if you think of the browser as the operating system. The UI work for the website is done by hand. “By hand” means there are no interface design tools used at all and the design is created by manually writing CSS and JavaScript while using Java to generate the HTML for the pages.

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.

If I were a teacher teaching a beginner programming class, I would have a hard time picking a language to teach. Teaching ‘C’ is tough because it’s actually a bit too low-level and students would be learning more about computers than they would be learning about programming. C++ is ‘C’ with objects but still makes the programmer focus on small details that other languages hide. Java doesn’t have a proper “==” comparison for strings and also has that terrible requirement to only have one top-level class per file; it’s a requirement that seems to come from a limited imagination on the part of the language designers. JavaScript doesn’t really allow for command-line programs so the student would need to learn some HTML to use it. C# (C-Sharp, not C-Hash or C-Pound) seems like a good choice although it’s second on my list because I tire of writing semicolons ;)

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.

One final note: Xamarin, QT, and other cross-platform tools are available. There are also tools to let you write apps using HTML, CSS, and JavaScript and then wrap them up in a binary file for distribution on the various app stores. I avoided the former because I wanted the chance to learn new platforms and languages and I avoided the later because they seem difficult to use for features that require access to things like the device GPS and camera. I also see the HTML/JavaScript path as leading to third-party tool hell – I recently was going to help someone with their project built on a set of third-party tools for HTML/JavaScript app creation and I was never able to get al of the tools installed in a way that let me build their code and run it. The process of setting up a machine for a developer to work on the code should not be that hard.