News for hackers. Stuff that matters.
Re:Ask HN: Why don't smartphones encourage programming like ... by danuker on Saturday April 15, 2023 @07:18AM (#35579561)
I'd argue that a mobile phone is not an adequate platform for coding. The touchscreen and keyboard layouts make it difficult to type needed symbols, distracting from the problem at hand.

Coding requires deep thought, but phones are optimized for moving around rather than sitting in one place and thinking. As such, use cases like maps, calendars, communication and alarms get priority.

The reason people buy a phone is to communicate and get around. And manufacturers cater to those needs.

Re:Ask HN: Why don't smartphones encourage programming like ... by saurik on Saturday April 15, 2023 @07:33AM (#35579657)
As someone who has done a non-trivial amount of coding work directly on my phone, I'll say you just get good at being able to type the symbols you need (though I agree it isn't great; but like, that's what BASIC is for, and I certainly spent a ton of time coding BASIC on my old TI calculators ;P). I also frankly find my phone to be an extremely pleasant device to "sit in one place and think", and given how many games and media consumption apps exist for phones I'm surprised that isn't more obvious ;P. Like, often when I want to seriously think about something, I'll go pick up my phone and lie down in bed, pulling up the notes app--or ssh'ing to a server and using vim--to work on stuff without all of the worldly distractions of having to sit at my desk.
Re:Ask HN: Why don't smartphones encourage programming like ... by still_grokking on Saturday April 15, 2023 @08:14AM (#35579905)
I've seen the youth doing this nowadays.

But just watching it causes severe physical pain in me. Everything is awkward, and painful slow. In the time you would have written a page of code on a desktop in an IDE you hardly manage to write a few lines of working code on a phone. Alone the fact that you can't use keyboard shortcuts efficiently is more than crippling! Not to mention the extremely tiny screen on a phone. On a desktop you have for serous work 2, or better 3 screens (or some big wide one), for a reason.

And regarding deep thinking: The best setting for that is imho not the desktop, nor the bed. Best for thinking is actually walking around, while not being distracted by anything else.

Re:Ask HN: Why don't smartphones encourage programming like ... by wruza on Saturday April 15, 2023 @01:22PM (#35582580)
It’s neither awkward nor slow, it’s just tooling that sucks (we have to type in a bare textarea, which is designed for text). Add some helpers and keys to the keyboard and it’s done. Like an email field makes your on-screen kbd have @ and . characters, you can add {} and [] and autoindent.

Best for thinking is actually walking around, while not being distracted by anything else.

Fwiw my best ideas were born in a bathroom.

Re:Ask HN: Why don't smartphones encourage programming like ... by wiseowise on Saturday April 15, 2023 @02:47PM (#35583401)
> It’s neither awkward nor slow

Compared to mouse and keyboard it is.

Re:Ask HN: Why don't smartphones encourage programming like ... by Thomashuet on Saturday April 15, 2023 @07:37AM (#35579685)
I started programming on a Ti-89 calculator and I loved it and it made me want to continue on this path. Modern smartphones would be much better for programming than my old Ti: better performance, better screen, better programming language.
Re:Ask HN: Why don't smartphones encourage programming like ... by fulafel on Saturday April 15, 2023 @07:40AM (#35579698)
Most mobile games are about manipulating symbols, and there is a significant body of work on visual programming. So this part should not be a blocker.
Re:Ask HN: Why don't smartphones encourage programming like ... by ofalkaed on Saturday April 15, 2023 @07:23AM (#35579591)
>I'd argue that a mobile phone is not an adequate platform for coding. The touchscreen and keyboard layouts make it difficult to type needed symbols, distracting from the problem at hand.

Something akin to hypercard could be made to work very well on a smartphone, or possibly a dataflow environment like PureData but more general purpose. But yeah, 99% of people just want to use their phone and development for phones is much simpler on a proper computer.

Re:Ask HN: Why don't smartphones encourage programming like ... by anonzzzies on Saturday April 15, 2023 @07:27AM (#35579612)
Drag and drop ‘stuff’ is the worst on phones. You need screen space for it. It works on tablets, but on phones it’s mostly awful. I cannot think of an example where it is smooth and usable, especially on the move.
Re:Ask HN: Why don't smartphones encourage programming like ... by ofalkaed on Saturday April 15, 2023 @07:33AM (#35579660)
There is no reason to use drag and drop.
Re:Ask HN: Why don't smartphones encourage programming like ... by anonzzzies on Saturday April 15, 2023 @07:38AM (#35579687)
HyperCard does though?
Re:Ask HN: Why don't smartphones encourage programming like ... by ofalkaed on Saturday April 15, 2023 @07:44AM (#35579715)
To quote myself with emphasis added, "Something akin to hypercard could be made to work." So something like hypercard but not hypercard and reworked to the strengths of a smartphones interface.
Re:Ask HN: Why don't smartphones encourage programming like ... by anonzzzies on Saturday April 15, 2023 @07:47AM (#35579740)
Alright, I agree. Not easy to come up with the akin though.
Re:Ask HN: Why don't smartphones encourage programming like ... by ofalkaed on Saturday April 15, 2023 @07:59AM (#35579801)
Hypercard could be reworked without the drag and drop, double tap or long press pops up a menu, select what you need from the menu. It would work like every other phone app and leverage the other apps which come stock, want to place a picture than double tap to get the menu, click add image and it opens your gallery app and lets you select a picture and do basic editing, click done and the image is placed. And I can think of dozens of ways to extend the hypercard idea based off what a smartphone offers.
Re:Ask HN: Why don't smartphones encourage programming like ... by ihatepython on Saturday April 15, 2023 @07:35AM (#35579673)
> I'd argue that a mobile phone is not an adequate platform for coding.

Neither is a calculator.

Re:Ask HN: Why don't smartphones encourage programming like ... by seba_dos1 on Saturday April 15, 2023 @11:09AM (#35581311)
A teenage me regularly debugging hard programming problems many years ago on a Neo Freerunner with a small resistive touchscreen in a tram while traveling to/from school using nothing but a slightly pointy fingernail would disagree. It's not as convenient as a PC with full keyboard, sure, but it still works fine given the right software.
Re:Ask HN: Why don't smartphones encourage programming like ... by bluedino on Saturday April 15, 2023 @11:27AM (#35581478)
We wrote tons of games on 80's computers with crappy keyboards and 40x25 text on poor quality TV's
Re:Ask HN: Why don't smartphones encourage programming like ... by bawolff on Saturday April 15, 2023 @11:37AM (#35581593)
I feel like the crapiest of keyboards is still better than an on screen keyboard for long text entry.

I tried ssh-ing from my phone once, and it was an absolutely terrible experience.

Re:Ask HN: Why don't smartphones encourage programming like ... by bluescrn on Saturday April 15, 2023 @11:36AM (#35581583)
Even the rubber keys of a ZX Spectrum were better than trying to type on a small touchscreen, though.
Re:Ask HN: Why don't smartphones encourage programming like ... by pavlov on Saturday April 15, 2023 @11:44AM (#35581661)
> “The touchscreen and keyboard layouts make it difficult to type needed symbols”

The key layout on a touchscreen is entirely adaptable though. A language with a custom symbol set designed for small touchscreen entry could perform well.

I’ve long thought that an APL-derived language might be great for phone coding. The custom symbols aren’t a problem on a touchscreen, and the extreme code density means you could fit a lot of meaningful program on a small screen.

Re:Ask HN: Why don't smartphones encourage programming like ... by hugginn on Saturday April 15, 2023 @11:49AM (#35581718)
I would like to challenge you a little. Most programming languages are all designed around an environment where typing is relatively easy and quick. Keyboards allow you to input so much quicker than phone screens.

However, the phone has the pro that you can have any arbitrary keyboard layout. In that case I think that perhaps APL might be pretty well suited. Perhaps we should design languages around the idea that they should be used on phonescreens, where we don't need to restrict the character set to ASCI?

I have an APL program and I like using it basically like a calculator, but I imagine one could write full programs on a phone, if we did some tweaking to the interface.

Re:Ask HN: Why don't smartphones encourage programming like ... by aswanson on Saturday April 15, 2023 @12:38PM (#35582190)
I dunno. Python on the phone might be kinda cool.
Re:Ask HN: Why don't smartphones encourage programming like ... by zamnos on Saturday April 15, 2023 @08:56PM (#35586219)
There are a few Python environments for iOS, and I'm sure Android also has some.

Pythonista is probably one of the better ones. http://omz-software.com/pythonista/

Re:Ask HN: Why don't smartphones encourage programming like ... by zby on Saturday April 15, 2023 @12:48PM (#35582270)
Input is one thing - but also how much of a program can you see on a smartphone screen?
Re:Ask HN: Why don't smartphones encourage programming like ... by HarHarVeryFunny on Saturday April 15, 2023 @12:59PM (#35582366)
Sure, but you shouldn't need to develop on the phone itself. Where's an Arduino-like IDE that I can run on Windows or Linux to develop for iPhone? Should just be able to connect a USB cable and go. Where's the Python support?

Of course smartphones are mainstream so most owners are users not potential developers.. unlike the late 70s/early 80's computer scene which grew out of the hobby electronics scene where the early users were much more technical. My first computer came as a kit - bag of components and a motherboard - had to get out the soldering iron to build it.