Apple Swift

These days there are a lot of programming languages to choose from. New languages have appeared regularly over the last couple of decades, many of which are designed to facilitate quick development of web applications. As an ‘old school’ programmer, I have a strong preference for low level languages which are very tightly coupled to the way in which the underlying hardware works. It is for this reason that I love C, as you can write in C and maintain a reasonably good awareness of the number of machine code instructions it is turned into when it is compiled.

Personally, I like this. It means that I, as the programmer, have a huge amount of control over how my code runs. It also means that code written in C runs faster than code written in just about anything else. That said, there are a few downsides to writing in C which are primarily based around the fact that C gives you the raw tools to work with and it’s completely up to you to use them properly. The language itself has virtually no built-in protection against you doing something stupid and crashing your program as a result.

Another issue with working in C is that you end up having to write a lot of code to cater for possible errors and to manage the use of memory during runtime. I’ll repeat; for me this is not an issue, as I rather enjoy that process and I have a number of techniques for handling errors in nested functions such that I can gracefully recover. However, it remains true that this is an overhead and although a well-written C program is a thing of true beauty it is also true that mistakes can creep in which in other languages would be detected for you.

The upshot of all this is that I have resolutely remained with C as my primary programming language, and I do not see this changing, ever. However, I’m quite interested in learning a language that is a lot more modern. My requirements for such a language are as follows:

  • It must be a compiled, not an interpreted language (I like fast code!)
  • It should not force object orientated programming on you (I prefer functional programming to OO programming)
  • It should permit development of modern apps on at least one modern system (my preference is OS X)
  • It should not have a syntax that I find ridiculous (objective-C… shudder)
  • It should be accessible and easy to set up the development environment (I want to code, not mess around with IDEs)

It is for these reasons that I have spent some time recently getting into Swift from Apple. Swift seems likely to incrementally replace Objective-C for OS X and IOS development going forwards. I rather like the syntax, it is well integrated with existing Objective-C libraries and it looks extremely likely that it will be the language of choice for OS X and IOS development going forwards.

Although it was only released in June 2014, it has rocketed up the popularity ladder, and I can see why. Although the support for Swift in XCode is still a little clunky, it’s vey usable and quite fun to work with. I have a couple of projects I want to create for OS X (including a rather cool plugin idea I have for Logic Pro X) and I’m enjoying the learning process.

 

Tags: , ,

Comments are closed.