Coding on a plane… on an iPad

The project

In my ongoing efforts to up my development game, I’m currently working on learning how to create an app that has user authentication. Adding authentication to the web app is completely new to me and as always I’m time constrained. So when I found myself in a plane on the runway for over an hour thanks to a mechanical issue I thought why not try and get some study done on my iPad.

I had previously downloaded all my courses content on the Udemy iPad app. This was some luck on my part as streaming video content over a 4G data connection would quickly blow through my data cap which wouldn’t be ideal. I also had a bunch of dev apps I’d downloaded ages ago but hardly ever used.

The setup

I wasn’t sure how much I would really be able to do given I had a set of tools that I guess you’d call “non-traditional” from a web development perspective. Here’s what I used:

  • iPad Pro 10.5 – This continues to be a great machine for me. The screen size gives me a lot of flexibility without the bulk of the 12.7. It does have its limitations of course but increasingly iPad is filling more and more of my needs
  • iPhone 6s – My iPad doesn’t have LTE so I used my phone as a hotspot to connect to the internet
  • Textastic – While of course I wish had a text editor with all of the power of a desktop app, Textastic is the best I’ve found so far on iOS. The code highlighting is nice, it comes with a range of themes and custom fonts and works seamlessly with my iOS GitHub client of choice, Working Copy
  • Working Copy – This is one of those apps that constantly amazes me. It feels like this is an application that just shouldn’t be able to work on iOS but somehow it does. I had absolutely no issues connecting to my GitHub repos, downloading the latest build of the project I was working on, making changes in Textastic, then pushing those changes back to GitHub. Perfect!
  • Udemy – The work I was doing was part of the Udemy course I’ve been working through and thankfully the app supports downloading the course content to the device.

What works well

The fact this was possible at all feels sort of amazing. For the most part, the applications I used (listed above) did a great job at the basics and in some cases were far more. I think the thing that really stood out to me most was how the single view full-screen apps made me less likely to switch between apps and, as a result, help me focus on what I was doing more. That focus altered my workflow quite a bit. I’m not sure it was better or worse, but it was certainly different. Thinking about it I think I was far more likely to stay in my text editor and write code from my own mind rather than relying on the content of another window.

I also think the lack of some of the power features of a desktop text editor meant I was paying more attention to everything I typed. Not having the code editor automatically format my text for example really made me pay attention to how I was laying out my code because I knew it wouldn’t be reformatted on save. It will be interesting to see the differences between my handwritten code and what my normal beautified code looks like.

What could be better

Screen real-estate – Whenever you’re doing web development you need a few windows open at a time. You really can’t have too much screen real estate in this sort of work so a 10.5-inch screen is always going to be tight. Having said that it wasn’t horrible either.

Testing – The iPad doesn’t have a terminal nor can it run a node or mongo server so I wasn’t able to test my code. While it’s not a big deal given I was just following a tutorial I wouldn’t want to spend to much time working on something without being able to see the results of my efforts. That would run the risk of building issues on top of issues and it might lead to a lot of wasted effort. I could have used Panics excellent Prompt but the app I’m working on isn’t running on anything other than my local dev environment on my Mac. Sorting that from my iPad was more effort than I was prepared to make, although it probably could be done.

Textastic – I like the look and feel of Textastic but compared to my normal desktop setup it feels a li bit like coding in the dark. These may be features I’m oblivious to but I couldn’t see any form on code completion, code beautifying, or much beyond code highlighting. Not a deal breaker of course but it’s another little thing that makes you less productive.

Udemy app doesn’t support split screen – This really means a lot of switching back and forth between apps. Picture in the picture did work but because of the screen size, it made the screencast unreadable so that was of limited value.

I’m really interested to see how iOS continues to evolve as a part of my development workflow. With Apple splitting iPad off into its own OS (iPadOS) it’s difficult to imagine a future in which the iPad doesn’t become an even more capable development machine. With the increasing levels of support for external displays, full-blown safari support and other extended capabilities it’s not impossible future iPads might become fully capable dev environment. At least in some use cases.

The thing I’d like the most that would make the biggest difference is a terminal app. It’s a bit of a pipe dream as I can’t see Apple going that way, but I can dream, right?

YelpCamp

I’ve now reached a turning point in my web dev course. This morning I started writing code on my first meaty project, YelpCamp.

As the name implies the YelpCamp project is Yelp but for campsites. The idea isn’t to release this as a service that people will actually use. The intent is to combine what I’ve learnt from the past few months and use these skills to make a cohesive project that could be released.

I’m quite excited to have finally reached this point. As much as I’ve enjoyed developing specific skills, the parts of the course I’ve enjoyed so far is the work with a visible output. I have a feeling YelpCamp will be a big learning experience and something I’ll likely look back on as a reference in any future developments I do. A library of learnings if you will.

As with other parts of the course I intend to share my progress and code here as a form of public note-taking. I’ll create a specific public GitHub repo so you can follow along and see how the code changes over time. I expect this part of the course will likely take me about 6-8 weeks and will make up the vast majority of posts here over that time. Exciting!

How much time should I spend a day learning to code?

This is the question I asked myself when I first started learning (well relearning really) to code a while back. Obviously I Googled this and found some really interesting answers, but generally speaking, the common wisdom is about 4 hours a day.

I call bullshit on this. In my experience (and your mileage may vary) you should code every day, but it really doesn’t matter how much. Sure, you’ll get to the destination faster if you’re able to put 4 hours a day, but that number is completely unrealistic for a good chunk of the population.

Personally, I have a full-time job, 2 young kids, and a wife. 4 hours a day is an absurd amount of free time for me each day to work on much of anything. So when I study something I work to a very simple philosophy. Do some study every day. That’s it. Change is all about momentum. You don’t have to stop sleeping to make a change, you just have to show up every day and do something.

Routine is key

My personal routine is to get out of bed early, normally around 5-5:30am. Then I do as much of my course work before the kids get up as possible. Normally I’d get around an hour or so done. Some days I might sleep in and only get 30 mins, but I still progress. To solidify my learning, in the evening I go over what I did in the morning and write up notes. Sometimes those notes turn into a blog post. In that way, I’m sort of doing double duty. Sharing what I’ve learnt and documented it for my own retention all in one.

The thing about learning anything over and above your already busy life is that you have to make it accessible or it won’t work. Lowering the barrier to just do something each day means I might only research something I learnt the day before or add some comments to code I wrote a week ago. It really doesn’t matter what it is, as long as I get started each day.

So if you’re wanting to study but don’t think you have the time? Explore study options that let you learn in small chunks and to your own deadlines. I’ve found both Udacity and Udemy great services for this sort of thing. You won’t get a formal qualification from these services, but if you’re just interested in the skills then does that really matter?

Flow

Getting into a flow state is super helpful when you’re trying to get some coding done. Whenever I’m working on a course exercise or side project I find a few things in my daily routine really help focus my mind:

  1. Keeping my desk tidy – It seems silly but a cluttered desk is a cluttered mind for me. Keeping my workspace simple and functional really makes a difference.
  2. Meditation – I’ve dabbled with this for years, but this year I decided to make it a daily habit. I’m not perfect at it, but I’d say I manage to get 10 mins done in 9 out of 10 days. When I miss a day I notice it. I’m currently using Waking up with Sam Harris, which I’ve found very educational too.
  3. Music – Not all music is good for coding, but the right music makes a world of difference to me. I have a few sources I use to block out the world:
    1. Code Radio – Free Code Camp has a live streaming station via YouTube which is specifically for helping developers concentrate.
    2. White Noise – This isn’t technically music, but it’s just as effective at blocking out distraction.
    3. Spotify or Apple Music focus playlists – If you use a streaming service, there are loads of shared playlists for focus, concentration or study that do the job. I suggest using a paid service if you can afford it. Although I don’t come across a lot of ads in the free version of Spotify, they are frequent enough to interrupt my thinking.
  4. Changing location – Most of my best work happens in my home office, but some of my best work is done in a busy café. Sometimes when you’re having a hard time getting your head around a problem the best thing to do is take a break, change location and give it another go. There’s something about a change of scene that can make all the difference.
  5. Eat – If I’m not paying attention I don’t eat. If I don’t eat, I’m not effective at much of anything. I find removing choice helps me to stick to regular patterns of eating. Like with meditation I don’t always get this right but as a general rule, I eat basically the same thing each day at the same time. This makes sure I’m both fed and also taking regular breaks.

Do you have some flow state secrects I haven’t covered?

I made a thing: To-do list

Yep, I made another thing in JavaScript for the course I’m doing. This one’s a bit more basic, but really it’s more of cutting my teeth with jQuery sort of project rather than something anyone would actually use. It’s a very simple todo list app that lets you add and remove items from a simple list. It has no backend so you can’t save your list or anything useful like that, but the front end side of things does the job at this stage.

A simple to-do list app

If you’re interested in the code you can take a look on GitHub. Of course, you can try the app for yourself. If you find anything wrong with it you can submit an issue.