Describing why you're stuck on an iPad might help improve the suggestions. Do you have a keyboard already or other input hardware? Are you trying to learn just on a bare iPad?
If you're not for some reason stuck on an iPad, it really isn't a snarky answer to just say don't. It might be marginally better than a phone, which is itself somewhat better than trying to learn programming on a game console, but you are way down on the bottom of the list of best tools, and unless you really have no access to any "real computer" and can't possibly afford to acquire even a $100 used laptop or scrounge up a random computer from somebody, which will blow away the iPad on the programming front no matter what OS you put or leave on it, you're really swimming uphill putting barriers in front of yourself in a context that really benefits from a reduction of as many barriers as possible. Programming's hard enough as it is without trying to fight the hardware.
2. repl.it supports C and C++ through a browser. They have a free plan.
3. Set up a small VPS at DigitalOcean, AWS, Google Cloud, etc. and ssh into that. You get the most control that way. A VPS costing less than $10/mo will work.
I work exclusively on an iPad as a full-time programmer and system admin, but mostly I do that over ssh to remote servers owned by my customers.
A no cost solution would be to setup a Linux server in your home instead of option 3. Then you can use ssh to connect to it and try that out, maybe figure out a secure VPN where you can SSH in remotely if traveling or working from a coffee shop, etc. are in the list of requirements.
My understanding is Surface Linux is mostly the project built around developing kernel patches to be upstreamed, so the specific Kernel is more focused around external patches. Here’s their comment on this from their GitHub [0]:
We aim to send all the changes we make here upstream, but this may take time. This kernel allows us to ship new features faster, as we do not have to adhere to the upstream release schedule (and, for better or worse, code standards). We also rely on it to test and prototype patches before sending them upstream, which is crucial because we maintainers cannot test on all Surface devices (which also means we may break things along the way).
So should you install this custom kernel and the associated packages? It depends: We generally recommend you try your standard distribution kernel first. If that works well for you, great! But if you're missing any features or experiencing issues, take a look at our feature matrix and give our kernel and packages a try. If your device is not listed as supported yet, feel free to open an issue.
Everything is a no-cost solution if you ignore the costs. Which in this case would be the cost of a pc, the time to set it up and electricity to run it.
If you don't have access to any computer running windows, linux, or macos then I recommend buying an old Dell or Lenovo laptop on ebay for <$100 and putting a lightweight linux on it.
It doesn't take much computing power to run a c compiler and a text editor, you can probably find something suitable for less than $50 on your local Craigslist.
For someone with no experience installing and supporting linux I would recommend an 8gb Raspberry Pi 5 instead. Mainly because they are all the same and if the beginner has problems there is a wealth of information about that specific device in beginner formats.
Agreed. This might sound like a lot of work for the uninitiated, but installing Linux on a cheap used Thinkpad is super easy these days.
Trying to do dev on Apple devices, let alone an iPad is a much harder path. Get a cheap Linux laptop and you will be able to focus more on learning programming without the friction of fighting a device designed for consumption.
[edit]
Oops I said a dirty Ap*** word, but I'll wear my -1 point with pride :)
> less distractions and configuration related busywork.
The opposite IME, a lot of the userland on MacOS is very old mixture of BSD from back when Mach/NextStep inherited FreeBSD userland, and old bits of GNU that got stuck during the GPLv3 transition, some of it is new, it's a bit of a Frankenstein... configuring it is a pain because Apple tend to steamroller over everything on every OS update. Installing Xcode is supposed to be the native way to get GCC etc but -very long chain of expletives- (see internet), and there's no built in package manager so people end up reaching for homebrew, with mixed success that often ends up broken or undone because (see OS updates). Generally compared to Linux there are always more steps required on Mac, and there is set of strategies and random scripts floating around on the internet that are constantly evolving in response to every turn Apple makes. When someone is new and trying to learn C this is all a huge source of confusion and distraction, they probably want to try follow instructions from a variety of sources of learning material many that will assume a modern GNU userland and ability to easily acquire libraries via apt/yum/pac install etc... Mac is very much a harder path.
Source: I have to support people doing development on Linux/Windows/MacOS, Windows is easy now since WSL, MacOS users are always hitting roadblocks created by Apple, or due to CLI tools missing expected features, or CLI tools with obscure bugs from literally 15 years ago, it's a constant fight (yes this post is my way of venting if you hadn't figured that out yet).
I suppose it does depend ob what you mean by "programming" and how far that slips into "development" and what type of development, and what type of learning material you are using, if it's really unassuming, then I'm sure learning C on a mac will be perfectly fine. I've written simple C programs back in the OS X 10.6 days, it was fine, I was keeping it super abstract or Apple specific. But these days the wider you reach the more you are going to hit content that is just going to be very awkward to follow on MacOS for a beginner. On the flip side if the learner is happy to lean into the Apple specific development world then I guess it makes no difference, although I wouldn't recommend it, especially not for C.
Yes. I probably drifted too much from C (which this thread is about) in my head and was just thinking about "general" software development (whatever that means.. : D)
I agree if you want to write software targeting GNU/Linux or embedded systems (which are more or less the only remaining cases when you'd want to use C) trying to do that on Windows or macOS probably won't be a great experience (and nobody targeting either would have any reason to use it unless they are into retro-computing or something like that).
If you only want to "learn" it for purely educational reasons, just to get a better understanding of some lower level concepts/problems (i.e. the only reason why someone would/should ever want to use an iPad) it doesn't matter that much.
This is false, you can use an Apple MacBook or iMac just fine for development. macOS is a full blown UNIX OS, 100% POSIX compatible, and you can do anything on it.
Programming on an iPad is like playing football in a tuxedo: possible in principle but you're really gonna want to use the equipment made to suit the activity.
Get a laptop, put Linux on it. (Or use a Mac, I don't care.) In terms of ergonomics and available tooling, it's much better suited to C development than an iPad is. Most of the iPad solutions will involve shelling out to another computer anyway.
I have used it for learning C, Rust and Go. It even has a VSCode editor in the browser. It’s pretty easy to setup. Create a repo, add a hello_world.c, push the code, then in the UI press the green Code button on the repo homepage, select “Create Code Space on main” and then use gcc from the terminal to compile the code.
I’ve been using GitHub Codespaces for a remote environment with the Blink Shell app to run VS Code.
(Codespaces can also run vscode directly in safari, but I find I run into fewer weird UI issues in Blink)
Personally, the lightness/portability of this setup has made it worth dealing with occasional issue related to coding on the iPad. Biggest issue I’ve run into is using Codespaces with really bad internet is pretty much a no go — can’t code on airplanes.
This is an accuracy vs precision question - an iPad is not an appropriate tool for the job even if there are hacks to get around its limitations. You should consider buying a different device for this purpose. You can learn C on a Raspberry Pi if budgets are tight but if you have an iPad then your budget probably isn't that tight.
Like "The Best Camera is the One You Have With You", iPad could be the industry defacto dev environment, when away from a laptop/desktop. It could rival iPhone in ubiquity, because there's little competition in tablets. Pixel Tablet is a distant runner up in specs, but offers OS/app flexibility.
iPad Pro M4 already runs VMs (Secure eXclave), but Apple leadership refuses to give customers access to an iOS CLI shell running in an isolated VM. Until Apple stops ignoring the requests of their multi-device customers, it's best to invest in other platforms, using the iPad as a dumb client.
* Pay for a cloud instance and use an SSH tool to connect to it.
The downside to these two options (depending on your needs) is that you are pretty much just targeting Linux and building CLI apps. But that may be totally fine for you.
Personally, I pay $60/year for SplashTop (https://www.splashtop.com), setup a SplashTop server on my home computer, and then use the iOS client to connect to the my home computer and continue programming. And I get the benefit of being able to do other things as well (like playing Steam games) if I want.
Edit: similar to SplashTop, you could also - if interested in Windows - pay for a Shadow PC (https://shadow.tech) and connect to that.
As far as apps, I am not too sure what’s available, I know you can do swift playgrounds and that might have a C binding.
(I checked there doesn’t seem to be a straightforward way to do C in swift playgrounds. Bonus content: https://github.com/uraimo/Awesome-Swift-Playgrounds )
As a matter of point, iPads aren’t really set up tool wise for programming. You can force something into this niche, but you probably want a computer for coding, because a significant portion of programming is massaging the system into doing what you need.
Apple actively discourages most attempts to make the iPad more programmer friendly so while the hardware is perfectly capable, the software that runs on it is not meant for developers.
If you are Ok with a Terminal only workflow and you only care about C programming as in learning just the language, you should be able to do it.
Install iSH from the App Store. With iSH installed you can use the apk package manager to install VIM and GCC. You should be able for example to follow a basic book intro to C. iSH, while based on 32 bits Alpine Linux, it is not a complete operating system, so if you care about low level Linux programming you will be better off with a second hand laptop with Debian or Ubuntu on it.
Even a Chromebook with Linux enabled will run circles around your iPad from a programming point of view.
Pyto is an IDE for iPhone and iPad with a Python 3.10 Interpreter and all of the standard libraries plus more than 100 third party packages, as well as a C & C++ compiler and bitcode interpreter. Includes a terminal with standard UNIX commands, a code editor with code completion, support for Shortcuts, Picture in Picture, a graphical interface builder and a debugger.
Both Pythonista and Pyro allow learning Python, though Pythonista runs behind on Python versions, and doesn't claim to have C and C++ compilers that can make CLI tools.
I do some light hacking in iDOS for fun as well. Might as well go straight to Borland C++ 3.1 [0] (the "professional" version) over Turbo C++ these days.
When you eventually hit the Great Wall of 16-bit real mode, I recommend switching to OpenWatcom [1], aka "the compiler that built Doom," which comes with something closer (relatively speaking) to a modern toolchain. DJGPP [2] has been recommended as well, although I found it more trouble to set up.
Terrible suggestion in 2024 for a beginner as I assume the OP is. (If you are into retro development and you are already an experience programmer, it will be just fine.)
Cool, I would still not advice a beginner to start with it. But it is nice to know that the compiler supports at least the ANSI C standard. I may use it in my next retro programming project.
As others have noted, the least painful way to accomplish this is to use the iPad as a terminal that accesses some external server.
If you want to work offline, I've heard of folks carrying around a small "sidecar" computer the iPad connects to via USB or bluetooth. Rui Carmo has a [description of his setup here](https://taoofmac.com/space/blog/2023/09/09/1820).
I agree with the general sentiment of “don’t”, but there are options for someone needing to travel light or whatever.
For example, GitHub Codespaces is just a web site and gives you access to a virtual machine with Visual Studio Code. It’s nearly the desktop experience but ought to work fine on an iPad… if you’re well connected with WiFi or 5G!
reading through the comments, i remember how my first 'server' was a hacked Xbox made to run linux
as a kid, it was easier to buy a used Xbox with cash (as-is and heavily worn) and pick up a couple Linux administration books from the bargain bin (with script examples that still worked!), than find a hosting provider that was willing to take me on as a customer without an ID or permanent residence
is it possible to learn programming from scratch in 2024 without a credit card?
> is it possible to learn programming from scratch in 2024 without a credit card?
Back when I started, few years before Xbox, I paid a friends dad to build me a PC. It was a few hundred bucks back then and he took cash but it was a significant sum for me even as a working teen. But even that was cheaper than it had been in the early nineties and prior. If I was a cash strapped kid again in the current world I think it would be pretty easy to come up with enough to buy a raspberry pi and load Linux just as you did. If not, you could get a base level laptop for $300 or less at a retail store. You could probably use the TV you already have as a display and likely same for any SD cards for storage space. They probably already have a device they could run a virtual machine on and get started that way (No investment needed.)
In any case, probably easier and cheaper than ever to do this as a kid. Question is, is this really the part a kid would find interesting these days? I like programming building things and even lead to me owning a web hosting company in 2000-2003ish. Since then, I still like to program and build things but do not give much care to management of servers, I’ll gladly pay someone else for that.
> is this really the part a kid would find interesting these days?
i built the xbox server because i wanted to share my mp3 library with all my friends, and play it on school computers, like spotify's web player, but i didnt track who logged in and what was played how many times (used PHP to build listings, and Flash to actually play the files on the client)
putting up a server using my available budget was an important step :)
it was only up for a few weeks before it became infected and i had to take it down though... but while showing it to someone more savvy (and connected), they gave me an account on their shared server and i started more projects there
But that's just programming. More than half of what new folks mean these days by "programming" includes hosting and distributing an app, and you're gonna have a lot more difficulty finding outbound bandwidth (let alone hosting) without credit and identity.
Go to a store that sells electronics hobby stuff and snag a Raspberry Pi with paper route money.
Thrift stores are sometimes good places to score old computer shit. One time I scavenged a PC from behind a dumpster. Linux can be downloaded and put on a USB flash drive.
Agreed. The only two languages I've found that have decent (not great) on-device tooling for iPad are Swift (via Playgrounds) and Python (via Carnets). Nothing else is decent for programming on the iPad (editing and executing). For everything else, you may be editing on the iPad but the programs will be running on other computers. Replit or a terminal app (Blink) to a remote server or something similar.
If you're not for some reason stuck on an iPad, it really isn't a snarky answer to just say don't. It might be marginally better than a phone, which is itself somewhat better than trying to learn programming on a game console, but you are way down on the bottom of the list of best tools, and unless you really have no access to any "real computer" and can't possibly afford to acquire even a $100 used laptop or scrounge up a random computer from somebody, which will blow away the iPad on the programming front no matter what OS you put or leave on it, you're really swimming uphill putting barriers in front of yourself in a context that really benefits from a reduction of as many barriers as possible. Programming's hard enough as it is without trying to fight the hardware.