3 ms·
This sounds cool, but I think I will just make a jumble if I try to actually use it. What I like most about closures in most languages is how quickly it lets yo
by tumult 17y ago
This sounds cool, but I think I will just make a jumble if I try to actually use it. What I like most about closures in most languages is how quickly it lets you work. In C, I don't want to work quickly. I need to be methodical and pay close attention to detail -- this usually means I'm going to keep track of what I'm doing both in my head, in notes I'm taking, and in the actual C code. Passing pointers along with the callbacks (for example) isn't such a big deal when I'm already doing all of this extra work.
I mean, I'm writing C in the first place since I'm doing something low-level, something that needs careful optimization, implementing some kind of base system for something else, etc. Otherwise I'd just use a higher level language.
In the context of Obj-C it makes more sense, though, since you're already writing C while working with a higher-level language, too. You use obj-c objects if you need refcounting or GC at the moment; I can definitely see the usefulness of having closures in C. I know lots of people will probably use it just fine, but for me, I think I would just make a hash of my own code.
Or maybe when I give it a shot it'll work out fine. Ok done with rant :)