[Korean] About my comment on the book, ‘Real iOS Programming without Interface Builder’

This is the comment I left at following URL: http://www.acornpub.co.kr/blog/406  ‘인터페이스 빌더 없이 하는 아이폰 리얼 프로그래밍’

It’s about questioning the intention of the book about doing iOS development WITHOUT using  Interface Builder. It’s written without reading the book yet.

I’m a strong proponent of Interface Builder and its usefulness, and my comment was about that not using the Interface Builder may not be useful for those who need to read this book, who may be new to programming. And ironically to the author’s intention, it may not be able to help creating the application which should be easily maintained and expanded.

(내용을 읽지 않고, 별도의 프로그래밍 관련 주제의 댓글입니다. 소개글만 읽고 적은 것이므로. 책에 대한 평가로 오해하지 말아주세요.)

좋은 책이 나온 것 같습니다. 인터페이스 빌더’만’ 쓸 줄 아시는 분들에게 무척이나 유용하고 의미있는 내용을 가지고 있을 것이라 생각됩니다.

정교하고 디테일한, 100% 통제를 해서 모든 요소들을 일일이 다 챙기는 것이 중요한 프로젝트라면 당연히 코딩으로 VIEW 또한 손수 다 그리는 것이 좋을 수 있습니다.
또한, .xib 은 일종의 XML 로서 parsing 과정을 거쳐야 하기 때문에, 0.001 초라도 아껴야하는 경우에는 분명 사용하지 않는 것이 맞습니다.

하지만, MVC 분리법에 대한 충분한 이해가 되지 않은 초보 개발자, 실제로 응용해본 경험이 적고, 그 가치를 제대로 이해하지 못한 개발자들에게는 잘못하면, VIEW-CONTROL-MODEL 에 속하는 코드들이 우후죽순 막 섞히는 결과물을 내게 만들기도 합니다. 마감날짜가 급한 경우에는 더더욱 유지보수에 문제가 있는 (앞으로 문제가 생길) ‘위험한 코드’를 만들게 되지요.

이렇게 되면 소개글에 나타난 대로 유지보수에 탁월한 해결책이 되어주지 못하게 됩니다.

분명 하드코딩은 중요하고, 어떤 개발환경도 반드시 이것을 가능케 해야 합니다. 하지만, 이것은 과거의 생산물이 가진 생명력을 연장하는데 좋은 것이지, 미래를 위한 혁신적인 결과물을 만드는데 장애가 되는 것이라 생각합니다.

그래서, 혹시라도 미래를 위해서 일해야할 초보 개발자들에게 잘못된 습관을 가지게 하거나 자칫 혼란을 주지 않을까 하네요. 컴퓨터가 할 수 있고, 컴퓨터가 해주는 것이 훨씬 더 좋은 일인데도 불구하고, 단지 자기는 이렇게 가르침 받았고, 이렇게 하고 싶다는 이유만으로 하드 코딩을 고집하는 것은 미래에 대한 좋은 준비자세가 아니라고 생각합니다.

또한 단지 코멘트를 많이 남기기 위해서도 좋은 이유라고 생각되지 않네요. 코멘트 대신에 코드 그 자체로 모든 내용을 표현할 수 있다면 제일 좋다고 많은 분들이 얘기하시는 것 같던데.

반대로, 인터페이스 빌더를 쓰면 그에 대한 설명을 구구절절 코멘트로 어딘가게 남겨둬야 하니, 아예 코멘트 없이 코딩을 하기 위해서라도 하드코딩을 하는게 좋다고 하려 하신 거라면, 적극 동감할 수는 있습니다.

책의 내용은 분명 추정컨데 회사내 베테랑 개발자들에게 무척이나 도움이 되겠지만, 책없이 공부할 줄 아시는 그분들에게 정작 책이 필요하지 않을 것도 같고요. 왜 그동안 이것을 공개적으로 다룬 책이 씌여지지 않았을 지 좀더 냉정한 고민을 하셨기를 바랍니다.

당연히 그런 고민을 하셨다면, 어떻게 하면, 인터페이스 빌더의 장점과 하드코딩의 장점을 융합해서 양쪽 모두가 가진 탁월함을 같이 쓸 수 있는 방법도 책에 써주셨을 거라 믿습니다.

이런 목적으로 두마리 토끼를 다 잡는데 유용한 내용을 쓰셨다면, 이런 책이 다른 곳도 아닌 한국에서 한글로 먼저 출간된 것에 엄청난 자부심을 느끼셔도 좋을 것 같습니다.

My understanding in naming a Class with Prefix

Many source codes, especially those which are written in kinds of C languages, almost always named their classes using prefix.

Intuitively, I adopted to use this way of naming, since many GOOD ones were written in this way. My usual way of learning is by imitating.

As I’ve gained more experience, it became obvious to me why it’s critically helpful for programming.

In my case, I care quite a lot how methods and variables are named. Nicely named ones can help understanding the workflow, minimizing any confusion, thus producing reliable lines of codes.

However, one must careful not to use same syntax for the name of class and instance of it, since it’s difficult to distinguish if one is meant for the instance or the class. It gets worse if the class name and the instance name are as common as something like ‘WebViewController.’

Since naming instances of class happens more often than naming a class, it’s better to name the class with less common way. To make it less common, one of the easiest way is to use a prefix, elongating it to be syntactically different. For example, by using prefixed, ‘FXDWebViewController’ for the class name, one can use ‘webViewController’ as a name for an instance.

Though this instance name is quite common, you can use it as often as possible, without causing the programmer to be confused and even preventing compile time or run-time errors, as long as they are separated by scopes.

It gets even better when one has to use Find and Replace function, since syntactically different words are much easier to be found more quickly.

Also, using the prefix, you can leave it as some kind of signature, claiming your authorship and responsibility on the source codes.

PopToo is updated to Version 1.2.9!

http://itunes.com/apps/poptoo

As much requested feature, PopToo is updated to use #ArtistName for utilizing Twitter’s hash tagging.

Now you can show how much you appreciate your favorite artist by using auto generated hash tag.

Thank you and keep enjoying your favorite music with PopToo!

PopToo is updated to Version 1.2.8 for iOS 5

http://itunes.com/apps/poptoo

For new iOS 5 upgrade, PopToo has prepared it by being updated to 1.2.8

We’ve fixed some minor bugs, and improved some workflows.

App Store reviewing process went so smoothly, even though it should be crazy over there reviewing immense number of updated apps for iOS 5. PopToo was submitted and approved to be ready for sale in about 8 hours. Thanks App Store.

Also, we do thank our PopToo Friends, who have been enjoying their music with PopToo iOS App everyday. It’s great joy for us to serve our users in daily basis.

Keep enjoying your favorite music with PopToo!

PopToo is updated to Version 1.2.7!

After struggling in revising the check-in process for a while, updated PopToo fixed the critical issue.

While PopToo is running background, most of its views are unloaded from memory for optimal functionality. But because the controlling elements and the displaying elements were not perfectly separately, often the important elements for Auto Check-in feature were also unloaded along with the displaying ones.

If Auto Check-in was initiated while being in background, the count-down seconds and the indicators for phases of process, which used to be residing in the displaying objects, were not being activated.

It didn’t affect Auto Check-in itself, but when PopToo was restored while it was in the middle of count-down, the displaying elements were not showing the current state of Auto Check-in correctly with count-down seconds.

This issue is fixed by completely separating the controlling objects from the displaying object which may have been unloaded while PopToo is running background.

Thank you for your patience, and keep enjoying your favorite music with PopToo!

PopToo’s one reason for performance lagging: Unreleased allocation

PopToo uses Core Data extensively. However, the way it uses fetched objects is not good for memory management, especially for an app like PopToo, which is focused on running background.

Unlike what’s often recommended, PopToo simply uses a few number of NSMutableArray instances to manage fetched objects from Core Data. Due to the original design structure for sectioning these objects into UITableView based on time or distance, I have postponed to use NSFetchedResultsController instead.

Though the design has worked as I intended, using NSMutableArray wasn’t the right way. As PopToo is running background, new objects will be constantly added, when new stream of PopToo Friends’ check-in data is downloaded and when the user checks-in his media information. Inevitably, memory allocation for NSMutableArrays will be grown until the user terminates PopToo, or the device system does. And as they grow, performance of PopToo is affected, which is more visible when it’s restoring to be active from being background.

For next update, I will refactor PopToo’s workflow to be more suitable for running background. Memory allocation will be strictly minimized, instead fetching objects from Core Data will be refreshed more often. I am fully aware that fetching requires some time and may not be the right solution for better performance, but I am confident it will make PopToo’s lagging issues to be less visible, enhancing the user experience.

Optimizing PopToo’s performance: Found the cause which can’t be removed

Lately, I’ve been doing some tests on my iOS app of PopToo project to optimize its performance.

The main situation I wanted to solve was when the PopToo is restoring to be Active from being in Background, it freezes for at least a second before starting to respond to user interaction.

I’ve examined a few areas and these three areas came to my attention: saving transformable objects in Core Data model, delayed selector callings for dismissing certain views while in background, and activating different accuracies for Core Location service. I tested them by eliminating each one.

Initially, I thought saving transformable objects in Core Data was the main cause. As recommended by many, I changed it to store numerical data types. Though it could save some storage space, which may positively affect migrating to new database scheme in the future, it didn’t solve the problem of experiencing freezing.

Next, delayed selector callings for dismissing certain views were dealt by simply excluding them to be used simpler without delay. Which had started for dismissing keyboards when PopToo iOS App goes background, gradually became too complicated, and currently requiring to be refactored anyway.

For saving device power, PopToo changes Core Location service accuracies to be Best if it’s Active, or ThreeKilometers if it’s in Background. And this is the spot where PopToo’s performance is significantly lagged. Core Location seemed to do a lot of critical jobs, that are important enough to cause freezing for a while, when it’s activating stronger accuracy.

Though a cause of performance lagging was found, I couldn’t develop ways around it yet. Since it’s very important and useful way to save device power while using PopToo’s Auto Check-in features, this accuracy changing can’t be removed.

Also, PopToo’s lagging interval seemed to get longer as it’s kept running until being terminated. This means there can be other reasons too, in different areas. I’m guessing it’s related to memory management.

Guess my search is to be continued.

Renewing domain and hosting services

Hosting and domain renewing time has come. And by examining what new options are available, I could also review what resources I have for development.

Hardware, iOS developer connection membership, and other subscriptions, are usually fixed cost, with little variety. But most of all, I need them with no other choice. Fortunately, considering their importance, many of them are quite affordable, relatively.

But domain registration and hosting is different story. There are so many different options for different purposes. New options can be found from many places.

For domain registration, I used GoDaddy, but just transferred all my domains to Hover. Except for being cheap, there is almost no advantages in using GoDaddy. Their interface is so crude and excluding privacy option in basic purchasing of domain is not right, I think.

For hosting, I decided to stay with generic PHP and MySQL combination for one more year. Though there are disadvantages, it seems nice option for my personal blogging. I seriously thought about using Squarespace, but until my projects are grown big to attract so much traffic, having inexpensive hosting with option to use multiple WordPress installations sounded good to me. Also, revitalized respect for PHP and MySQL affected me to make such decision.

Dealing with busy situation of finalizing development

About last 5 days were dedicated to prepare newly developed iOS app to be submitted to the App Store. During those days, unknown but high priority errors were found and prevented other issues to be solved in time. It was extremely stressful to find the causes and solutions, especially if every line of code compiled and worked just fine. As expected, the main causes were architecture related, run-time issues, which are usually considered to be more difficult than anything else.

What made me more frustrated was that, the architecture was working just fine until new feature were added for the requests that were made so late as when we were just ready to submit the product to the App Store. As we were adding new feature, processes were changed and other components were affected without our knowledge. To those who request, it’s just one more feature. However, to those who develop, it’s one more variable affecting entire system.

Also, I have realized how inexperienced I am, especially if I am under time constraining situation. If newly added feature is not working right at first, I easily lost confidence in my own design of software, and attempted to modify it to accommodate the new feature. And because this modification on the currently working design was made hastily, I often overlooked how important components were affected by recent change.

I should have more training on staying calm and keeping the confidence in finely working software design in the midst the frantic development.