CoreData, I hate you!

The last year I’ve been learning a lot of new things. I’ve had to change my mindset from the concept of procedural programming to the concept of object oriented programming. Had to learn Objective-C, Xcode, Cocoa, new frameworks, etc. Although learning new things can be exiting and cool, it can also make you insecure and frustrated. I used to be a damn good software developer, and now everything seems to be new and hard. Luckily I still had my database experience and knowledge. It’s so nice to have some solid ground, some technology that you can trust, that hasn’t changed that much.

From my point of view, a database consists of tables. You can have a “Persons” table for instance. This table has fields, like “Name”, “Address”, “PhoneNumber”, etc. These fields can be filled with data. For convenience reasons sometimes an ID is added to the table, to make it easier to look up data, and to link data from one table to another. I’m used to using SQL to query a database.

Yesterday, my colleague (who also happens to be my husband) and I discussed the data model of our project. I asked him why he didn’t add ID’s to the tables. “No, these are not tables, these are OBJECTS”. Of course not, it’s a database silly, so these must be tables. “No, this is not a relational database…” WTF?! So you’re telling me, that besides everything I’ve already done and learned so far, I also cannot use my database knowledge?! CoreData, I hate you!! Why are you not a relational database of the kind that I know and trust!?

Of course this is not CoreData’s fault, I probably have to blame people at Apple, or even further back, at NeXTstep, and probably they had some good reasons to do it all this way, so I shouldn’t blame anyone, but still… somedays, especially the rainy ones, you just want to be able to go with the flow. As Aaron Hillegass wrote in his Objective-C book: “In this case, ‘learning new things’ is a euphemism for ‘battling against our own ignorance’.” I’m afraid this is very true at the moment.

But tomorrow, I’ll pick up the pieces. Secretly I’ll probably translate objects to rows in my head for a while, when it comes to CoreData. And eventually my mind will get used to this as well and I’ll learn to appreciate CoreData. If only my mind was a little more flexible…

 

Update: the following articles were tweeted to me in response to this post:
OrmHate – a blogpost by Martin Fowler
Object-Relational Mapping is the Vietnam of Computer Science – a blogpost by Jeff Atwood

Back in business

I’ve been away for a while, not really away, but everything work related has been on a slower pace for too long. After my daughter was born, I did continue working in software development, but not as much as I’d wanted to. The combination of work and taking care of a daughter that I didn’t want to put in day care all week, appeared to be a hard one. I needed to be able to work from home more often, to limit the time I spent on travel. That way I could work when my daughter is in school and when she’s asleep at night.

Last summer, I went to Atlanta, to do a training at the Big Nerd Ranch: the iOS Bootcamp. With this training, I hoped to give my software development activities a serious boost, and to get back into business. I think that will still be the case, but ‘normally’ I learned a new coding language in about a week, two weeks maximum. And now, there’s this Object Orientation, and weird brackets and colons and confusing things like blocks and all. Or maybe it’s just that I’m older, or maybe Objective-C is just harder than the other languages I’ve learnt before. I will get there, eventually, but this time it’s just not as easy as I thought.

So because of being scared and insecure I said no to a lot of projects in the last months, but in a week or so, my first real project is about to start. To have a more sturdy basis, I’ve worked through the Big Nerd Ranch’s Objective-C book. That helped. A lot. I might even have more Objective-C knowledge now than some other people who’ve already finished their first app. Ok, it’s still scary, what if I’ll mess up? For the average beginning Mac or iOS developer that might not be such a big problem, but I’ve started coding at the age of 11, and trust me, that’s a looooong time ago. So I consider myself an experienced coder, and experienced coders are not allowed to make beginner mistakes. But I’m going to make them anyway, and learn from them. I’m lucky to live near Appsterdam, where people help each other, and where so much knowledge is shared.

My first project is a fixed price project. The hours are calculated for an experienced developer. I’m not dependent on the money I earn from this project. If it takes longer (and I’m pretty sure it will) because it’s my first real Mac & iOS project, the money I earn per hour will be less. But that’s ok, with this project I get paid in money AND experience. So I’m not going to let all the pressure win. I was a coder, and I probably always will be a coder.

NSCoder *whakkee = [[NSCoder alloc] init]; //;-)