Ask HN: Can programming be learnt completely on smartphone?

24 points by TheRealmccoy ↗ HN
I have enrolled for two EdX courses which involves programming in R and Python.

I am little conversant with Linux environment and have installed GNUDebianRoot app from play store.

Is it possible to complete the courses on only mobile? I am being able to do almost everything right now, which a desktop can perform.

The phone has 2GB RAM and screen size is 5".

74 comments

[ 3.2 ms ] story [ 160 ms ] thread
no good editors
You can run emacs under termux on Android. I use this as a mobile platform with a bluetooth keyboard.
thanks so ever much, I would try Termux, though I would like to stick with VIM which I have currently installed. I want to be comfortable with it first and then may be take on Emacs
I programmed on a TI-89 calculator, so it's possible. But not for passing classes.
TI can't run R or Python, at least the last time I checked... Maybe someone really clever has ported it.
Absolutely. It's not really convenient, but it's possible. One thing I'd look at is if you can connect a USB keyboard, as that would make a much nicer experience.
Ehh... Sure. It CAN be learned, but just because you can doesn't mean you should. Everything about the process will be... Just difficult. Tedious.

Don't do it.

it's an experiment in pedagogy and then in myself, I want to see how far I can go and learn both about pedagogy and programming.

pedagogical approach for mobile has to be completely different than the classroom ones, and that's what I am after.

Probably, yes; the first programmers did not even have keyboards or screens, but rather swapped out the relays manually and checked their voltmeters. But what is the point? You will not be able to complete the exercises as quickly and it will be a pain to download and configure all the software.

You can get a cheap Chromebook for $200, stick Ubuntu on it (https://www.lifewire.com/install-linux-on-chromebook-4125253), and finish both those EdX courses, probably before you can even get R and Python running on your phone. Plus you will be more motivated to finish the courses, having spent $200 and therefore proven your commitment.

If even $200 is too much, I guess you have to ask what you're doing with your life... maybe getting a stable job should take priority.

Umm...$200 is a lot of money in many parts of the world. You never know who you might be responding to.
Smartphones and computers are at pretty comparable prices everywhere I've checked; since he owns an (Android) phone laptops can't be that far out of reach.
I have a 10 year old laptop I found at a thrift store for $15 which is both faster than his phone and infinitely more suitable for programming.
absolutely, it is huge sum of money, almost a year's living expenses for millions of families​ (I riterate the word, family)
this is an experiment in pedagogy and mobile learning. mobile learning is supposed to be huge, but does it work?

also, while I could buy a Chromebook definitely, hundreds of millions of people are not as much previleged as myself, but so many of them would have this burning desire to build something new, to learn programming. can they do it?

Have you considered using a Chromebook? It costs $150 and runs Ubuntu.
this is an experiment in mobile learning and pedagogy. hundreds of millions of people have only a smart-phone as a computer.
You can learn how to program from books. Phone should be no problem either.

But it is going to be much, much harder to learn how to program anything with any decent level of complexity. Writing everything in a single file? Sure. Writing a java app which has 20 classes? Sounds like hell.

And while linux terminal isn't really programming, sending key combos like ^d sounds terrible on a phone keyboard.

Something else that PCs are much better at is context switching. Being able to alt+tab to documentation, or having that documentation on another monitor would be way better than having to switch back and forth. Although that can be remedied somewhat by using a book as a reference.

Something as simple as typing a constant in Java becomes much more difficult on a phone

private static final SOME_RANDOM_VARIABLE = RandomVariableFactory.getRandomVariable();

is not easy to write on most phone keyboards.

I think the biggest area that you'll struggle is that there isn't really any good IDE, or even editor out there.

I watch videos all the time on my phone which help me with programming. Those are easy. It's the actual doing and writing the code that will be a PITA on a phone.

May I ask why you're trying to program on a smartphone rather than picking up something like a cheap netbook?

Cheers!

For past 12 months or so, I have been dwelling into whether learning is possible on mobile or not. Of those 7 I worked free of cost for an Edtech startup, which was providing learning on mobile. My quest is still not solved. In a world which is so much in flux right now, many people run for their lives, with nothing else but their wallet and mobile,when something disastrous is happening around them. They have nothing else, probably but a mobile to rebuild their lives. This is an experiment in that regard.
>sending key combos like ^d sounds terrible on a phone keyboard.

Terminal apps like termux supplement the phone keyboard with a pane atop it with tab,ctrl,pipe buttons. Should be usable.

>there isn't really any good IDE, or even editor out there.

Vim and others are available as packages in gnuroot, etc. A shell and editor split with tmux should work.

Still very uncomfortable programming on a phone ofcourse.

This is about learning how to program solely on an android phone.

the assignment i believe would not require typing very long and complex programs and may be if they do, i would try to do it in batches.

Once a person has learnt programming on a smartphone, she could graduate to work on an actual laptop or desktop.

But this is an experiment or a research project kind of thing, and it is too early to count the chickens.

You can probably read all the content of the courses on your phone and even run a basic Python/R interpreter on it, but no. Phone keyboards suck for programming and there are a ton of programs you can't run on a phone (like RStudio or Python IDEs).

Just get a cheap desktop and keyboard on Craigslist. I've found ones for as little as 20USD. Or you might be able to use a Raspberry Pi, if you're into that.

yes IDEs are not possible. I found one for Python called QPython but not sure how it is. After using some of the desktop IDEs, not sure whether to call it by same name.
Since you're using python and R I'm gonna throw Jupyter (used to be called ipython) into the mix (I'm using it half the time on desktop anyway because notebooks format everything so beautifully). You might also want to install Hacker's Keyboard from the play store so you have access to shift/enter/ctrl, and while I havent personally used it on a phone it should work fine. Here is a random tutorial link http://bretahajek.com/2016/12/jupyter-notebook-opencv-androi...

And using termux+vim is definitely an IDE, but has a pretty damn steep learning curve.

Not practically.

If you hooked up a keyboard, used emacs or vim as an editor, you would likely be able to program enough to pass a intro to programming course (with significantly more difficulty than anyone on a computer). In theory you could do a fair bit of development work on your phone, but in practice it would be far too much friction to develop any real (i.e. more complex than intro to programming assignments) software.

the objective is same, is someone learn enough on a mobile to either get an entry level job or may be showcase his skill to someone who could get that person a laptop.

hundreds of millions of people have only a smart-phone as a computer.

Did you mean GNURootDebian? Don't know about R but I have learned a lot of C using the Termux app, I know python is supported. With Termux you are limited to a terminal, but personally I have never been able to see emulated Linux desktop on a phone correctly... Of course if your course includes gui programming you need full desktop. I would recommend getting an external keyboard for programming, or at least the hackers keyboard app.
Yes it is GNURootDebian.

I would definitely try out Termux, thanks so ever much!

I've written small snippets of code from my phone before, but it's usually either testing specific language syntax, or making minor tweaks to existing code in situations where I'm either learning a new language, or dealing with weird edge cases.

For full-blown development, it's not really suitable. Your phone is best used for reading technical material and watching video content.

Even if you can program on mobile, it's going to be painful. Perhaps less so with an external keyboard and SSH into a cheapo VPS instance, but you're still going to take a substantial productivity hit.

May I ask why you're going this route?

this is an experiment to see how conducive mobile is for learning.also hundred if millions of people around the world have a Smartphone as their only computer. is it possible for them to learn programming and make themselves better due to it?
That's a relief. I was really hoping the reason wasn't cost due to some unfortunate circumstance. :)

For what it's worth, there's quite a few apps that teach programming or serve as reference. Some of them can run live code inline.

I am currently into voluntary poverty but that does not mean I could get a cheap laptop. I am currently far from my home, where I have a Ubuntu desktop as well as laptop.
Yes. My younger brother did learn programming in a phone. He started in Nokia 2700 Classic, which is not even a smartphone. Then he took a Samsung which runs Android. He certainly didn't become an expert using those devices. But he learnt the basics of Python.

One thing to note probably is, he started very young. And in young ages people can learn very easily. I don't think I can learn programming in a smartphone in my current age. But for kids, whole different game.

I learned on a TI-83. Compared to that a phone doesn't seem so bad.
that's what this experiment is all about, kids are so much in Smartphone these days, can they actually learn something worthwhile with it?
Go for it! Adding a USB keyboard would be immensely helpful.

Seeing that you have access to the internet I would second @rl3's suggestion about trying a (free or cheap) VPS service and SSHing to the machine, especially for snapshots, networking and better performance.

yes, that's the next step. thanks so ever much!
Never tried it myself but you could possibly write on the phone and find free cloud service (like openshift.com) to test and debug.
thanks so ever much, I would try openshift.com
It is probably possible if you are persistent. There are some online dev environments like js fiddle.

Also, if you can afford a vm in the cloud you could probably get an ssh client for your phone to log into it.

If you hook a Bluetooth keyboard to the phone you might just be able to really pull it off.

Edit; good luck :)

I think it could work, but learning a programing language completely on smartphone is suck in a way in the past, the now the situation changed, you know the latest Android version -- Android O, which allow user to split App cards, and we can also use bluetooth keyboard to code(I did it when I was learning my first language before owning my first PC a year ago).
You can buy a low price physical keyboard for your phone to make it easy to type
The question should be "how effective is it" not whether you can or not. Sure you can read a lot of programming resources using your phone and perhaps even write and run some programs, but it would not be as effective as practicing it on computer.
yes to most extent it won't be. this is an experiment in pedagogy also, where I would like to see, if someone is really driven and resources are under constraints, can he do it?

Can passion overcome constraints?

(comment deleted)
Can you play tennis with chopsticks? Sure but it will be terrible.

Your phone is a terrible way to program...you will type 20x slower and see 10x less than a real screen. And you won't be able to quickly switch tabs, search Google, etc.

Just get a cheap laptop.

> And you won't be able to quickly switch tabs, search Google, etc

Also won't be able to debug responsive web apps, setup break points in chrome or firefox debugger etc etc. Will be quite a nightmare doing this on a smart phone, even if you have a bluetooth keyboard to speed up the typing...

One can however quickly switch between a browser and terminal/chroot app though. So googling can be done.
If you are looking to learn python on the smartphone SoloLearn has a great free app that can give you enough to get started. It also has sample programs you can run in a simulated python programming environment so you can get your hands dirty. I highly recommend it.

I just checked out the edx website now (never heard of it till now) but some of their courses look interesting, might check them out.

I doubt either SoloLearn or edx can make you a python or r master, but if you want to program in python, going over them + a few other tutorials and writing some test programs doesn't seem like a bad way to get started.

I saw Solo Learn but did not check out, I am not sure of the level of complexity it would present in real.

EdX courses are in truth, God send, hundreds of millions of people around the world have only mobile as a computer, if they can access EdX courses and simultaneously, in some way do those programming exercises on mobile itself, they would be so much better off.

AIDE for Android allows you to write and run Android apps on your Android device. It is on Google Play. You can write and run an app for free, although certain functions need an in-app purchase. It is decent enough, and highly rated, as it's one of the best ones there. The nice thing is you can write and run apps on the device itself. Of course, if someone wants to seriously program Android, they would get a computer, Android Studio and such.
Absolutely, 8" phone with bluetooth keyboard is decent machine. It runs full linux shell and python...