Speaking as an old fart….

… yes, we do know how to code.

I turned 45 this month. In many professions that’s the prime age to be – and in others it’s considered young – but in my line of work, some people think middle-aged coders are old farts. That’s especially true when it comes to startups.

The startup culture is similar to professional sports in that it requires a fleet of fresh-out-of-college kids to trade their lives and their health for the potential of short-term glory.

“Old farts” are often excluded from that culture, not because we’re lousy coders but because we won’t put up with that shit. We have lives, we have families, we have other things that are important to us. We’re not about to sleep at our desks and trade watching our kids grow up for the promise of striking it rich. Especially when the people who really strike it rich aren’t the ones writing code.

So many developers my age have had plenty of chances to ditch coding and move into management, but we’ve stuck with coding because it’s what we love to do. We’d earn more in management, but writing software is in our blood. We wouldn’t stop doing it for anything.

And because of the years we’ve spent creating software, we’ve learned what works and what doesn’t, regardless of the language or the platform. Operating systems rise and fall, development tools come and go, but through it all, old farts know how to write solid code.

– Nick Bradbury

 

Objectivist-C

Are you a Mac or iOS programmer? Do you write code in Objective-C?

Do you know who Ayn Rand is?

If you like both, there’s now the perfect programming language for you: Objectivist-C!

Objectivist-C was invented by Russian-American programmer Ope Rand. Based on the principle of rational self-interest, Objectivist-C was influenced by Aristotle’s laws of logic and Smalltalk. In an unorthodox move, Rand first wrote about the principles of Objectivist-C in bestselling novels, and only later set them down in non-fiction.

You can read all about it here. 🙂  (h/t Ed)

I think my favorite is:

In Objectivist-C, software engineers have eliminated the need for object-oriented principles like Dependency Inversion, Acyclic Dependencies, and Stable Dependencies. Instead, they strictly adhere to one simple principle: No Dependencies.

Heh. 🙂

Apple iOS 5 Tech Talk – Austin

Yesterday I attended Apple’s iOS 5 Tech Talk here in Austin. I wrote about it at my company blog.

Rather inspired and excited am I about prospects ahead.

 

It’s settled… I can’t go back

It’s official.

I prefer Xcode 4.

I’ve been using Xcode 4 almost exclusively the past few weeks and yesterday I had to switch back to Xcode 3 for another project.

I hated it.

I thought the “all in one” window setup would bother me, but I actually find that I like it. It works. It’s not 100% perfect, but I’m actually able to get around a lot better than I could before.

The constant compiling and checking from LLVM 3.0 gets annoying sometimes as you type, but on the whole it stays out of your way and it’s nice to stay on top of problems as they come up.

I’m not sure what does code indexing, but sometimes I use indexing as a shortcut to get to things. It seems the indexer only understands what is actually there. For instance, if I started invoking some new class within a file but the file wasn’t “aware” of the class yet (e.g. no .h #imported), the indexer may not recognize it thus no code completion. There’s some other quirks in this area, which get frustrating, but again you manage and hope the edge cases will be solved in future versions. If I can nail down a good repro case, naturally I’ll report it.

I kinda like how Find is just in the left sidebar and not another window. It works.

Still getting used to the debugger layout, but on the whole it’s alright. I’ve been trying LLDB and it’s worked out pretty well, but a few days ago it started registering a bunch of bizarre messages, something about “object so-and-so doesn’t recognize selector ‘count'” which of course was correct but there was nothing I was doing that could have caused that. On a whim I switched to gdb and the problem went away, back to LLDB and the problem reappeared, so to try to get past the problem I just went with gdb. Well… then gdb manifested one of its favorite things to do: go stupid. You step, it doesn’t step… it’s trying to obtain data but gets into some stupid mode and everything just hangs while it tries to time out and your debug session is totally screwed. *sigh*

It’s still hard to get used to Interface Builder being built in, but I do love the integration. It makes life so nice. I do hope there will eventually be a “IBPlugin” solution, including a transition strategy for past plugins and nib/xib’s made with custom stuff. I’m looking forward to writing a new iOS project and taking advantage of the “storyboarding” feature. That seems cool.

As a general statement, Xcode 4 seems to have attempted to simplify and better organize the growing mish-mash of commands and functionality. It’s appreciated and so far so good.

In the past, I always avoided code completion and letting the editor format my code and typing. Xcode has generally defaulted to having that stuff on, but in the past it’s always been more annoying than helpful so I turned it off. But now, I’m actually liking it, especially code completion. It’s working much better, more logically, seems to be more accurate. It feels more help than hindrance. Code autoformatting, I’m still letting it happen, but because it doesn’t do things 100% as I want them it’s a little annoying, but I’m adapting.

Still not totally adapted to the change in keyboard shortcuts, but that too is slowly changing. I still want to hit cmd-1 to bring up the main “info panel” when I’m in IB mode.

Sometimes Xcode does go stupid. I’ve had a couple crashes. But on the whole, I am actually liking it. Again, the most telling part for me is having to step back to Xcode 3 and hating it and missing lots of things that Xcode 4 brings to the table.

All hail progress.

Oh the pain

I love Apple. You know that. Without Apple, I’m not sure what sort of life and career path I would have taken.

But… I’ve held off on upgrading to Lion (Mac OS X 10.7) and Xcode 4 for numerous reasons. One is because my day job’s requirements still need some older OS support so we had to hang back on Xcode 3 (which won’t work under Lion). But the other is all the reports of the hell, dreck, and problems in the upgrades.

I’m now in a position where I have to upgrade one dev machine to Lion and Xcode 4 in order to work on some cutting edge iOS stuff.

Oh it hurts.

The worst part of Lion is switching how scrolling works. I understand why it was done, but it still sucks. (Yes I know I can change it).

And then Xcode 4… oh, for all its improvements, all the changes are huge. It’s killing my productivity to make the adjustment. All day long I’ve been dealing with the New World Order of Lion and Xcode 4, and let’s just say I haven’t been all that productive… tho if I could count the string of obscenities spewing from my mouth as productive, then I guess productivity is at an all time high.

*sigh*

It’s just a matter of adapting and getting used to it all. I know. And if this is the worst problem in my life, then life’s pretty good.

Still.. just had to vent.

I keep saying it will all be better, that 10.7.4 or .5 will fix a bunch of things. That Xcode 4.3 will bring back User Scripts. But I’m not holding my breath.

Don’t call yourself a programmer

Cleaning out a bunch of things I’ve wanted to link to.

A great article, “Don’t Call Yourself a Programmer, and Other Career Advice“. It’s long. I’ve only been able to skim it. But it’s chock full of goodness.

OK old-school Mac programmers….

Do you remember?

InitGraf(&qd.thePort);
InitFonts();
InitWindows();
InitMenus();
TEInit();
InitDialogs(NULL);
InitCursor();

Of course, I probably should really do it this way:

InitGraf(@qd.thePort);
InitFonts;
InitWindows;
InitMenus;
TEInit;
InitDialogs(nil);
MaxApplZone;

Maybe looping and calling MoreMasters as well….

I work with people who have never programmed a Mac prior to Mac OS X. They only know of Objective-C and Cocoa. They never had volumes of Inside Macintosh or “develop” magazine.

I’m not sure if this is a good thing or a bad thing. The way we had to do things back then was a lot of work. Today’s still a lot of work, but it’s all focused on your personal logic and desires, not infrastructure. Cocoa is one of the best libraries out there, so deep, so broad, so robust. I’m quite pleased I don’t have to initialize the Toolbox any more. 🙂

namespace constants in C

Saw this on mikeash’s Twitter. Namespace constants in C.

#import <Foundation/Foundation.h>

// .h file
struct MyConstantsStruct
{
    NSString *foo;
    NSString *bar;
    int baz;
};

extern const struct MyConstantsStruct MyConstants;

// .m file
const struct MyConstantsStruct MyConstants = {
    .foo = @"foo",
    .bar = @"bar",
    .baz = 42
};

// user
int main(int argc, char **argv)
{
    [NSAutoreleasePool new];
    
    NSLog(@"%@ %@ %d", MyConstants.foo, MyConstants.bar, MyConstants.baz);
}

So obvious once you see it… why did it take us this long to think about it? 🙂