0

Web Services with Cocoa Surprise

 2 years ago
source link: https://soffes.blog/web-services-with-cocoa-surprise
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Web Services with Cocoa Surprise — Hi, I’m Sam

Web Services with Cocoa Surprise — Hi, I’m Sam

Hi, I’m Sam

This is my blog. I also have a website thing.

Web Services with Cocoa Surprise

Posted on June 15, 2009

This week I have a talk at the first Oklahoma City CocoaHeads meeting. I was going to talk about transferring data from web services with plists. I spend most of the day working on SSConnection, my simple Foundation class for easily transferring plist data from a web service to a Cocoa application.

I was so into plists because at the Austin iPhone Tech talk I attended, they encouraged you to transfer data in plists because it had native parsing. I have to admit the native parsing is quite awesome. One method and everything is all parsed and ready.

I was using JSON (javascript object notation) to transfer everything with the JSON Framework. I had started switching everything to use plists. I spend a ton of time writing a PHP class to convert arrays to and from plist strings.

When I was preparing for my talk I decided to do some benchmarks to show how much more awesome plists were than JSON. The plist version was about 8 times faster than my JSON Framework version. I was pretty happy with that result. My friend, Jake, said he was using TouchJSON to parse JSON in his apps, so I figured I'd go ahead and benchmark that one too. I was expecting JSON Framework to beat it because the interface to the JSON Framework is a lot simpler than the interface to TouchJSON.

What I found was very surprising. TouchJSON actually beat plists. It was slightly faster in every test I ran. This is awesome because plists have a much larger file size. They are usually about twice as big as JSON files due to all of the extra markup.

I am keeping everything using JSON now instead of switching to plist. JSON will transfer twice as fast and parse faster than plists do. Awesome.

Sorry to everyone I preached plists to. I assumed Apple would be correct. They were not.

Update 10/29/09: Several people have suggested using binary plists instead, as they are actually much smaller than XML. I chose the XML style ones because they were much easier to manipulate. Hopefully there is an implementation of plutil -convert for Ruby out there.

Why I Do Not Profit Share

Posted on June 6, 2009

As a freelancer, I get a lot of people pitch me ideas they want me to work on. On average, I get one of these ideas pitched to me every two days. This is great. I am always looking for something to work on.

Almost all of these app ideas are iPhone apps. I welcome iPhone work as I absolutely love the platform. Now that I'm doing iPhone work, I've had clients want to profit share with me instead of paying upfront. They have an idea they probably spent a few hours on and they want me to work on it for weeks and then share all of the profit with me. There are several reasons why I do not do this, ever.

  1. I am fully capable of coming up with my own ideas and then getting all of the money. Why would I work on the customer's idea that I'm less passionate about and get half of the money?

  2. If the customer really believed in their idea, they should take out a business loan and pay me the small amount of money compared to what they will make if their ideas is as good as they think it is.

  3. It is a bad idea for the customer because I will be way less motivated to work on something with future compensation that I may never receive.

Continue reading →

© 2006-2022 Sam Soffes


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK