Investing in your Python Setup (yes - this is for Apple Devs!)
Encouragement for all Apple Devs to invest in GitHub Copilot to work more easily with data for AI-based applications.
One of the key parts of integrating AI into your app is making sure you have good, clean data that can easily be manipulated as needed for your task. While I personally love working in Swift, Python is the most used language for working with data (usually in academia) and machine learning. It is optimized for this task.
Take for example the use-case of CreateML. I was shocked to learn in @azamsharp’s try! Swift World workshop yesterday that in order to use Apple’s CreateML application to train a model with a CSV for sentiment analysis - with one column as the sentiment (positive, negative, neutral) and one column as the text - you have to literary create 3 folders, one for each sentiment, and have every single text line of the CSV extracted into its own unique .txt file and put in the right folder.
While this is possible to do in Swift (and @azamsharp provided the code for this), it is much easier to do in Python. Note that @azamsharp also showed us a much easier method of how to do this in a Playground without this process, but the point is that this type of file / data processing is a very common requirement when working with AI APIs.
The other good news is that AI Assistants such as ChatGPT are optimized for writing Python code while Swift code is not great and often has many mistakes. This means that only knowing a little bit of Python is required to effectively process your data. What I thought was almost impossible to do a few months ago because of my lack of knowledge in Python has suddenly become a very simple task with ChatGPT.
This is why I want to encourage Apple Developers like myself to get out of your comfort zone a little bit and start working with Python. I started out by just asking ChatGPT to write the Python scripts for me, which I pasted into Atom, Github’s IDE that I like for its simplicity. But when I talked to @emadgnia, he encouraged me to take the plunge and try GitHub Copilot.
I admit that while I heard great things about GitHub Copilot, since I work mostly in Xcode and have ChatGPT write my Python scripts, I didn’t look much into it. After all, it’s hard to get out of your comfort zone! But I decided that I do now use enough Python to make the switch.
I imagined that Github Copilot had an in-browser version I could try or at least was its own IDE. So I was surprised when I signed up for the free trial that it’s a plugin for existing IDEs. This is where, as an iOS Developer, I got a bit frustrated! Atom - GitHub’s own IDE and the one that I do use - was not supported. The page of IDEs looked completely overwhelming - which new one to choose?!
Out of all the options, I have previously worked with JetBrains IDEs for Ruby on Rails, so I chose that tab only to find more options…
Since I’m now working with Python, I chose PyCharm… This led me to a page where I ended up paying a monthly subscription just to test it out. Unfortunately, JetBrains does not yet support the GitHub Copilot AI chatbot:
This means that while it’s nice that the GitHub Copilot can autocomplete some functions for me, I would still need to use ChatGPT to generate fresh functions that I need for processing my very custom XML-based data set.
I had several people Tweet at me saying that VSCode is the way to go. GitHub is now part of Microsoft and VSCcode is a Microsoft product. I was expecting it to look horrible just from its name, but I was surprised by the screenshots that it was modern-looking. I was even able to install the OneDark theme that I love in Atom to make it look even nicer.
And the good news - VSCode supports the GitHub Copilot chat assistant right in the IDE! Just click the chat-box icon on the left at any time and type in your question! The Chat has complete access to the document you’re working on, so you don’t have to paste your code like you do in ChatGPT every time. It gives you very personalized code suggestions right there in your IDE!
This is now the game-changer I’ve been looking for. Not having to go back and forth with ChatGPT and my IDE! I wish I had done this upgrade sooner, so I wanted to share this on here and hopefully encourage you to do the same!
I will still be using Xcode and Swift for my app development, but I’m happy to have integrated the power of Python + GitHub Copilot into my daily code now that I want to learn and work with AI.
I have always been an early adopter, but this is a little confusing and Microsoft biased. Jetbrains does have its own AI service which they started offering in December, it is a subscription just like GitHub and you do have a choice if you use PyCharm on macOS and so far so good with JetBrains AI. The AI service is Google based. They just started offering CoPilot 2 days ago and a bake-off would make sense after the dust settles. I use Jetbrains on macOS for Python, Kotlin and Android Studio programming, with the bot moving from Bard to Gemini on Android, things are changing fast. I also have a Win11 machine and use VSC there and some projects with macOS. May the AI service wars begin.