New to Swift- Need advice please

Hey everyone, names Chris. I have been a wordpress website developer for the past 8-10 years and really looking to set it up and learn a high level programming language. I chose Swift since i have always been interested in creating apps. Im just not where to start and I get a little intimidated when i see a lot of code on the page. Im using swift playground right now then will go to codecademy.

One thing i realized i tend to lose concentration when i code or if i run into a problem it frusterates me and wants me want to stop coding for that moment. Has anyone going through and can help me out?

From my experience I would say that you have to be prepare that it's sometimes hard and frustrating. I'm myself a novice, so I still remember trying to comprehend documentation for simple map method (what is that U, T, rethrows etc.) few years ago.

What really helps with struggle is finding good methodical learning material which suits you. My beginner path was to complete 100 Days of Swift (UIKit), then 100 Days of Swift (SwiftUI) from Hacking with Swift and then all materials from Point-Free. I have found those 3 sources most methodical, with nice progression and great exercises to do after episodes. They have in common that all topic begins with clean project so you learn whole process. I believe that is much better then tutorials which are base on some prepared "starting point".

But this are just learning resources. In the end to programming in Swift you have to programming in Swift - there is no other way. So what is most important to start with your own project as soon as possible. So after gaining some beginner level knowledge (after 20-30 days of initial learning?) just go and do some basic app for yourself. As crude and simple as possible. Simple command line tool as a helper in your Wordpress dev, REST client for some Wordpress website (it was one of my first app, which I still use), simple widget, etc. At the beginning just don't care about architecture, reusability, code smell, performance. If it works then it works.

Thats really great advice! Thank you...The thing is while i do have wordpress experience i dont have much php or javascript experience, mainly just html / css..Not sure how much that will hinder me learning swift as a first language

Don't worry about that :slightly_smiling_face:
Swift was my first programming language, and while it can be a bit overwhelming at first (because it has a lot of features) once you understand the overall design it becomes really simple to learn going forward.
You don't need to figure out the entire language at once, it's designed specifically to let you learn features one at a time.

Just be careful with trying to make larger apps too early, since that's something that will require at least some basic knowledge of many Swift features.

SwiftUI has a lot in common with HTML and CSS, it's a simple and declarative way of describing the layout of an app. And not knowing JavaScript very well is actually a good thing :grin:
Swift is in many ways the opposite of JavaScript, so you won't have the added difficulty of having to change your way of thinking about a programming language.

The language itself is nice to learn, and the Swift book is quite good I think. There is a little gap (on swift.org, at least as far as I know) when it comes to things around the language itself, e.g. when something is wrong in your configuration for the Swift Package Manager (Package.swift) and the error message is not helpful. Do not despair in those cases, a little search e.g. in the Swift forums might help. Once you get a little grab on how things work and are supposed to be used in Swift, this language is very "rewarding" :slight_smile:

1 Like

So I just searched what "type of learner i am" I got tactical learner with makes a TON of sense looking at my past history.

Tactile
If you are a tactile learner, you learn by touching and doing. You understand and remember things through physical movement. You are a "hands-on" learner who prefers to touch, move, build, or draw what you learn, and you tend to learn better when some type of physical activity is involved. You need to be active and take frequent breaks, you often speak with your hands and with gestures, and you may have difficulty sitting still.

In you guys experience would this effect my ability to code since im more hands on, OR is there a way I can use this to my advantage?

This sounds interesting but is quite far from a technical question :wink: (BTW: Is coding really that much different from touching real objects?...)

Just start working with Swift and have fun :slight_smile:

It sounds like it could be easier for you to learn Swift if you were to focus on writing programs that have immediate visual feedback rather than abstract math algorithms.
The Swift Playgrounds app focuses on that, and in the iPad version there's some interesting things you can do with its motion sensing capabilities, cameras etc :)

You are absolutely correct, I was never the best at math in school, I actually don't like it, but in my defense i didnt put in much effort....I am doing Swift playground for apple. Do you know of any other ones I can do after i complete the apple one?

As someone already mentioned before, Hacking with Swift is probably the best way especially considering you mentioned being interested in apps. You can check out the YouTube channel for a lot of great practical examples.

One video you could watch after figuring out the language with Playgrounds is this one: Learn the Essentials of Swift in one hour - YouTube
It's basically an overview of the most important Swift features. You don't need to understand everything from the start, it's just good to have a reference and know certain features exist, so that when you run into them you know what they are :slight_smile:

For the apps themselves you should probably avoid AppKit/UIKit and focus on SwiftUI.
The former are older frameworks and are more on the abstract side, you use objects and do a lot of things manually, whereas SwiftUI has immediate feedback for almost everything you do - most of the code is instantly, visually reflected in a preview. It's a better fit for your learning style.

Thats actually my plan actually :) - Its funny, I know the lingo, i know about SwiftUI and use that since its mre visual. Im a big researcher so i learn alot from articles. My issue is understanding the code aspect of it at times. Basically I can speak dev but cant write it well.

1 Like

You just need to keep writing in the language and get used to essentially thinking in Swift - It's like a normal language, just for describing logic.

You can learn English, Spanish etc relatively quickly, but it takes a while of using a language until you finally start noticing all the subtleties and understand it fully. Programming languages are no different :slight_smile:

I agree with you 10000% on this Puz, and always have a goal in mind as well, helps with motivation, eventhough determination is more important IMO

1 Like