Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

What is the Right and best way to learn Swift and learning to code in general

Hi

so I've been learning how to code in swift religiously for the past few months. I am currently on the intermediate swift course and i try to do some work on swift every day whether its watching the videos or reading the documentation etc .

However I've been finding myself at a dead end as I feel that I cant apply anything that I'm learning properly and I find myself forgetting many things and then I have to go back and look at my notes or check the apple documentation for what a function is or how to unwrap an optional and I feel like I should Know all this. And the hardest thing I find is when I have a small idea to make something in playground like today i find it hard to actually write code, like its so overwhelming as to where do I start off, what code to write first and how to link that to the next code etc. Idk if this is making sense like if we were to create a weather app do you start with the days or the different types of weather or temperature and its just so confusing to actually apply. What can I do to sort this? I'm a person who likes order and i want everything to be in chronological order and I should know exactly where everything is and what its doing but im struggling here.

If Im honest I don't think I write enough of my own code as i find it quite intimidating, im usually making mistakes everywhere and the compiler is screaming at me with errors even when the code id dtill being written and I end up just deleting it , another thing is I feel like I should have learnt all of the swift course by now and I have given myself a certain time frame to learn it which is why I move on even if I don't understand something fully and usually look around for the answers to the challenges so that I can move on, which may be why I'm feeling like this. Often I understand it but then when have to do the challenges i cant apply it

I just feel like there,s no difference to when I started and me now in the sense that If I was asked to make an app I still have no clue. Its not the treehouse courses or videos as I feel like they are amazing and the best thing out here if you want to learn how to code.

Having said that I have learnt a lot and when I look back to when I first started i do have more knowledge. Starting from variables n constants to looking at optionals and guard statements I am better at writing code than when I first started but whats the best way to pick up code fast and how do you apply the knowledge you learnt when actually writing code.

if anyone can share their own experiences and journey and their advice Id truly appreciate it

Thank you

Alia

3 Answers

Hi Alia, much respect for your honesty!

First of all: Your "problem" is quite popular, at least if someone starts with programming, so you're not alone :) I think we actually share the need of structuring all and everything. I bet you don't have anything on your Desktop or in your Download-folder too?! :P


When I first started programming I also felt it quite overwhelming and wanted to understand every tiny detail before moving on. One important lesson I learned was to write many comments to really understand the code I or someone else wrote. Commenting helped me a lot and could get through the basics of programming much easier and faster.

After moving on to some more advanced topics I also discovered blogging for myself. Writing down and trying to explain to others what happens on the few lines of code helped me even more than just writing comments. If you do not want to write a blog you could also write some text documents to explain your future self how you've solved a specific problem. You may don't have to read that text ever again as you've learned during the writing. :)


But the most important thing you have to do while learning to code is to code. Imagine you want to learn the difference between classes and structs. Just create a new playground and try to tackle a imagined problem, e.g. create a type named User with a few properties (username, password) and some methods like getAllFriends(). Do not to care about the logic behind getting all friends, rather try to understand how to structure the code using either a class or a struct.


I hope I could help you or at least motivate you to go on your challenge of learning to code. :)

Happy coding, Moritz

Hi Moritz

Thank You so much for your response I feel a lot better. Haahaa I'm sorta organised desktop yes! download folder not so much :P

But your right I will start using comments more as otherwise I have no idea what the code is supposed to do, and i might actually start that the blog thing as well, Ive just seen you blog Its pretty awesome I've added it to my bookmarks :)

Btw can't believe your from Germany your english is so Good! and Germany is Amazing too!

Thanks for your help once again

What might help is to take on coding projects for yourself, whether paid or not. For example, try to find an internship at a software company, even if it's not a paid position. Just having to code daily will keep your skills sharp, as well as learning from more senior developers.

Or, if that kind of opportunity is not available, challenge yourself with your own projects, even if they're trivial and "useless." For example, create a to-do list app, or a calculator app, etc.

If you can't think of your own projects, you might try to reproduce the coding projects taught in the courses in Treehouse from scratch by yourself. If you get stuck, just re-visit the videos again.

The common theme is to practice, practice, practice coding, just as you would any skill. They say it takes 10,000 hours of practice to master any skill. There's a lot of truth to that, and no matter how much we've mastered already, there's always something new to learn.

Thank you for your help I will try to apply this :)

That's so true. I just started Treehouse (again!), having stopped for a few months because of a lack of approach which got me overwhelmed. My approach now is just to plug on EVERY SINGLE DAY for a video or so, never mind repeating, and just to keep watching and coding, which hopefully will get me somewhere.