TheJoyOfHack

For people who like to make things

Rotation and Adaptive Layouts

Another in a series of posts documenting my process of updating an aging app.

For this rewrite of Qur’an Memorizer I’m using Auto Layout. This is the first time I’ve used Auto Layout for this app. You know when the Apple Engineers said Auto Layout makes things easy? They weren’t kidding. Even though Qur’an Memorizer has some unique behaviors for autorotation, I was able to implement this in a few hours with Auto Layout and about 25 lines of code. Read on to see what I did.

more ...

Code Coverage Without Pod Files

Another in a series of posts documenting my process of updating an aging app.

I noticed that the code coverage reports from XCode 8 recently started showing me coverage for .m files that were in the CocoaPods that I’m using. In this post I document how I fixed that.

more ...



The Performance Cost of Using WordPress

Happy with my experience with a custom WordPress installation for this blog, I decided to try using the blogging platform for the TaskForest website.  The two main reasons were the ease of creating RSS feeds and the ability for users to comment on posts or articles.  After a few days of tinkering around, I’ve come to the conclusion that, at least for TaskForest, WordPress would cause more problems than it would solve. Here’s how I came to that conclusion: more ...


Sometimes Text Files Are Better Than Databases

A File
A File

I remember in my first Computer Programming class in college, the instructors wanted to make sure we understood the concept of persistence by saving application data to disk.  To keep things simple we would serialize data and save it to text files.  Once we learned advanced concepts we migrated to using relational databases.  As a professional, most of the apps I see use an RDBMS like DB2, PostgreSQL, Sybase or Oracle.  Text files have been relegated to the simple homework assignments of Programming 101.

There are, however, many classes of applications for which text files are the preferred means of storing data.  One of the main reasons is that when data is stored in a relational database, editing it is not a trivial task.  A well-normalized database is not easily updated via an SQL command line.  More often than not, a dedicated, graphical editor is needed to model the complex relationships. more ...


The Most Dangerous Programming Errors

Streams at the Great Smoky Mountains
Streams at the Great Smoky Mountains

The Common Weakness Enumeration (CWE) has released their list of Top 25 Most Dangerous Programming Errors. This list and the explanations of the errors are very instructive and should help both novice and expert programmers.  If you’re a developer, I strongly urge you to read this document and make sure you understand the concepts it covers.

more ...