Don’t punish Yourself

It’s given as a PUNISHMENT to a student to write sentences REPEATEDLY on a blackboard.

If you are not careful, it’s quite easy to REPEATEDLY paste copies of identical code snippets. Not using iterative methodologies and not trying to find algorithmic solutions, is like let yourself to be in the state of uncomfortable incompetency, which is a PUNISHMENT.

Advertisement

Sensitive Programmer

As a learner of programming, you may feel stressed and uncomfortable, trying your best to maintain control over the machine, not to be controlled by it.

There are too little time to complete the assignment. Your mind is not clear enough to come up with the best structure of different classes. Inheritance, polymorphism, DRY, MVC and all other essential concepts about quality programming are just ideas without visible lines of codes.

Even if you could finish your work on time, it’s quite painful to see resultant chaos in your own codes. You don’t like your own work, knowing every line in it. And this is a good thing.

Being sensitive enough to realize inefficiency and incompetency in your own work, even if no one criticize it, is a great attitude, especially if you are a beginner. Congratulation! Make sure to keep it as sensitive and sincere like that.

Until you become a true master of programming, who can bring undeniable great architectural solution without taking too much time and resources, please don’t try to avoid or ease the pain for producing quality result.

It’s necessary to feel the inefficiency of scattered snippets within your codes. You need to experience the frustration of attempting to change a small thing, repeatedly about thousand times. After experiencing this, you will never forget the critical importance of DRY principles and will force yourself to learn how to use global variables and methods, apply proper hierarchical relationship among classes. Soon, it will become natural to you as you become a better programmer.

However, it you let yourself to be insensitive to pain while programming; e.g. listening to music or copying & pasting mindlessly; you will lose the opportunity to see the need to improve. Simply for the sake of finishing the work as soon as possible, you will just pass by the situation which may teach you very important principles.

Such insensitivity will bite you back, as you maintain the chaotic structure, slavishly patching the effects without fixing the causes. And finally, you will give up, unless you can start all over again.

Avoiding Difficult Errors

The errors do happen. It’s impossible to write error-free lines of code at first.

If it has to happen, then I would like it to be easily searchable, and have been happened to others, and publicly documented, preferably with right solutions.

Often errors are caused by attempting to do something new after learning about changes in methods, or when adopting external source codes.

However, the difficulty in fixing the errors may be eased, if your new attempts are based on rigorously reviewed official documents, or widely used & time-tested open sources. Unless, you were doing extremely strange stuff, most of the errors you will encounter usually already had happened to others, and fortunately solved and documented for you.

Or, if your error is absolutely new one, you have the right (or responsibility) to expose it and ask for attention from others. Because the error is caused by your attempts based on the official documents, there is no way fellow developers who read the same documents to ignore the situation. It does matter to them. And they will join you to fix the problem, making the process relatively easier than doing it alone.

If what makes fixing the errors difficult is because they are strange to you, and you have to do it by yourself, improving the condition of the root causes can help you avoid the difficult errors.

Can App PREview Process be helpful?

Recently, our team has submitted an iOS app to the App Store to be reviewed.

Unfortunately, due to Apple’s own policy, this app was rejected and we couldn’t release it.

Personally, I have known this would happen. What this app tried to do was something questionable, at least in its intention, even if there is no technical violation.

Our team’s strategy was very simple. If Apple didn’t publish anything against about what this app tried to do, we could challenge Apple to accept the end product. If Apple didn’t say NO publicly, we should try it. That was the argument of the team leader.

However, Apple’s decision after reviewing was solid and there is no way we can reclaim time we spent to develop this app. The only comfort we could get was that Apple’s reviewer himself also felt sorry for us, recognizing it’s not a technical violation but just a political issue.

I just wish we could have known about Apple’s policy on this long before designing and developing the app. At least for me, if I could present public documentation about this matter, maybe I could persuade the team leader not to waste our time.

Or, it could be so much better if there are people in Apple’s side, who may answer our questions, BEFORE we start designing & developing something. I wonder if it’s helpful to have PREview team, like REview team.

Of course, there are a lot of instructive materials, teaching us what should we consider when developing an iOS app. But I just wish there is an actual Apple Genius whom we can talk to about very special and rare idea of ours, we just can’t help but to try out.

It’s just wishful thinking of mine.

Do your best to spend time for the Real Work

Recently, I had to work so much time on one element of the product, requested by the colleague who was not completely sure if the application was perfect enough for her to think that the product was alright to be released.

At the end, we have found that perfecting the element was impossible since it relies on the external conditions like network status. I had known about this, but I had to show it to her to convince her that it was impossible. She usually don’t understand about software limitations without actually seeing them.

I don’t disrespect perfectionism. Sometimes, even I can see myself spending so much time for just a few things of whole product, to satisfy my purposes for them.

However, it’s false to consider getting the perfect result is directly related to and only possible by working a lot of time on it.

And if such hours were spent for the sake of reenacting already known and proven limitations, you should accept the fact that you just wasted precious time which could be spent for the real work.

I am trying my best to use my work hours for the real work. But it’s irritating when it’s not possible because of incompetencies of others.

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.

Coding while Commuting

Last week, I’ve been coding while commuting to my office. Due to busy schedule for our projects, being required to learn Cocos2d framework, and having own desire to utilize my time to its fullest, I began to train myself to be more comfortable at coding while commuting using bus.

[New York Time] Wi-Fi Turns Rowdy Bus Into Rolling Study Hall
from New York Times
I use long distance bus from my home to subway station, and take a train to the office. It takes about an hour for bus ride and about 20 minutes for subway transit. And almost every time, I’ve been able to take a sit in the bus. In other words, I have an hour at my disposal to do something productive, such as coding.

Typing and building using Xcode works just fine, especially if you are free from needing to use big external display, comfortable desk and chair. When I do occasionally need to use internet, my iPhone 4 can provide personal hotspot. However, coding without internet browsing is not bad at all for me, since it lasts only about an hour.

During this hour of coding, somehow I could be able to focus on my coding more efficiently than while sitting  comfortably in my office. I suspect it’s because of using only Xcode with all other apps being closed, and encouraging myself to find solutions from my own stuff, rather than passively search answers from internet. Also, knowing the bus ride would last only for an hour, I could just focus on finishing miniscule but important matters which could be fixed quickly.

Because of this good experience, I began to have stronger desire to get Macbook Air. This lightweight compact laptop will surely make my coding while commuting more enjoyable, though my current 13″ Macbook Pro is not so bad at all. Guess I need to find about opinions of the developers using Macbook Air with Xcode, and how to deal with disadvantages.

%d bloggers like this: