Jul. 26th, 2009 04:00 am
Objectionable-C
- (IBAction) loadFile : (id) sender {
NSImage *im;
[model loadData:"/Users/joshua/projects/dvbt/dvbt.mixed.raw"];
[nsamples setIntValue:[model getSampleCount]];
im = [[NSImage alloc] initWithSize: NSMakeSize(64, 64)];
[im lockFocus];
[[NSColor redColor] set];
NSRectFill(NSMakeRect(16, 16, 16, 16));
[im unlockFocus];
[iview setImage: im];
}Seriously, what the fuck is this shit?
no subject
no subject
no subject
Now, I realize that some of this is because of legacy issues. Back in the bad old days, everyone and their grandma called NSRectFill, and now it just has to gosh darn stay. In truth, some of these complaints are mostly stemmed from "it's different from C++, which is the object system I'm familiar with". I have to commend Apple for really doing a good job linking in things from the Interface Builder -- in particular, [nsamples setIntValue: [model getSampleCount]]; is quite pretty, aside from the strange Objectionable-C syntax.
This block of code is somewhat demonstrative of a point that I found myself making earlier this evening -- with every windowing toolkit eventually comes its own language. GTK+ has Vala (the natural evolution of the GTK+ object system); wxWidgets has C++ (which, although not its own, has the same roots; the natural evolution of a pile of steaming shit); and Cocoa has Objectionable-C (the natural evolution of Smalltalk except with more systemsy).
Uh, ... yeah this is longer than I intended it to be. I'm going to sleep.
no subject