PrEV
Thoughts from a NeXTStep Guy on Cocoa Development

All the C you need to know?

Feb 27, 2012 by Bill Dudney

What do you find confusing about the C part of Objective-C?

As I'm preparing for the class I'm teaching with Daniel, I keep thinking about all the C stuff that I see people struggling with. I'd love to be able to do a mind meld and transfer a grok of C, but unfortunately it doesn't work that way.

And besides you don't really have to know C to be a competent iOS/Mac developer. For the most part you work in objects from UIKit, AppKit and Foundation. Only every once in a while do the quirks of C come up.

For example, you have to pass an NSError ** to methods that return an error. You don't really have to understand that C is "pass by copy" to use the pattern:

NSError *err = nil;
NSString *stuff = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:&err];

You must pass the address of err to change the value of err in the current scope. You can build and deliver apps not understanding why. You just do what works and go on with solving real problems. After all we have to stay calm and ship apps.

But if you are like me, you can only do that for so long before it starts to make you nuts that you don't really understand it!

In the current edition of our book Chris does a great job of going over the stuff you need to know about C to become a proficient iOS developer. But iOS proficiency is the goal. We did not have the space to dig into the details of how pointers work or what "pass by copy" really means.

In addition to preparing for the studio, I've also been doing some web programming with HTML5 (HTML, CSS3 and JavaScript). I'm on that side of the divide where I'm 'copy and paste programming'. I see something on a blog, copy and paste it into my document, and only marginally understand it. But it works so I go on with solving the actual problem instead of taking the time to really 'get it'. I know exactly how it feels to be in that spot, and I hate it! :)

Which brings me to the point of this post. What do you find confusing or not understand with the C part of Objective-C?

Here is a list of topics I know I want to address:

  • pointers
  • function call semantics
  • extended types, struct, typedef, enum and #define
  • ObjC Strings with @"" vs C Strings with ""
  • dynamic memory & malloc/free
  • Core Foundation

Some of those items are abstractions of real world problems I've seen people struggle with, but I'm sure there are lots of others. Please send me an email with what you've struggled with and I'll do my best to address that as well.

If you are coming to ObjC from a scripting language, Scott Stevenson has a great tutorial on several C concepts that you might find useful... Very good stuff.

Permalink     6 Comments - Add Yours

Foretelling the iPhone

Aug 19, 2009 by Bill Dudney

I am currently reading The Design of Everyday Things. It is a great book, although it has often made me angry at the designers of doors and stove tops :)

In the section about memory Norman discusses the importance of reminders. There is some clever stuff in this chapter. He makes this statement.

Would you like a pocket-size device that reminded you of each appointment and daily event? I would. I am waiting for the day when portable computers become small enough that I can keep one with me at all times. I will definitely put all my reminding burdens upon it. It has to be small. It has to be convenient to use. And it has to be relatively powerful, at least by today's standards. It has to have a full, standard typewriter keyboard and a reasonably large display. It needs good graphics, because that makes a tremendous difference in usability, and a lot of memory - a huge amount, actually. And it should be easy to hook up to the telephone; I need to connect it to my home and laboratory computers. Of course, it should be relatively inexpensive.

I read that and thought wow this guy new the iPhone back in 1988 (first edition of the book). But, instead of having to hook it up to the phone, it is the phone.

Permalink     2 Comments - Add Yours

Life...

Apr 03, 2009 by Bill Dudney

I have been so busy lately, its all been good but man what a crazy 3 or 4 weeks.

Right now I'm in the UK (some pics) getting ready for the NSConference put on by the great folks over at Mac Developer Network. I can't wait for the conference, its going to be a blast. But since I was coming all the way to the UK we figured that we should bring the whole family and make a trip of it. So everyone is here, we got cheap tickets by coming over on March 31 (2 weeks before the conference started). So now I'm running around doing all sorts of fun tourist stuff, nearly dying because of driving on the 'wrong' side of the road etc. We are finally starting to adjust to the time zone, but its gradual kids don't much get going to bed at what to their body is 1PM... It has been great fun so far though!

The week before this trip started I was at the Philly Emerging Technologies conference giving an 'Intro to iPhone Dev' talk. It was a blast and I meet some really smart folks there. Chariot and the other sponsors put on quite a show.

The week before that I was in Reston VA teaching the iPhone Studio. This was the first public class on the East Coast of the US and we had a great time. It was my first time back there in quite a while so it was great to catch up with some old friends.

The there was also the iPhone 3.0 beta, which is very exciting indeed but has caused me to go back over all my stuff for the iPhone Book. I am just about done with the 2.x tech review comments so I'll be starting in earnest on 3.0 work early next week.

Crazy but extremely fun times, if I am a bit quite here now you know why. In the mean time you can follow me on twitter.

Permalink     2 Comments - Add Yours

Illustrator Work

Mar 25, 2009 by Bill Dudney

Well I'm not happy with the colors but I am starting to feel comfortable with some of Illustrator after following through on my resolution

I basically followed this tutorial from Layers Magazine.

I'm not very good yet but its fun to try :)

Permalink     1 Comment - Add Yours

Wonderful

Jan 02, 2009 by Bill Dudney

I found this from Matthew's blog. Seriously worth the 25 minutes, watch it to the end. Inspiring on so many levels. That is how I want to teach people about the iPhone. But the content is so much more than a lesson on how to speak in public. The content is amazing, please take the time to watch and listen. How much cooler would your iPhone app be if you had the face of the smiling person taped on your monitor?

Live in possibility!


@ Yahoo! Video
Permalink     4 Comments - Add Yours

Mac Developer Roundtable

Dec 10, 2008 by Bill Dudney

Scotty over at Mac Dev Net was kind enough to include me in the latest episode of The Back Developer Roundtable in which we discuss the iPhone SDK.

Permalink     Add A Comment

Colorado Software Summit

Oct 15, 2008 by Bill Dudney

Well its less than a week to Colorado Software Summit and the line up (as usual) looks great. I'm going to make sure to make it to the Android talks so I can try to do a bit of compare and contrast between iPhone and Android. Should be a great time and I'm really looking forward to it, hope to see you there!

Permalink     Add A Comment

Speaking - The Evil's of Slides...

Oct 06, 2008 by Bill Dudney

I'm on a mission recently to make better presentations. Probably entirely self serving cause I'm in the midst of tons of prep work for upcoming speaking engagements.

That is a lot of slides...

A long time ago (about the time of Virtuas) I found a little gem on the net called Attention Spam which I found amazingly wonderful at helping me put into practice what I had been thinking about but was not quite able to do or articulate.

Then today I ran into this post over on Seth Godin's blog. And it got me thinking about it again so I figured I'd post on my blog about it since I was running on in twitter.

All public speaking is about selling something, if you are speaking you are selling. So if you are going to speak make sure to tell people up front what you are selling (not to repeat too much of what Seth Godin wrote). Even in the case of training. When I am teaching iPhone or Cocoa development I'm selling you on how cool the topic is. Why in the world do you care about Core Data or Tab Bar Controllers anyway. If I don't sell you on why they are cool and worth learning then you will be struggling to stay awake during my incessant babbling. If on the other hand I convince you that knowing Tab Bar Controllers will make your life 10 times easier then you are going to be paying attention. All public speaking is selling.

I work hard to make my preso's hard to sleep through (of course some times I fail, but I almost never throw things at the snorers :). I hope to see you at one of my talks in the not too distant future.

Permalink     Add A Comment

Wrong Programming

Jul 08, 2008 by Bill Dudney

This image just makes me laugh.

Permalink     3 Comments - Add Yours

NeXT Slab - free to a good home...

Jul 03, 2008 by Bill Dudney

I sadly am ready to part with my original NeXT computer. Its a slab with 8MB of RAM, 500MB disk, printer, original boxes and books. It boots and comes with the NeXT CD's it shipped with. I also have 3.3 CD's and floppies to boot and install OpenStep. All yours for the incredibly low prices of $0.

If you pay shipping from 80424 it's yours.

Permalink     5 Comments - Add Yours

Friends on the iPhone

May 27, 2008 by Bill Dudney

A good friend of mine just launched his iPhone games to the public.

Go check his stuff out on the FlipSide5 website.

I'm following hard on your footsteps Mike, can't wait to announce my own :)

Permalink     Add A Comment

What a week...

May 16, 2008 by Bill Dudney

My server got hacked or a DNS entry go hosed somewhere but starting about Wednesday my little mini that could started processing between 600 and 1000 hits a second. Looking for adverts. What is really strange is that my Apache instance was returning 200 instead of 404. I asked around and several people told me I needed to reformat and rebuild the server. So I shut down on Wednesday night around 5:00pm and rebuilt on Thursday. After rebuilding everything I turned the web service back on (i.e. started apache) and what do you know my hit count shot up to 300 to 600 hits a second. Arg..

So then I stared looking elsewhere for the issue and thanks to my responsive hosting provider I got switched to a new IP. Everything went back to normal. So it looks to me (though I'm no expert) like DNS was hosed somewhere which was routing those request to me. What I never understood was why was apache (after a fresh reformat, reinstall) responding with a 200 for URL's that clearly did not belong to my server. If anyone has any ideas I'd love to hear them.

So almost everything is back to normal now. There are still problems with mail but I hope to get that sorted out shortly.

Permalink     1 Comment - Add Yours

Colorado Software Summit - iPhone talks accepted!

Apr 15, 2008 by Bill Dudney

I've been speaking at CSS for five years now (I can hardly believe that!). And I'm totally stoked to say that I'm going to get to again this year. Its going to be a slight change of topic for me though (and part of why I'm so excited).

This year I'll be talking about iPhone development instead of Java stuff, I'm really looking forward to it. Here are the two topics/abstracts that were accepted.

Core Animation on the iPhone

Core Animation is what gives the iPhone its distinctive and amazingly beautiful animated user interface. This session will focus on getting you up to speed on how animation on the iPhone works and how you can take advantage of it in your own applications. We will cover the various animation types and how to control their timing. You will also learn how to make animations that look and act like the would in the real world. The iPhone is an amazingly exciting platform and Core Animation is one of the technologies that make it what it is, come to this session and learn how to build applications that take advantage of this really exciting technology.

Building Location Aware Apps on iPhone

Ever get out of the cab and know there must be a Starbucks within 2 blocks of where you are standing but not sure which direction to go to get there? Well with the location aware API built into the iPhone you can find not only where you are but what direction you need to go to get where you need to be. In this session we will cover the API's that make these kinds of applications possible. We will also go over the best practices of how to make your application a good citizen on the iPhone when using the location API's.

I can't wait and I really hope to meet many an iPhone hacker at there!

Permalink     5 Comments - Add Yours

Brainwashed into acting ordinary?

Mar 20, 2008 by Bill Dudney

I just found this on Seth Godin's blog. If you have not read it you should (both this entry and his blog in general).

So many people don't get it. Do something, do your best, put it out there, get criticized, suck it up, do better, don't give up. As Churchill said 'Success is not final, failure is not fatal: it is the courage to continue that counts'. This is one of my favorite things about the mac indie community. People dare great things.

WWDC 2007 I went to the indie talk that Scott Stevenson put together and blogged about it here. It was packed with people daring great things.

Going back to Seth's post, he says have a great project, a blog, a reputation whatever. He is talking about daring great things, risking something, going public. This as much a reminder to me as it is a pleading with others. Dare great things. Go for it, just do it. If you don't ever step out on a limb and risk then you will not ever achieve great things.

If you have not watched this;

You should.

Make something outstanding, stop acting ordinary.

Permalink     Add A Comment

Subversion on Leopard Server

Feb 27, 2008 by Bill Dudney

I should probably have a category for this stuff for those that don't care...

As I blogged a couple of days ago I finally got my new mini out the door and setup. I waited to turn on the firewall because I wanted to make sure I could remotely administer the box before turning on the firewall to minimize the moving parts. So once it got connected on Monday I spent some time messing with it and was sure I had everything running and turned on the firewall.

What I did not remember though is that I messed with the subversion auth module while I was tweaking the security settings. Everything worked fine (or seemed to) with the firewall engaged so I forgot about it. Yesterday we were trying to get the games reconnected to our subversion server and bang I totally lost access to dudney.net. After much banging my head against a brick wall and such and some great support from my provider I found the following log message.

/usr/sbin/PasswordService: client response doesn't match what we generated ... Host at ...my ip address... will be blocked for at least 15.00 minutes

Ah something in the firewall is blocking access. Turns out I had set my subversion auth mode to digest (must be basic) and that was causing the auth failure, which made the firewall block everything for 15 minutes.

Permalink     Add A Comment