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
Jason Cornwall
9,645 PointsNetwork Programming Difficulty
I've been going through the Network Programming course, but I'm really struggling with the material. It's not that I don't understand the code that I'm writing, it's that I don't really understand why it's necessary to write it that way. It seems unnecessarily complicated at times. I have even looked at YouTube videos of developers writing their own networking code, and everyone seems to do it differently without there being any recognizable patterns.
Is network programming always like this? Even though I understand the code as I go through it step by step, I know I wouldn't be able to write all of that on my own from scratch. Am I doing something wrong? And if so, how can I improve? Thank you.
1 Answer
Steven Deutsch
21,046 PointsHey Jason Cornwall,
There's more than one way to skin a cat. Every programmer has his or her own style that revolves around the generally accepted best practices. Over time, your programming skills will progress and you will improve/modify the methods, patterns, and practices you use. I wouldn't worry about everyone else's practices, but rather choose one that works for you, and constantly think how you can make it better. Development is an iterative process.
Next, don't fret about not being able to write networking code on your own from scratch. This will come the more you are required to do so. Development is not about memorizing the process from start to finish, but rather out rather being able to find the information when you need it. Don't be afraid to frequently visit the documentation, in fact I encourage it. They are a developers best resource.
For example, if you are at the very least knowledgeable of the classes involved in networking like NSURLSession, you can use this as a reference point to find your solution using the documentation. The more you use it the memorization comes naturally.
An example that made this apparent to me during my own journey to learn iOS development, is when I tried to memorize all the methods for Swift arrays like append(), removeAtIndex(), etc. This was not only a waste of time but not very efficient. Instead, the memorization came from my constant use of these methods.
Hope this helps!