Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

buttongerald

macrumors 6502
Original poster
Jan 29, 2016
341
629
St. John's, Newfoundland
Good Day Folks,

Over the last few weeks, I have really spiked an interest in programming. I would love to learn how to do it, but I have zero knowledge of code. Graphics, photography, and video? You bet. But programming languages? Nope, I don't really remember HTML or CSS either as the last time I did any web work was with Adobe Muse.

I would love to stick with Apple based work. I have searched around, and maybe I am not using the best keywords but when I come across tutorials and guides most of them assume you have existing knowledge.

Does anyone know of a definitive, up to date, start here guide? I am in no rush, and I will obviously take my time, but this is something I am extremely interested in learning. If anyone could give some tips or at least point me in the direction I need to go in it'd be much appreciated.

Regards,

Gerald B.
 
The Apple programming community is weird state now that Swift is the new hotness. It's hard to say where the best place to start is because it really depends on what you need or want to do. Starting with Swift now would be fine since Apple isn't going back from it, but eventually you'll need to pick up Objective-C since a lot of the frameworks are based on that. I would recommend the Big Nerd Ranch Swift book and then Objective-C book. As for online resources, Ray Wenderlich is great but is more Topic based, but that's a good start!
 
  • Like
Reactions: buttongerald
I would start with figuring out which path you want to take. You say programming, but does that mean business apps or games? Generally the games are written in an engine like Unity which uses C# (IIRC).

Then after you decide that, is your goal to get a job or just to make apps?

If it's games, I would look into Unity. If it's general app dev, I'd look at Swift, then ObjC as Dookieman suggested.

If it's to get a job, be careful to look at where the market is going. One of the issues with jumping into a tech that has already taken off is that they used to expect 1~2 years, now they want 3~4 years, next they'll want 5~7 years. This depends on where you are located as well.

As far as the general path, I'd study Object Oriented Programming (OOP) and you can pick C++/C#/ObjC or Swift.

Big Nerd Ranch make some great books. Lynda.com has some great video tutorials and start out like $25/month with 7 day free (IIRC).

iTunes offers the Stanford U series but it's a bit more advanced.

One other note, update your computer to the latest version of Xcode and watch the dates of the tutorials, Xcode and the languages/APIs change all the time. An out of date tutorial can be confusing.
 
  • Like
Reactions: buttongerald
My best advice is bitfountain.io. They have some pretty good courses, from what I hear.

It's probably best to start with Swift. it's a pretty easy language.

If you do like programming, you should set a daily goal, i.e. spend 1 hour per day learning and taking notes until you feel youve finished the course. Sometimes its hard go stay focused, but nothing worth knowing in life comes easily. It's good to take a huge amount of notes. I still find myself going back to my notes sometimes, years later.
 
  • Like
Reactions: buttongerald
Thank you for all of your suggestions. I will give some more insight, as it seems I didn't really bring up as to why I was so drawn to it the last little while.

I have been looking back at some of the old Atari games and going right up to the Nintendo, and I just look at them and think of how much work and hours of code were poured into creating this games, and it's really something I want to learn about.

I am already a graphic artist, graduated and working in the field, so this would be a hobby, and maybe one day yes, I will release a simple game, but my goal is to learn how all this works.

Games are my main focus. I have several ideas that I would love to bring to life, but I have to start learning how from the bottom up yet.
spend 1 hour per day learning and taking notes until you feel youve finished the course.
Currently, I have been doing research for about this amount of time per night after my son goes on to bed and my wife is studying. Digging around for what I can find, but I could never seem to find a clear starting point, so I knew coming here and asking my fellow mac users was a good idea. And it was.
 
If you can study by books, there are lots of good choices. Search for "Swift Game Programming" or just Swift in Amazon and look at the reviews. You want a newer published book that covers XCode 7 / iOS 9.

If you prefer video tutorials, there are sites like Udemy and Lynda that have various introductory classes in Swift. These generally just help you build confidence in actually creating and deploy apps to your device (for free you don't need to buy a developer subscription right away). In the case of Udemy their prices usually drop to $10-$20
regularly so $150 today could be $20 a week later.

It's good to have a project in mind but it's also good to keep your expectations down so as to not get overwhelmed and discouraged. I have found when learning a new language is to have that specific project in mind and then look to learn all the parts to make it work. For example in a game: How do I display sprites? How do I move them and detect collisions. How do I play audio? How do I save game data, etc... There are hundreds of topics and years of learning ahead but focusing on a narrow area helps to keep things going. It's also good to find someone or a group to join that can help motivate and share ideas.
 
  • Like
Reactions: buttongerald
Learning to program is hard to nearly impossible for many people. Most programmers are incredibly clueless about that fact. Thus looking for absolutely easiest learning material possible is least likely to cause adults to give up.

Go to the library or bookstore and look for the easiest to understand book you can find on learning to code for kids/idiots/dummies/beginners/children. Learn whatever language is in that beginner material (usually Python, Javascript, a Smalltalk-derivative, or Basic) until you can solve many the problems in that book by yourself. Then move on to learning Swift for iOS and Mac apps.
 
  • Like
Reactions: buttongerald
How do I display sprites? How do I move them and detect collisions. How do I play audio? How do I save game data, etc... There are hundreds of topics and years of learning ahead but focusing on a narrow area helps to keep things going. It's also good to find someone or a group to join that can help motivate and share ideas.
This is actually my road map. First learn the basics, move into how to display a character on screen and have basic movement/animation, and just keeping moving on.
 
There are tons of example game projects out there. I did on years ago from Ray Wenderlich, it was a book/tutorial you would buy and run thru. It's a good way to go because you see how a game is developed.

https://www.raywenderlich.com/

There's plenty of these out there.
 
Last edited by a moderator:
  • Like
Reactions: buttongerald
As I am just starting out as well and coming from C#, I would suggest that you first learn Swift since it is a lot easier to learn (simpler syntax, compares to c#, java, and python in simplicity). A website that I found that has helped me immensely is www.hackingwithswift.com. Of course a quick google search will bring up a plethora of websites that teach you swift or obj-c.

Step 1 - Learn Swift.
Do the work on your own with any and every tutorial and use Playgrounds for small tutorials (e.g. making constants and variables and testing if statements) and move on to XCode only when you need Storyboards to make your screens. If you have the time, do a tutorial over and over until you can write it completely without using the guide.

Step 2 - Bookmarks.
Bookmark the Apple Documentation and Swift.org in your favorite browser, you will need it, there is too much to remember especially when you are aiming for "UIApplicationLaunchOptionsLocalNotificationKey" and typing in "UIApplication" gives you about 20 different options to choose from.
In particular one that was pointed out my multiple developers is the UIKit Documentation. It has reference to the base framework for everything you see on an iDevice screen.

You may want to bookmark websites like github.com for examples of code that you can reuse and refactor in your own code. Websites like stackoverflow.com can help you troubleshoot why your deck of cards is not distributing cards correctly.

Step 3 - Learn Obj-C.
By the time you get to this point you will have seen and used a lot of Obj-C code and didn't realize it, which is great because that means you have taken a significant chunk out of a really hard language for beginners.

As an example here is a print statement in each language
Swift:
Code:
let name = "mildocjr"
print ("Hello \(name)")

Obj-C:
Code:
NSString *name = "mildocjr";
NSLog(@"Hello %@", name);

Swift is a lot cleaner than Obj-C because Obj-C derives from NextStep (hence the NS everything) and C.

Most tutorials refer you to C if you are starting to learn Obj-C but that's only necessary if you are planning on doing low-level programming such as memory and processor thread management.

Final thoughts:
The Apple Developer forums is a bit convoluted and would probably best serve you for overcoming issues when you start making an app, the videos are good for showing new concepts introduced in the most recent version, and can be helpful in finding easier ways to do things (like debugging with address sanitizer).

If you are just starting development, you might find that programming is dauntingly overwhelming because there's easily 100 lines in a document and hundreds of methods for you to choose from.

If you start to feel this way use code folding and just shut out everything that doesn't matter at that moment. You'll find that you are really only dealing with maybe 2 variables and 5 lines of code. After a while you'll train yourself to just look at the present code with tunnel vision and you won't think about all the other stuff going on.
 
  • Like
Reactions: buttongerald
Game development, general mobile development, web development, these are VERY different things. If you intend to go in to mobile game development, you should jump right in to a Unity course online. If you want to make more general apps, then a Swift course is best.

It's very important not to waste your time because boredom = little progress. Programming is hard enough to learn when you are doing it all right, but when you start learning things that don't interest you, you will quickly lose focus.

That said, most the advice programmer's give to beginners is usually pretty bad advice. You want to really just dive in to a beginner course in whatever interests you. I have never agreed with this concept of "first learn language X, then language Y, THEN focus on Z". No! Just do what you're interested in, the details have a way of taking care of themselves.

Most people just aren't cut out to be programmers. It has less to do with formal mathematical education (or any formal education really) and more to do with your mindset.
 
  • Like
Reactions: Dookieman
Game development, general mobile development, web development, these are VERY different things. If you intend to go in to mobile game development, you should jump right in to a Unity course online. If you want to make more general apps, then a Swift course is best.

It's very important not to waste your time because boredom = little progress. Programming is hard enough to learn when you are doing it all right, but when you start learning things that don't interest you, you will quickly lose focus.

That said, most the advice programmer's give to beginners is usually pretty bad advice. You want to really just dive in to a beginner course in whatever interests you. I have never agreed with this concept of "first learn language X, then language Y, THEN focus on Z". No! Just do what you're interested in, the details have a way of taking care of themselves.

Most people just aren't cut out to be programmers. It has less to do with formal mathematical education (or any formal education really) and more to do with your mindset.

This is spot on, programming can very hard to grasp, this stuff can be dry as shi-t if you're not working on something fun. When I started a few years ago, I was working on something that REALLY peaked my interest. Like, I was addicted to it. I had tried learning at other points in my life (Apple Script/Real Basic) with moderate success but when I was working on something I enjoyed, it was a thrill!
 
+1 on the "it's not for everyone". When I was in College I started with programming and loved it. When I 1st saw that I could create a product that people would want, I became unstoppable.

The way I saw it was that I only had to do something once. A sort, a data file, a parser, etc... Where as a welder has to do the same thing over and over.

I saw that the huge amount of work to get one program right, would be spread to many users. In addition, a routine can be used by different programs. So, if done well, it can be something very powerful.

What I didn't see then, was this it's lifelong learning. I've spent much more time leaning than earning. A welder doesn't have to do that. Most jobs don't have the life long learning requirement.

Then there's the you better know which way things are going. People that jumped on the WebOS or WinPhone boat, didn't have a great run.

Having said that, someone really needs to try it for themselves.
 
AxoNeuron pretty much summed it up.

To help you get started with a general overview of programming I'll briefly go over the main concepts.

Don't worry if you don't understand the names. The important thing is just understanding how programming works. I tailored this more towards XCode development but these principles apply to almost all object oriented programming languages.

Hierarchy of code
Class - Creates a blueprint object lets say a round ball, you can add properties to this class that define it's name, color, weight, shape, etc.

Subclass - Creates a blueprint for a more specific class such as a soccerball or basketball, they are very different from each other, but they both derive from the same class ball. Subclasses can also contain properties that override the class (say you want to make a football)

Property - as defined above is basically a feature of a class, If I am a Person class, my name property is Mildocjr.

Methods - methods are used to perform tasks, say the Person object Mildocjr uses the method dribbleBall() to interact with a Basketball object created by the Basketball subclass.

Functions - basically methods performed on Variables. An Add function might take in two variables x and y and add them together so if x = 3 and y = 2 saying add(2,3) will give you an output of 5.

Variables - store information for the user, whether it is as a string ("mildocjr"), an integer (10), a double (10.5d) or a float (10.51f)

Constants - store information like variables except you cannot change the value of a constant, this should be used for something that would be static.

Example of using constant vs variable
let gameOver = "Game Over" - this is a constant, it's value cannot be changed after it has been set this way, I don't plan on gameOver to ever say anything other than "Game Over" so this is a safe bet.

var score = 0 - this is an integer variable, I expect this to change throughout the game so I start it with var instead of let.

If you try to change the value of a constant, the compiler should yell at you.

Knowing this structure will get you started, but you'll still need to be able to think in terms of logic.

If you were going to ask the user for their name in the form of a textbox and when they tap a button it reverses the order of the characters in their name, how would you do it?

In terms of logic, you'll have to take the name and store it in an array split by character, then you reverse the order of the array, and print it back out to the user.

A few helpful principles.
Code Reuse/Don't repeat yourself (DRY) - means if you do something more than once, you might put it in a method that you can call multiple times. This is helpful when you are performing the same 5 lines of code 10 times throughout your program.

Single Responsibility Principle (SRP) - means each thing does one thing and does it extremely well. If I have an add() method, that's all it does is add a number, it shouldn't do anything else.

Separation of Concerns - is a more advanced topic but the idea is that you want to keep things as independent of one another as possible. Say you are making a game using SpirteKit, later on you decide you want to change your game engine to Unity, proper separation of concerns during the initial build of your app will allow you to swap SpriteKit out with Unity and it doesn't break your program. Xcode does this for you by default by separating the Storyboard from the AppDelegate and the ViewController.
 
  • Like
Reactions: 1458279
+1 on the "it's not for everyone". When I was in College I started with programming and loved it. When I 1st saw that I could create a product that people would want, I became unstoppable.

The way I saw it was that I only had to do something once. A sort, a data file, a parser, etc... Where as a welder has to do the same thing over and over.

I saw that the huge amount of work to get one program right, would be spread to many users. In addition, a routine can be used by different programs. So, if done well, it can be something very powerful.

What I didn't see then, was this it's lifelong learning. I've spent much more time leaning than earning. A welder doesn't have to do that. Most jobs don't have the life long learning requirement.

Then there's the you better know which way things are going. People that jumped on the WebOS or WinPhone boat, didn't have a great run.

Having said that, someone really needs to try it for themselves.
And this is exactly why I moved to start learning Java and Android development. You don't want to have all your eggs in one basket, even if that basket made $18.4 billion in pure profit last quarter ;)

Just kidding. I really just started learning Java development as an excuse to buy a Nexus phone. But it's been going quite well!
 
And this is exactly why I moved to start learning Java and Android development. You don't want to have all your eggs in one basket, even if that basket made $18.4 billion in pure profit last quarter ;)

Just kidding. I really just started learning Java development as an excuse to buy a Nexus phone. But it's been going quite well!

Java is a friendly language and might help you get the basics down about programming.
 
And this is exactly why I moved to start learning Java and Android development. You don't want to have all your eggs in one basket, even if that basket made $18.4 billion in pure profit last quarter ;)

Just kidding. I really just started learning Java development as an excuse to buy a Nexus phone. But it's been going quite well!
I started learning Java back in the 90's, but it's kind of an issue of how much time to learn all the platforms and languages. I also got turned off the Android platform years ago when development on Android really sucked. I imagine it's a lot better now (I hope).
 
Java is a friendly language ...

Hardly. Java was designed for programmers. Friendly languages are the one designed by educators for non-STEM students, languages such as Basic, Logo, Scratch, Alice, et.al. The proof is in the vast number of 12 (etc.) year old kids who have learned to code in these programming languages by themselves for fun. Python seems to be the closest professional programming utility to those older friendlier programming languages. Not Java or Objective C. Way too much set up and complicated syntax required.

Swift 2.x in Playgrounds is getting maybe part-way there. But it can still be a bit unsafe (crash, lock up, esoteric error messages, etc.) And there's a vast amount of educational materials to be developed.
 
I started learning Java back in the 90's, but it's kind of an issue of how much time to learn all the platforms and languages. I also got turned off the Android platform years ago when development on Android really sucked. I imagine it's a lot better now (I hope).
The Android platform is pretty good these days. I still prefer the UI layout and design system in Xcode over Android Studio any day, but it's catching up rapidly.
 
The Android platform is pretty good these days. I still prefer the UI layout and design system in Xcode over Android Studio any day, but it's catching up rapidly.
That's good to know, I can't keep ignoring Android for ever. It's been years since I dug into Android. I'm actually surprised that it's not offering a platform better than Apple just because most things there are open source. Open source usually does pretty well, but glad to hear things are improving.
 
That's good to know, I can't keep ignoring Android for ever. It's been years since I dug into Android. I'm actually surprised that it's not offering a platform better than Apple just because most things there are open source. Open source usually does pretty well, but glad to hear things are improving.

The Android platform is still a mess in general. I work on a multi-platform app along side Android devs and their development time is easily 1.5x ours. Fragmentation is still a huge problem for Android and the open-source nature of it contributes to the problem. For example, want to access the camera? Well depending on what manufacturer you have, you have to write different code to access the camera. Everyone does it differently.

Samsung is the biggest offender of this, they re-implement everything their own way and if you don't code for their version of Android, crash. It's different on the S3/S4/S5/S6, Lollipop, Marshmallow, Kit-Kat, LG phones etc... Hell, you can't even access a simple webview without doing it their way. If you want to code standard (vanilla) Android, a Nexus phone is your best bet but you are severely limiting your audience.
 
The Android platform is still a mess in general. I work on a multi-platform app along side Android devs and their development time is easily 1.5x ours. Fragmentation is still a huge problem for Android and the open-source nature of it contributes to the problem. For example, want to access the camera? Well depending on what manufacturer you have, you have to write different code to access the camera. Everyone does it differently.

Samsung is the biggest offender of this, they re-implement everything their own way and if you don't code for their version of Android, crash. It's different on the S3/S4/S5/S6, Lollipop, Marshmallow, Kit-Kat, LG phones etc... Hell, you can't even access a simple webview without doing it their way. If you want to code standard (vanilla) Android, a Nexus phone is your best bet but you are severely limiting your audience.
Wow! Ok, I guess I'm glad I don't live in that hell. I guess the value to the manufacture of having a large selection of apps isn't really there.

Maybe they don't care because most apps are crap and if it's easier, they'd have more crap apps.

Tell me something. Back in the day, it was pretty easy to pirate Android apps. They used to be able to take your app and put their name on it and put it back on the playstore. They used to say that it was very hard to make money on Android.

Are these things still true? Because it sounds like it's not well worth learning Android.
 
Wow! Ok, I guess I'm glad I don't live in that hell. I guess the value to the manufacture of having a large selection of apps isn't really there.

Maybe they don't care because most apps are crap and if it's easier, they'd have more crap apps.

Tell me something. Back in the day, it was pretty easy to pirate Android apps. They used to be able to take your app and put their name on it and put it back on the playstore. They used to say that it was very hard to make money on Android.

Are these things still true? Because it sounds like it's not well worth learning Android.

Yea most of those things are still true, though I'm not sure if you can publish someone else's app. I do recall a story where there were like 10 versions of Skype, all with same icon and everything, not sure if Google cleaned that up. It's still pretty easy to pirate apps as well, you can "side-load" unsigned apps and that allows people to crack official games and release them online as unsigned. The plus side of that is if you are doing development you don't need to deal with provisioning profiles etc...

Not trying to hate at Android at all, the official stuff looks nice and Google is trying to get people on a standard but there is no putting the cat back in the bag though, fragmentation is here to stay.
 
Yea most of those things are still true, though I'm not sure if you can publish someone else's app. I do recall a story where there were like 10 versions of Skype, all with same icon and everything, not sure if Google cleaned that up. It's still pretty easy to pirate apps as well, you can "side-load" unsigned apps and that allows people to crack official games and release them online as unsigned. The plus side of that is if you are doing development you don't need to deal with provisioning profiles etc...

Not trying to hate at Android at all, the official stuff looks nice and Google is trying to get people on a standard but there is no putting the cat back in the bag though, fragmentation is here to stay.
10 versions of Skype :eek:, can't imagine how that worked out.

I've heard that's where most of the malware comes from.

One of the tricks I heard about was downloading the app and changing a few things, then loading the app back up as if it were your own. There was a story about someone that knew the developer of one app and saw it uploaded by a different developer. He caught it because he happened to know the developer.

I guess this is the primary reason Apple is the leader in business apps. I don't know many businesses that would trust Android with corp data.
 
The Android platform is still a mess in general.

One rumor I heard awhile back was that a significant percentage of all Android app revenue was from just the Amazon app store (and Amazon devices aren't quite as fractured as the generic Android world). Thus developing for Amazon mobile devices alone might provide the best revenue return per Android developer man-day (but still a fraction for that of iOS). But something in Amazon's contract is reported to be messed up.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.