Anyone else hate not being a programmer?

I feel like maybe I need to just say fuck it, ditch all of the tutorials and books, and just open xcode now that I know some basics and bang something simple out completely on my own.

Maybe even something similar to a tutorial app I have completed, but only refer back to the tutorial when I am completely lost?

What do you guys think about that?

Yep, that's exactly what you should do. Then while writing the app, a bunch of lightbulbs will go off in your head, and once you're done, you'll look back at the app code and think, "god, what an ugly piece of shit". Then you'll start the app all over again from scratch, using all those lightbulbs that went off in your head the first time around, making it much cleaner and more efficient.

You'll keep doing that until you have a solid understanding of how to write a complex app from start to finish. :)

EDIT: As for the second method you mentioned, I think it'd just be useless repetition. You're not challenging your mind any by re-typing already written code.
 


I agree with the poster above. It's like doing a math problem, if you just re-do the same one over and over by copying it, you'll never be able to sit down and do a different problem. But if you try doing the problem without looking at anything and logically solving it, referencing back only when you're completely stuck, you'll begin to understand how to solve it and will be able to move on to, and solve, different problems.
 
For the most part, I can now look at code and pick out the classes, the pointers, the objects, the methods, the arguments being passed, etc. but here is my main problem and maybe you guys can offer some help with this....

Although I can pick apart the code and name all of the different pieces and understand what role they play, I can only do this when I am given an example block of code like in a tutorial for example.
Good. Keep at it.




But when I sit down and try to think about how I would do an application on my own I get lost. I no longer have the step by step tutorial and don't have the example to go off of.
You are learning to think for yourself.



I feel like maybe I need to just say fuck it, ditch all of the tutorials and books, and just open xcode now that I know some basics and bang something simple out completely on my own.

Yes. Even a hello world app will teach you what is required to get a system running at it's most basic level. This is what frameworks, hooks, etc are for. They let you leverage the massive power ready for your use. It's up to you to then create your own system on top.




Maybe even something similar to a tutorial app I have completed, but only refer back to the tutorial when I am completely lost?

What do you guys think about that?

I'm also thinking about opening 2 xcode projects, one with a tutorial's completed source code and another one completely blank, putting them right next to each other on the screen and then just typing out the blocks of code from the finished version over and over and over again.

Do you guys think that would just be useless repetition, or do you think it will help create muscle memory?
Don't bother. This is not weightlifting.



I would really appreciate your opinions on the above 2 methods.

I'm at a point right now where I'm very frustrated, but not giving up. I am going to do this, but I also want to make sure I am utilizing my time wisely and employing the best learning strategy.
Learning to develop is mostly about learning to create a system in your head. The code is just the expression of the system. How does it fit together? What parts are critical to the actual obejctive, the key algorithm?

What parts exist simply to feed the machine, inititalize it? Some languages are very verbose here and you will spend lots of time looking at variable setups, declarations, library includes, class defs.

You are learning the iOS right now. Much of what you will learn will be specific to that platform and objC. C family languages are not exactly known for their ease of use for beginners - so dont get upset.

You might learn better like this - goal directed learning:

Set yourself a goal, very small and simple, but concrete on iOS. Something to read the user location, display it on the screen, and then post it to a webserver.

(The exact actions are irrelevant. What matters is that you pick a target and start thinking logically and systemaitcally. What libraries might you need to read the user location over GPS? How might you format it for display? How might you create a HTTP request to send it? How would you connect these things?)

Take this goal and think about how YOU will do it then. And fucking do it. I don't care if it's ugly. Or slow. Or has cruddy variable names. Do it. Make it work.

Many people employed as developers understand the target system or language decently. They can work with it. But they cannot move to something else. A good programmer can pick up a new language in about a week or two.

Why do you think this is?

Because the new language is just a tool they can use to implement what's in their head.

Right now you are learning 3 things: 1: the objc + ios combinations of libraries, system, and syntax. 2: learning how to think in order and algorithmically. and 3: basic development skills (variable naming, compiling, toolchain + project setup)

#2 is what you really want to learn if you want to become a good programmer.

#1 and #3 are just the necessary tactics to implement it.

Now go code a demo app that reads the user's GPS location and puts it on the screen, with some radio boxes to display it as either Degree Minute Seconds, or Decimal Degree. From this you will learn some iOS specifics: iOS location services, text display - some general programming utilities: UI callbacks, string manipulation - and some system thinking: hooking it together.

Good luck.
 
  • Like
Reactions: mpbiz
It depends a lot on your interests, and picking small enough projects early on that you can work through and build on, as well as interesting enough to keep you motivated.

For me I was always interested in games, so that was my focus and kept me interested.

Lots of trial and error, breaking things down to individual steps and working through the problems repeatedly (join an objc forum) until you rough out the features needed, then look for patterns, refactor code, then optimization.

But it helps to identify what you're most interested in.......and what you want to become good at....

If you want to make a game I'd throw you some models and guidance...probably blow your mind :) you have an iphone I take it?

Per your post I'd say open xcode and start simple.
 

Just start coding up your own projects, and turn to Google/stackoverflow every time you get stuck. Start super simple, and put the tutorials aside. At least, that's how I taught myself.

It's getting used to thinking in a certain way that's difficult at first. Eventually you'll find that you can just naturally map out how an application will work in your head before you write a line of code.

I agree about not doing the repetition stuff, too.

There's lots of basic challenges you can try here, which might help:
Sphere Online Judge (SPOJ) - Problems

(You can do them in whatever language you want). It might help a bit in terms of turning a non-coded problem into a coded solution.
 
ah yes, i had the exact same learning process as you mpbiz. could edit a few things in a sample app but when i created a new xcode project, i was lost.

so i followed the trail back, what exactly happens when an app starts on an iPhone?

first off, create a new empty iOS application. none of the quick starts that xcode offers. Your app is opened with 2 files, AppDelegate.h and AppDelegate.m. These follow the delegation software pattern. Software patterns are a way to organise code and they're kind of abstract but you need to understand them a bit. So have a *quick* read of this: Delegation pattern - Wikipedia, the free encyclopedia
If none of that clicks for you at the moment, it doesn't really matter.

in the 'supporting files' folder, there's a file called main.m
in here is your main function that all C programs start with which you probably heard in your C course. this is the start of your journey down the rabbithhole! So either follow this down in one of your sample apps or create a new hello world one.

Copied from Big Nerd Ranch Book
Open main.m in the project navigator. It looks like this:

Code:
int main(int argc, char *argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv,
                                 nil, NSStringFromClass([AppDelegate class]));
    }
}

The function UIApplicationMain creates an instance of a class called UIApplication. For every application, there is a single UIApplication instance. This object is responsible for maintaining the run loop. Once the application object is created, its run loop essentially becomes an infinite loop: the executing thread will never return to main.

Another thing the function UIApplicationMain does is create an instance of the class that will serve as the UIApplication’s delegate. Notice that the final argument to the UIApplicationMain function is an NSString that is the name of the delegate’s class. So, this function will create an instance of AppDelegate and set it as the delegate of the UIApplication object.

Right before the run loop begins accepting events, the application sends a message to its delegate saying, “Get ready because here we go!” This message is application:didFinishLaunchingWithOptions:.
So open up AppDelegate.m and you can see that xcode has auto created the didFinishLaunchingWithOptions implemenation. This is where most coders start their actual coding. you can see there's already code created that looks like this

Code:
- (BOOL)application:(UIApplication *)application
    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.

    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    return YES;
}

for an explantion of the auto-created code, read chapter 6 "Views and the View Hierarchy" of big nerd ranch book.

but for now, add an NSLog(@"hello wickedfire"); line just before the return YES;
Launch the app in the simulator and you should see the text in the xcode log in the bottom right.

that was pretty fucking complicated for a simple hello world eh?! and it's even more complicated if you wanted that string on the actual iphone screen, you'd have to add a UILabel view. as dantax said, you're learning so much new shit for iOS. it's going to take a while. you need to know a lot of C and Objective C, and then get an overview of the design pattersn that Apple use like Delegation and MVC and View Controllers. then how to use xcode and the Interface Builder. and you're going to get some shock when it's time to submit your app and you run into Provisioning Profiles! iOS is pretty fucking hard so stick with it.

maybe you could do dantax's GPS app next or get the basics of your photo sending one going, though that might be a stretch too far at this point.
 
But when I sit down and try to think about how I would do an application on my own I get lost. I no longer have the step by step tutorial and don't have the example to go off of.

I feel like maybe I need to just say fuck it, ditch all of the tutorials and books, and just open xcode now that I know some basics and bang something simple out completely on my own.

Maybe even something similar to a tutorial app I have completed, but only refer back to the tutorial when I am completely lost?

I'm glad you arrived at this point because it happens to be the only way to learn programming.

-- You have to write code that you've thought of on your own. Instead of reading a tutorial and then doing it, you need to set off on your own trajectory with your naive limited knowledge. That's the only way you ever get an a-ha moment when you read the tutorial and go "A-ha, it makes much more sense to do it that way".

All the intuition in programming is locked away in these little morsels that can only be unlocked by experiencing the delta between your shitty approach and a better approach and when you find or engineer an even better approach and when the rubber finally hits the road and you realize your better engineered approach was in fact shit.

So far it sounds like you've done a random walk across the graph of knowledge. And that high level overview will help you articulate your questions and your google-fu when you get stumped.

Now it's time to build things on your own.

I would stop passively consuming tutorials. Only use resources as a reference if they apply directly to the current challenge you're trying to solve right now in your own code.

When you're trying to build something, always aim for the next rung on the monkeybars. The key to programming is that the distance between any two rungs can be decomposed into many more rungs that are easier to iteratively reach.

----

My first personal webdev project was to build a forum. I like forums and always wanted to build my own.

I certainly didn't know how to go from [No Forum] to [Completed Forum]. My programming language didn't have a `(construct-forum)` function.

But I did know that I would need to have a database that at least stored Posts. I never worked with a database before, but I knew enough HTML to create a textarea with a "Create Post" button.

That was the first iteration of my forum: a page with a textarea and a button. Nothing even happened when you clicked the button. But it turns out that "How to create a database" and "How to insert into a database" were easy concepts to google for. I had actionable knowledge within 15 minutes.

After reading some StackOverflow answers, I created my first database table: "posts". It had a single column I named "text". Within the hour, my "Create Post" button added the textarea contents to the database and the page would refresh with <ul> list of all the posts in the database.

But posts need to belong to a topic. I created a "topics" table and learned about foreign keys in databases to represent my "one topic has many posts" relationship. I updated my "posts" table so that it had two columns: "text" and "topic_id".

Now I could loop through all the topics in the database and display all posts where "topic.id == post.topic_id". And from there I created a "users" table and incrementally built up a full featured forum.

----

As you swing from rung to rung, you'll find that many of the rungs involve the same thing and you begin to skip rungs out of experience and familiarity. Over time, you begin to skip more and more rungs because you've already built those things.

Before I put this analogy out of its misery, let me say that watching the other kids swing on the monkeybars doesn't really help until you've struggled on a specific rung and want to see how someone else approaches it.

----

Finally, iOS development is quite the frontier for any developer.

It's far more than just having to grapple with Objective-C. You have to credentialize in a menagerie of frameworks, each with its own idiosyncrasies.

From my experience, burnout happens when you're swinging between too many rungs without ever really reaching the rungs that will advance your goals and purpose. You can ward it off by ensuring that you're actually trying to build something. -- In other words, you don't usually get burned out when you're making progress in some way.

I couldn't find your reasons for focusing on iOS development, but if you find yourself getting entrenched in a state of frustration and burn-out, consider another route like web development. There are simply fewer moving parts, and depending on your iOS goals, you may be able to implement your iOS app ideas as a webapp or lean on kits like PhoneGap | Home, Titanium Mobile Application Development | Appcelerator Inc., or similar.
 
  • Like
Reactions: Paper_Chase
Well, I'm right there with all you learning guys now. Going through Qt for the first time, developing a nice desktop app. Forgot about the learning curve -- 20 tabs open, with examples, manuals, and forums open everywhere. It's actually quite fun though, and I enjoy it.

Qt isn't as bad as I thought it'd be anyway, after reading some initial reviews of it. It's actually quite straight forward. Plus I know this is what's used to develop things like Skype and Google Earth, so I find that quite cool too.

But yeah, I forgot about screwing around for like 2 hours just to accomplish the simplest thing. Good stuff.
 
I feel like maybe I need to just say fuck it, ditch all of the tutorials and books, and just open xcode now that I know some basics and bang something simple out completely on my own.

What everyone else said - this is by far the best way to do it. Come up with an app idea that is simple in concept but incorporates most major facets to a good app.

I chose a Workout Tracker for my first iOS project (still in progress, just started learning everything 3 weeks ago). This would be an app that allows me to create workouts (persistent data), log sets/reps (databases), report progress (graphing), track runs (GPS), share workouts (social), etc.

At first I was like "Ok now WTF do I start with?"...start with 1 individual piece of the puzzle. I knew that to make a custom workout, I'd need a list of exercises to select from. So the first View Controller allowed me to display a preloaded list of exercises sectioned by bodypart, add custom exercises, delete exercises, and select exercises that are then added to an array that I'd use in the future. That simple VC taught me data persistence, arrays, segues, UI elements, and a lot more...was at least 40 hours of work.

1. Start with a single piece of your app
2. Draw the UI in Storyboard
3. Figure out what kind of method you need to accomplish the task
4. StackOverflow whenever you run into problems...virtually all beginner questions are answered there
5. Repeat
6. Poof you have an app 2-3 months later starting with 0 knowledge
 
You are misinformed. Please go learn about Dependency Injection and Separation of Concerns and then come back, look at your post and apologize for making the world a dumber place.

I just got sent some of your code. Where to begin? Oh yeah, no error checking.
 
Bump.

First off, I would like to say thank you to everyone that responded to my most recent post, both in this thread and via PM.

Funny thing is most of you gave the same advice, just with varying amounts of detail and your own spin. Your advice is greatly appreciated and I can't thank you guys enough for sending me in the right direction.

To be completely honest my brain is fried right now from all of this time spent in xcode but I couldn't be happier.

I ended up just going with Dantex's idea.

I got to work right away and I'm guessing I've spent probably 13-15 hours since then creating an app from scratch. It took me 7 hours just to create the very first version, and since then I have been using the rest of the time to ask some theory questions on stackoverflow about why things are a certain way, and also been adding on slowly to the app.

During this process I've had a ton of lightbulbs go off and now I understand why the only way to code is to just sit down and code. There's just something special about banging your head against the wall and digging through references and documentation just to solve one single problem.

Aside from all of my lightbulbs, I had 2 major "aha" moments. The first is that I now think that one of the most important things you need to learn as a programmer, at least for me, is how to properly navigate and read your language's documentation. I think I learned more digging though pages and pages of xcode documentation than I did from all of those tutorials combined.

The second is that you need to break everything down into mini tasks. I was trying to visualize things in my head as big chunks, but you need to look at every single little thing that is involved in your app running successfully and just take it slow.

There were times where I couldn't understand one little concept, but when I read on about other classes and methods that are meant to work in unison with the confusing concept, all of the sudden everything clicked and the concept made sense.

It can all seem confusing, but really it's just hundreds or thousands of little pieces all working with each other. Looking at it that way makes it a lot easier.

One final thing I noticed, is that I am beginning to think like the a programmer after all of this. To be specific, I find myself looking at the xcode documentation differently then I was before doing this. You really do just need to put in the grunt work and crawl through the barbed wire to get to the other end.

Well, that's pretty much it. There's really only one other thing I wanted to get everyone's opinion on.

I think I already know the answer to this, but let's see what you guys think. At this point, I cannot look at all of my code and remember why it had to be a certain way, or understand all of the theory behind it.

Don't get me wrong, I've had a million lightbulbs go off just by creating this first app but it is kind of bugging me that I haven't been able to retain 100% of the information that I have been sifting through during the process.

I am guessing that this is normal at this stage?
 
Not only do I not hate not being a programmer...

nofucksgiven.jpg
 
My efficiency improvement resolution for 2014:

- more up-front thought and design
- less trial and error

(Trial and error can be fun and a learning experience, but it sure does cost a lot of time).
 
I've been programming since I was 12, I used to love it so I would do it all of the time. Now I moderately enjoy it, more so because it's easy and challenges are pretty rare. My new real passion is guitar.
I define a passion as something you can do without being determined, without being disciplined. An overall joy that just attracts you to it without having to schedule or force yourself to do it.

I work at a Datacenter, and a co-worker had told me a great logical method he uses to program or even learn other languages:

Find out exactly what you want to do. Write it into a detailed paragraph. Now separate each of the sentences into specific lines, which will later become comments in your code. Since you have how it should work, it should be easy enough for you to Google and find out concepts on how to get what you're doing done. Example:
Have a client sided SWF communicate with server sided database or storage device:
If you were wanting to learn PHP/SQL and some Flex/actionscript than you would search "how to send server requests with flex" (assuming you know the basics to creating and compiling a flex project).

You would then search "how to store information to mysql with php".

After learning the basic syntax, and a couple of languages; you'll find that most languages are conceptually the same. It's all just logical patterns.


When I was 16, I created a chatbot with multiple instances for spamming (yeah, I was pretty unethical back then..). I barely knew the language I was coding it in (cpp), but found a few sources similar to what I was doing to get an idea of what I wanted to do. It took a lot of debugging (mostly just googling errors and warning from failcoding). I later developed it to run on multiple threads (eventually up to 100 -- which my proxy provider even said was too much for him to handle when I was paying $500/week for 2k proxies or something crazy like that). I later developed it to find and check proxies on the internet, and use those as an alternative. This required more resources so I had to lower the threads, but my buddy stopped whining at me about his SENuke proxy customers crying about how slow they were, and I was saving $500/week).

Of-course I don't expect you to actually develop a spamming tool. This was just an example how you can start small, and eventually dominate your ability to not only program in that language, but make great potential from your application.

However, when it comes to client-facing applications, it's good to get a more in-depth understanding (wisdom) to avoid potential security hazards.
 
  • Like
Reactions: mpbiz