Cocoa Camp 2013 Code Sample first impressions

The application for Cocoa Camp requires you to create a currency conversion app for the iPhone. The only requirements are that the app compiles and that it converts one currency to another. Beyond that, you can make it as complex or simple as you like/can deal with.

I would like to extract the data in real time rather than hard code it in. Once you figure out how to extract the data, it isn’t that hard to scale it to more than one currency. I am currently planning to have ten different currencies.

I also plan to display the flags associated with each currency and to make the text green if the conversion is higher and make it red if it is lower.

So this project has a few moving pieces. I need to create a picker menu with the currencies I am planning to offer conversion for. I need to extract the data and apply it to my output. I need to use the data to determine what flags I output.

There is a big piece of information that is used by all parts of my app, and that is the exchange rate information. I need to take the countries selected by the picker, send them to the place to get the rate, return it, then send it to an output for the rate. I also need to send the county info to the output for the flags.

I will probably create a diagram charting this out.

I also want to get this done soon, like within the next week. The application is not due until April, but I don’t want to spend a month on this. I contacted Apple about this program before the information was released and they sent me the information about it. So someone there knows that I have known about the camp since the data was released.

I don’t want to half-ass this, but I do have very clear goals that I want the app to accomplish and how I want it to work. I believe the goals I have created for this app are attainable in the amount of time I have given myself. If I get stuck I have a few people I can talk to for advice about what to do.

I am not going to get into any details about exactly how I accomplished this on my blog until after the deadline. I highly doubt anyone who will be applying to this along with me even reads my blog, but it’s better to be safe than sorry.

I created my stub project. I included most of the classes I believe I will need. I have already started this once when I decided to come at it from a different angle. I have the old version of the project in another folder. Tonight I am going to review the different pieces that I need to use so that I can build everything once instead of putting things in the wrong places and wondering why my code doesn’t work.

I hope this will be enough. I can’t think of a way to make this more complex without creating app bloat. I am hoping that most people won’t do this much, or if they do that I did it better!

Slight Existential Crisis

I began a Safari Books Online subscription at the beginning of this semester. At the time I began, there were two tiers: 10 books a month or unlimited.

I took the 10 books a month because it was substantially cheaper and I didn’t think it was possible to need more than ten programming books a month. I decided to do this specifically because I bought some Objective-C books a few years ago and this language changes so rapidly that there seems no reason to own a paper copy of the book. Once it is a year old, it is worthless and can’t be used or resold.

I only had this subscription for a week before it became oppressive. I am learning both iOS and Java. There are so many resources out there for both of these that I wanted to know more! I wanted to learn about Data Structures and Test Driven Design and OpenGL. There was so much to do and so much information! How can I confine myself to just ten books?!

Well, recently my husband started a business and I can now have my unlimited access. My mind is sponging with all the information out there. Python! Ruby! C! Core Audio! Photoshop! Logic Synthesizers!

I realize I can’t know everything. I can’t read all that there is and even if I could, it will all change in a few months anyway.

It is extremely frustrating to know that there is all this beautiful information out there in the world and with my limited human lifespan I can only absorb a fraction of it. Life is too short!

I wish I were Jamie Maddrox from the X-Men comic book universe. His mutant power is the ability to split himself into hundreds of different instances and to be able to go out and live a hundred lives and then combine to one shared experience.

I don’t know if this is exciting or if it is a punishment from God. Either way…

Cocoa Camp 2013

Every year Apple does a summer camp for programming students in Cupertino. The last few years Madison College has had several students who have gone.

They just released the application to us yesterday. We are required to send a resume, a letter explaining why we should be considered, and a coding sample. We have to program a currency converter that must work on either a simulator or an iOS device.

I am in a conundrum. I have a (slightly) late Java project to work on and I have some iOS homework to complete, but the challenge put forth by the Apple people is more interesting to me. Maybe it’s just interesting because it is new and shiny.

I have a month to complete the challenge and submit it to Apple. I will try to work on my other stuff for a while, but I might come back to working on this. I want it to be awesome.

Thinking About the Future

Recently I have been talking to people/reading about how to get a programming job after you complete school. One guy who was talking about trying to find a Java developer said that a lot of people only had class coding assignments to show at an interview and that doesn’t really cut it.

The thought of doing more work outside of class to make code I haven’t learned yet is a little discouraging!

There are some ways of getting code out there. You can contribute to open source projects, put code on GitHub, write an app that will go on the App store, etc…

Right now I am inclined to try to write an app. I am slightly uncertain about how to contribute to an open source project. If anyone has advice it would be greatly appreciated!

Also still trying to wrap my head around what GitHub is. I have a very basic understanding of what it is and why it would be useful to other people, but need to figure out how I can utilize it.

I would really like to be able to write an audio app utilizing Core Audio. I have the Core Audio book by Chris Adamson and I get to see him in less than two weeks talking about Core Audio. I am not sure if I should try to plow through his book before seeing him or if I should wait. I am thinking I should try to make some headway into the book so that I can ask intelligent questions or at least have a base of understanding of what he is saying.

Right now just ruminating about what I need to do to prepare for the future. I know I need an internship. I have applied for a few, but I guess it is still pretty early. I haven’t heard anything back. It’s understandable that no one wants to think about this at this point in time.

The person hiring did say that an internship is helpful because it gives you some experience that you can put forward as a coding job.

I don’t understand why every company wants someone with two years of experience. How do you get two years of experience if you can’t get an entry level job? If it is so hard to find programmers then why would you turn away a person who has student experience and not professional because no one will hire you due to a Catch-22?

Hopefully all will become clear in time!

Where’s the Click?

Okay, I have pinpointed my source of confusion in completing the Rectangle project for iOS class.

If this assignment were slightly different, if instead of having the triggering event be a shake but a button click, I would be able to conceptualize this. When you create a button object, you can create a method called IBAction to do something when the button is clicked. So I would create a method that instantiates a rectangle with random parameters to be triggered when the IBAction gets called when the button is clicked.

So where is the click? I know that the phone registering that is being shaken is also an action, but as of this moment I am not aware of there being a specific method that is called when this event is triggered. I think there are a series of methods that get called, but when I look at them I feel like I don’t understand what it is that they are doing precisely.

So I have isolated the source of my confusion. Now I need to switch mental gears and work on my Java project.

Onward and upward.

Randall P. McMurphy

95% of Nothing is Still Nothing

[the inmates are playing cards and betting with cigarettes]
Martini: [rips a cigarette in half] I bet a nickel.
McMurphy: Dime’s the limit, Martini.
Martini: I bet a dime.
[Puts the two halves onto the table]
McMurphy: This is not a dime, Martini. This is a dime.
[shows a whole cigarette]
McMurphy: If you break it in half, you don’t get two nickels, you get shit. Try and smoke it. You understand?
Martini: Yes.
McMurphy: You don’t understand.

Ahh, those magic words that are the saving grace of most students: Partial Credit. You tried. You got most of what you were supposed to understand. We give you a consolation prize. Better luck next time!

That does not work for programming an application. Nintey-five percent of an application does not give you an application, it gives you a bunch of weird looking text.

An application either works or it doesn’t. It is boolean. It is either YES or NO.

That is a hard thing to process when you are a student. You are used to getting a C if you just show up a few times a semester. Most coding teachers will give you some credit for trying, but you know in your soul that if you don’t get your program to work, you don’t get most of a program, you get shit.

Atlas not shrugging

Brain Spongenitis

I will complete my two year programming degree in three years. I began pretty strong because I already have a bachelor’s degree and I didn’t need to take some of the prerequisites, so even though I was going part time I was still on track to graduate in two years.

I was working part time for the first year, but then transitioned to full time the second year and had to take night classes. This, paired with the increased difficulty of the third semester classes, completely killed me. I took an unofficial semester off by only taking one class but then dropping it.

I was at a crossroads. I really wanted to finish school, but I was going back in order to get a better job and the job I had at the time paid about what I wanted to be making and I thought it was stupid to kill myself trying to do both and equally stupid to quit a job when that was why I was going to school!

Well, the universe made a decision for me and I was laid off from my job. I spent some time trying to find a new one, but it dawned on me that this was the golden opportunity I required to go back and finish school.

Fortunately, I only had 5-6 classes I needed to take! Unfortunately, they were all of my programming language classes and three of them needed to be taken in different semesters.

So I only had one or two classes each semester that I needed to take. I thought I would have this utopian academic period of a year and a half where I could dedicate myself to doing all these projects I never got around to working on and learning all these things I wanted to know better, like shell scripting and regular expressions. I had all this time!

Things did not work out that way.

There is a reason my programming classes kept getting dropped when I got overwhelmed. They are HARD!

Right now I am learning Java and iOS Development. I am spending dozens of hours outside the classroom just trying to absorb the information we are having thrown at us. I used to do Pub Trivia on Monday nights with a group and I haven’t done so once this semester because I am overwhelmed by my studies.

I feel like my brain is a saturated sponge and I am trying to coax more liquid into it without having to squeeze out stuff that is already there!

Part of me wonders if I would still be this overwhelmed if I was still working, that I am making my work take up all of my free time and if I had less free time I would still do the same amount of work.

I just know it feels very disappointing to know I am supposedly doing so little, but it feels so overwhelming.

Blind Faith in Programming

Okay, so one of the hardest things I have had to deal with in programming is determining what I need to question or what simply is.

If you create a new Java project, you will see a method called “public static void main(String[] args)”. The first time I saw that, I was like, “What the hell is that?” My background prior to this was doing PHP and JavaScript and neither of them has this funky code that has to be there. For PHP, you just type the PHP script declaration and you’re all set. Why do you need this weird group of words to make a project work?

So you just kind of take on faith that there is a reason for it. You know if you don’t put this in your project the compiler yells at you until you do it, so you just learn to regurgitate it any time you are asked to start a new project.

There is a lot of similar things in Objective-C. The main method has autoreleasepool. What does that mean?? It makes no sense!

I did find out later after reading an Objective-C book from 2010 that it used to have an object called NSPool, which had a method called “drain pool”. Well now THAT explains a lot!

Does knowing this make me a better coder? I don’t know. I am inclined to think not, but it is possible that trying to understand why rather than just accepting will eventually mean something.

A better example of asking why came later. I knew from looking at the documentation for an object that it had a certain method, but I could not get it to show up in Xcode. So I went to the teacher and asked what about the documentation I did not understand. He told me to call the method and I was confused. I call a method by typing some stuff into the IDE and it shows up or it doesn’t. If it doesn’t then I don’t know what is going on. He said to call a method you need to use the straight braces “[]”.

I was floored. I knew that you use the straight braces in Objective-C, but I never processed why. I was like, “I use them because that is how they do it”. I never thought about what “it” even was. I got used to just kind of not understanding why I was doing something but doing it anyway because that is what I needed to do to make the program run. This was an epiphany that you call a method by using the braces. Everything I am doing makes so much more sense now.

Part of you may wonder why I would just passively regurgitate code without knowing why. The problem is that learning coding is so overwhelming that you need coping mechanisms in your brain to process anything because if you don’t you become paralyzed by things that are trivial. It is difficult to differentiate what is important and what isn’t when everything looks like an alien language.

I just feel I need to have faith that anything that is important will eventually reveal itself to me when I am ready to process it!

Red Queen's Race

Welcome to the Red Queen Coder

This past weekend I went to my first professional programming conference. It was Snow*Mobile 2013 in Madison, WI. I have been studying programming for the last few years, but this was my first opportunity to rub elbows with the people who will be a part of my professional community.

Besides learning about programming techniques, I also learned quite a bit about how the online community for programmers works. I learned the power of Twitter and GitHub. I also figured out I should create a blog.

I have tried doing them in the past, but I was never sure about what it would be about or why anyone would read it!

I now know that I am going to write about my learning process for becoming a programmer.

I am 31 years old. The first line of real code I ever wrote was in 2008. It was in Perl and it was the obligatory “Hello World!” program. This wasn’t the program that got me hooked on programming, it was a program that created an array and printed out each element of the array. It did not work immediately and I had to look through the code several times to figure out why it didn’t work.

When I finally got it to work I felt this awesome rush. I did it! I made it work! I tamed the beast and bent it to my will! I am a god!

I was hooked.

I am sure anyone reading this blog has had this same experience. Many of you probably had it at a younger age than I did. I was 27 when I discovered programming. I don’t know if this would still be as hard if I tried to learn it younger or if it would be this hard no matter what.

So this is a document about my journey through programming. I probably won’t provide any insight to experienced programmers about how to code, but I hope to give some insight into the types of struggles that exist for someone learning this for the first time and trying to find their place in this crazy, wonderful world.

The name of my blog comes from Alice Through the Looking Glass. The characters in this book are based on chess pieces, and the Red Queen is the non-White queen on this particular chess board. Alice sees the Red Queen running as fast as she possibly can. Alice asks where she is trying to get to by running so fast, and she says that she is simply trying to stay in one place, that if she stops running she will fall behind.

I feel this is an apt analogy for anyone trying to learn Objective-C. The language changes so fast that you have to learn as fast as you can just to keep up with the changes!

So welcome to The Red Queen Coder. Enjoy!