Hey… where’d you go?

A co-worker of mine had trouble debugging his library in Xcode. For some strange reason, GDB would not stop at any of his breakpoints. He did the usual printf and NSLog to see if the code was even being called, and sure enough… it was. The only way he was able to fix it was … Read more

Test cases

You can never test too often…. and on that subject, you should try to test early. Getting into the mood of writing test cases though takes away from the fun of actually coding. Recently, I have paid a lot more attention to testing and test cases than I ever had in my coding past. Reason … Read more

Exceptions are for programming errors

You should catch errors but be very careful about swallowing it and not re-throwing the exception. I have seen this in certain projects where exceptions are swallowed and the developer of the offending code never even knows that this happened. So months can go by without any testing, you are doing early testing … right?!… … Read more

What’s wrong with this code?

Recently, I was looking at a bug report for an error that would only happen on one operating system. When I looked at the code… I had wondered why no one called this one out: char buffer[128] = {0}; // Some code here memcpy ( buffer, another_buffer, 128 ); // Some more code free (buffer); … Read more

Programming language and convention

A programming language does not enforce rules. It just gives you the means to tell a computer how to do something. In my previous job I saw how SQL was being mis-used and how there was a lack of design used in implementing certain databases. The language doesn’t guide you to creating good databases; this … Read more

Changing library dependency paths

If you want to change what your host application is dependent on, without having to rebuild it, you can use the install_name_tool app for changing this: install_name_tool -change oldreference newreference appname install_name_tool -change /usr/lib/libItsAllAboutMe.dylib @executable_path/../Frameworks/libItsAllAboutMe.dylib MySuperApp This is pretty useful for cases where you might have a dynamic library located in a static location, but … Read more