Author Archives: Mark Durham

The Grumpy Old Programmer and MapKit

I really ought to rename my blog “The Grumpy Old Programmer”. Today I am going to pick on Apple and MapKit.

Now, MapKit had some issues at the start of its life. Fortunately, those are in the past. I have actually found MapKit to be an enjoyable experience so far. But I do have one issue with it that I just came across.

You can tell MapKit where you want your map centered and how tall it should be (in degrees latitude) and how wide it should be (in degrees longitude). MapKit will supposedly give you a map as close to what you requested as it can, but it can’t guarantee that you will get exactly what you asked for. This is because MapKit is going to fill the available space with the map while still maintaining the Mercator projection. The upshot of this is that a full-screen display can only display half of the earth at a time.

The Google Maps API will readily serve up not just the whole earth, but the whole earth repeated several times over. It does this by clipping off the poles and letter boxing the map to preserve the projection.

As an added twist, I really want a different center to the map based on orientation. For a portrait orientation, the default map at minimum zoom can be centered on (0, 0) and you will see everything of interest (in that hemisphere, anyway). But in landscape orientation, the discrepancies between the Northern Hemisphere and Southern Hemisphere become obvious. I would much rather see more of the northern land than the southern seas in this case. That’s the Earth’s fault, not Apple’s. But again, this is a non-issue with the Google Maps API.

Fortunately, there is only one time when I want to set the center and size of the map, and that is at startup. The rest of the time, I am going to preserve the last location and zoom level that the user set. So, my apologies to Asia and Australia. Perhaps someday the iOS version of Steampunk Road will show your your half of the world as well as mine.

A Debugging Class Is Needed

Looking through Udacity’s student forums, I think they should add another course that is devoted to debugging. They showed some promise in the initial lessons of the first course by displaying some common errors and how to handle them, but since then we have pretty much been left out to dry on our own. That is partly because debugging is very hard, and partly because it seems like every bug is a unique issue unlike any other.

Of course, that is not true. Bugs can be categorized, and basic general steps as to how to approach debugging can be described and demonstrated. The opportunities for practice assignments are enormous. And practice is the one thing that will really make a difference in how well a programmer can debug. It is so much easier to catch and fix a bug that one has already seen before.

How to Make an iOS App: What I Learned Today

I started building my app today. I learned a lot about sending notifications to iOS devices using Firebase. I learned a lot of other things about other stuff as well as I set up all of my tooling. There should be a course just for tooling included in the Nanodegree.

It is somewhat interesting to note that, in all likelihood, you will learn far more outside of the Udacity video lectures than inside. I think that to a certain extent, this is just the nature of the beast. Most people learn more by doing than by watching.

How to Make an iOS App: Course (Lectures) Complete

I have completed watching the lessons for this final course in the Nanodegree program, which means I have finished all of this Nanodegree’s video lectures. I still have the last two projects to finish: “Virtual Tourist” and my capstone project app “Steampunk Road”.

So it has taken me precisely four months to get to this point. Using my timeline for my final project, it looks as though it will be another two months before all of my work for the Nanodegree is complete. Of course, the duration from start to finish will be different for everyone, and especially different from mine if you are not working full-time and have an active family life.

Would I recommend the courses to aspiring developers? My answer would have to be a qualified “Yes”. There is much to be appreciated here, but there are also many faults. Be prepared to use at least one outside source to help you, or at least lean heavily on the course forums.

Would I recommend the courses to established developers? Not necessarily. Although you can probably learn something from the videos, the flaws in them are more pronounced to those who can understand what is going on.

I still have a lot of reflection to do for that final project, so I will try to post those here over these next two months (or more).

How to Make an iOS App: Personal Motivation

Q: What are you most passionate about?

A: I have no idea what I am most passionate about. I have many passions, including mathematics, physics, music, theatre, and computer programming. I am also passionate about my family. On any given day, one or more of those will most likely come to the fore.

Q: How might an app help?

A: Apps can help me explore mathematics, play with physics, create music, and learn programming. Some apps, like multiplayer games, help me interact with my family.

Q: Where are there frustrations or pain points in your life?

A: Time

Q: How might an app help alleviate them?

A: An app or apps might help me manage my time better, but I doubt that an app can provide the vast swaths of time to explore that I really crave.

How to Make an iOS App: What Makes a “Good” iOS App?

I have found the information I need to make the “Virtual Tourist” app, plus I now know how to actually use the “Virtual Tourist” app provided by Udacity on Apple’s App Store, but I am starting the final course of the iOS Developer Nanodegree whilst also working on that app. Part of “How to Make an iOS App” is answering questions, some of which I will answer here and others which I will probably keep private to protect my intellectual property.

The first question is “What makes a good iOS App?” The answer is very much the same as the answer to the question “What makes any product good?” And the answer to that question is, “You feel better after using the product (app) than before.”

But that sort of begs the question, “What about an app makes you feel good?” And there are many answers to that question. An app that makes you feel good is probably:

  • Simple
  • Intuitive
  • Beautiful
    • Visually
    • Aurally
  • Engaging
  • Entertaining
  • Challenging (at least for me)
  • Inspiring
  • Tells a compelling story
  • Humorous

And of course, that list could go on and on. Plus, the list will most certainly be different for different people. It might also be informative to list the opposites, to show what an app should not be:

  • Unnecessarily complicated
  • Unintuitive
  • Ugly
  • Dull
  • Boring
  • Unchallenging
  • Uninspiring
  • Pointless
  • Humorless

What Online Learning Needs

Whilst thinking about the shortfalls of Udacity’s (and virtually everyone else’s) online classes, I struck upon this brilliant thought. Online learning needs the equivalent of a “Dragon’s Lair” video chat bot. While you are watching an instrutor video, you should be able to raise your virtual hand with a question, have the video pause, cut to a video of the instructor saying “Ah, you have a question. Yes, what is it?”, then you type or speak your question (“What is SQLite?”), the video cuts to a pre-recorded answer, and then cuts to the instructor saying, “Are we ready to return to our discussion?”, after which you say “Yes” and the original video resumes.

iOS Persistence and Core Data: VirtualTourist

“VirtualTourist” is supposed to be the app we create at the conclusion of this course. Like “On the Map”, it only gets the briefest of mentions during the course and none of the necessary resources are obviously available. There is an app from Udacity available in Apple’s App Store: “Virtual Tourist Portfolio App for iOS”. Unfortunately, and this does not bode well, the app appears to be relatively non-functional. It solitary usefulness in this course is in its description:

This app allows you to virtually tour any place on the planet! Simply drop a pin anywhere on the map, and instantly browse nearby Flickr photos. It’s like you’re there already…or something.

If you are still working on the earlier courses in the nanodegree, example “Pitch Perfect” and “On the Map” apps from Udacity are also available. They appear to be in working order.

Update! The “Virtual Tourist Portfolio App for iOS” actually works! You just need to use a long-press to drop a pin, and then you can tap that pin to see pictures from that area. Perhaps Udacity needs to add a course on onboarding?!

iOS Persistence and Core Data: Unsimple Persistence

I just finished the videos for the course, and I have to say it is a good thing I already have a lot of experience with Core Data. This course starts off so cute and friendly, like a little smiling snowman. But that smiling snowman is at the top of a mountain, and as he rolls inexorably down the mountain toward you and his inevitable conclusion, he just gets bigger and bigger and rolls faster and faster until—BAM!—he crushes you at the end!

This is a common problem with many courses, not just this one and not just in teaching computer programming. The course author knows exactly where to start, and starts off at a nice leisurely pace explaining every detail and inserting interesting tidbits and asides. But then soon comes the realization that we need to get down to business here, and subjects get glossed over as we desperately seek to come to some sort of conclusion quickly.

The best example of this in this course is a tacked-on Lesson 6 in Core Data and Concurrency. This is a topic almost deserving of its own course, but instead we get one long page of text. No video, no coding, no quizzes … nada. I can’t be positive, but it feels like this was added after the course was already “completed” and someone discovered that—oops!—our Core Data stack has concurrency issues and we better say something about it.

Courses should be written backwards. Start with where you want to end up. Look at everything your students need to know in order to do what you want them to do. Then take each of those things as your new endpoint and work backwards from them. That slow, gentle, congenial, leisurely pace should be your ending, as well as your middle and beginning. Yes, you should challenge your students. Yes, there should be a learning curve. But no one ever said it had to be exponential!