Swiftification and Objective-C

Since Apple introduced Swift, they started to introduce things which were against Objective-C/SmallTalk philosophy.

Unlike Simula/C++ school, SmallTalk/Objective-C school valued simplicity and minimality.
Compared to Simula/C++, Objective-C folks/community has been very selective when they introduce new features to the language, while C++ community tended to add whatever people asked and whatever looked good. I like C++ in 1990’s. However, there are too many syntactic sugars and some functionalities which are not really necessary.

I know current generation of people. Instead of trying to understand philosophy behind their interested language, they just blame this and that about the language. To properly criticize in productive way, they should understand philosophy of the language. Only after that, in that boundary they should criticize the language.

So, people just blames how Objective-C is bad blah blah. Sure. it has its weak side. But once understand why it’s like that and what was its goal, it’s not that bad. Actually Objective-C with Cocoa is better than C++ with standard library or any framework.
Believe me. I am not narrow minded person. I’m a long time S/W engineer who learned many languages so far. Here in US, people just tend to stick to one thing and just see things from that point of view. It’s clearly seen when I got interviewed. They are only on one side.

Several years ago, ChangKi Kim and I have discussed a lot about those  ( and complaint a lot about current generation of people how narrow mind they had. ) Also, now I have pretty sufficient experience about people in the US. So, I can now say this is this and that is that.

Anyway, people here is self-centric, while we are relation-centric. So, it is clearly shown in conversation. When others say something different than mine, then we considers the situation he is under. And if what he says is right under that situation, we nod. However, people here don’t behave like that. They don’t care what kind of situation others are. Because such attitude, they can’t proplery criticize other languages or even asks something weird.

I’m the person who asked generics in Objective-C to Apple a while ago. ( about 10 years ago?)
Although I know that many things which can be achieved using generics can be solved by boxing (i.e. NSValue, NSNumber, and so on ), but some can’t be still. So, having generics is good, but I understood why Apple and Objective-C society say no to such idea.

However, now air is not like that.
Even when I visited Apple personally, now I see totally different people. Probably that’s the reason.
They look to behave more like Simula/C++ people.

In OS X 10.11, they introduced some syntactic sugar. I like some of them, but some are not really doubt able.

From this prelease AppKit Release Notes for OS X 10.11

Swiftification (New since WWDC Seed)
Framework APIs in both OS X 10.11 and iOS 9 have adopted new Objective-C features such as nullability, lightweight generics, and “kindof.” These features enable API intent to be expressed more precisely and APIs to come across better in Swift.

For instance we can now indicate that nil is a valid value for the destination view when converting an NSRect between coordinate systems:

– (NSRect)convertRect:(NSRect)rect toView:(nullable NSView *)view;

and that the array returned by splitting an NSString with componentsSeparatedByString: is an NSArray of NSStrings, and it will never be nil:

– (NSArray *)componentsSeparatedByString:(NSString *)separator;

I would like to talk about nullability.
In Objective-C, it’s perfectly OK to send messages to a null object. It has been like that and it has been considered as a virtue to have such null object-allowable behavior.
Null check on objects can be simplified thanks to that and that yields clear code.

However for the new nullability feature, they introduces nullable and nonnull keywords ( or _Nullable and _Nonnull ). It means that we need to care whether it can be null or not. It is good for people who have only C++ experience in their career. However,  from the point of Objective-C view, it’s not. It’s like to make Objective-C more like C++.
Then it’s to get rid of one of the strength of Objective-C.

I know that it’s due to Swift. Swift. ( That’s why they call it ‘Swiftification’. )
Swift is kind of collection of what all people asked to a computer language. So, some part of it looks like Pascal, some looks like Python, some looks like C#, some looks like C++ and so on.

I like Bibimbop, but I don’t like to mix almost everything and to believe “because I provide all the things people asked, it must be the best.”

Well, we already saw something similar happened in this industry:
PL/1 and arguably Java

UPDATE : By reading this page, I can see that it’s prepared for Swift/Objective-C interaction. Hmmm.. Ok, then. it’s Ok.

Agile technique/methodology


That’s what I’m saying as a person who saw the birth of agile technique/methodology. Don’t stick to terminology and their requirements/ or ‘do-this-do-that’.

I remember it was around 1992 when I first saw it. It was in its very early stage. As far as I remember it became more formal. However, I remember that people in S/W engineering called it ‘technique’ rather than ‘methodology’. There was good reason for that. However, after that time ( around 1996~7 ), professors or people in academia have built ivory tower around it. At that time, that was tendency in S/W industry/school. Wow factors were reduced, because most of things we could imagine this ‘comparably-new’ field of academia/industry  were already made or pusuit largely. Anothe example was ‘pattern’. In Korea, we used to say that ‘reason to read books on patterns’ was not because we didn’t know them but because we didn’t know how people called them.

That is typical way to provide ‘authority’ in their major field and protect themselves to present them as ‘experts’. Knowing terminology is important, but it’s not core of knowledge. Knowing is to know something and making it yourself.

I can’t forget a story about a very famous author’s father. (Milan Kundera’s father? I’m not sure ).

His father was a great fan of classical music. In a social meeting with people who care classical music (Surely most are from high society ). People there kind of looked down his father when they let W.A Mozart’s early music played and his father mumbled “Hmmm.. this is differnt from when Mozart grew up but still has his feeling and style though not mature.” It was famous one. Those people mumbled how his father couldn’t know the title of the Mozart’s.
The difference is that they memorized that it’s Mozart’s, while his father knew the style. What’s actual knowledge? Which one we can call ‘knowing’?

I believe who really knows Mozart’s is his father not other people. “Can say terminology or definition by just memorizing’ is not ‘knowing’ itself. After it is boiled and cooked into oneself, even after he forget what it is called, if he can ‘know’ what it is, what it is for, etc, it’s actual ‘knowing’.

After getting interviewed here in the USA for years, now what I can say for sure is that, people here pick  a S/W engineer they want to hire like the way those ‘other’ people do not the father.
In Korea, (i’m sorry that say this but) it’s how small companies hire ‘coders’, who just learned how to write S/W program in ‘programming’ institutes ( like language institutes for English, Korean )
Good S/W engineers from University pursuit their knowledge by understanding not by just memorizing. (memorizing is one of the step to know, as phase 1 along with understanding though. )

Some new additions in Objective-C : Nullability

After starting to work at Telestream, I don’t have time to write posts usually here. Actually more correct reason is that I don’t run into some subjects which interest me : Win32/MFC programming? Not doing much here. Here in-house framework is used although it’s written on top of Win32 and Cocoa/Carbon and sometimes I do touch those but not as much as I did before. Also, it’s not interesting to share such information here, because those frameworks/libraries are not used outside of this company.

.NET is not technically interesting or is almost same to Cocoa in its philosophy-wise. So, if I touch one subject in Cocoa, it’s also applicable to .NET or vice versa.

So, I feel like I’m behind of time, because I can’t catch up with their latest and greatest additions and changes.
Sometimes it suddenly makes me feel stupid and retarded. Here is one such thing : Nullability

Apple people nowadays don’t speak out things on fundamental stuffs. They like to speak out new functionality which attracts media journalists’ eyes rather than developers. ( Why are there so many non-developers who anticipates new products at WWDC? ) However to us, developers, this kind of fundamental changes are more interesting.
Here are some good blog posts. Please have your hands wet in them.

When TISGetInputSourceProperty( *, kTISPropertyUnicodeKeyLayoutData) returns NULL

I happened to use Korean input method when I launched a S/W program. Then it crashed at accessing the resultant object of TISGetInputSourceProperty().


They say Japanese keyboard caused returning NULL. I will add Korean input method to that.

Here are two things to be aware of :

  • What is interesting is that kTISPropertyUnicodeKeyLayoutData is still used when it queries last ASCII capable keyboard.
  • It is TISCopyCurrentASCIICapableKeyboardLayoutInputSource() not TISCopyCurrentASCIICapableKeyboardInputSource() to call. The latter doesn’t guarantee that it would return an keyboard input with a layout.

0 as a macro for successful result?

For more than 20 years, I’ve worked on/with many libraries and frameworks.
There are many oddities. Some were understandable, while others were clearly by wrong design.

However, for recent 10 years, many of such oddities were gone in many frameworks, libraries.
But still I see some.

Most recent one is to define 0 for meaning successful result and -1 or even 1 to mean failure.
As far as I remember, I saw such definition about 20 years ago in Microsoft header file.
For the recent 10 years, many of coding style became like this :

isSuccessful = DoSomething();
if( isSuccessful ) {


if a macro value for meaning success is 0 ( as a return value for DoSomething() ), writing code like above will fail.
So, it should be always like :

if( isSuccessful == T_SUCCESS) {


However, the naming the value as ‘isSuccessul’ is not really useful.
In 80’s and 90’s people tended to declare such variable name like ‘result”.

STATUS result = DoSomething();
if( result == T_SUCCESS) {


So, defining a successful value as 0 doesn’t match current style and even in 90’s style it is good only partially.
Actually even in 80’s and 90’s such values were set 1 or none-0. Failures were set 0, and -1 in some libraries.
Because 0 is implicitly evaluated as false and none-0s are true, it’s common sense to define some SUCCESS as 1 or non-0, and Failure as 0.

So, whether to follow 80’s and 90’s convention or contemporary convention, it’s very odd to define 0 as SUCCESS.

I wonder what people thought when they design it such a way.

Does Windows 10 still have ‘start screen’?

On most PC tech magazines and tech blogs, they say Windows 10 brought Start menu back and got rid of ‘Start Screen’.

However, actually the answer should be ‘Yes’ and ‘No’.
Most English-speaking people I have met so far tend to consider only surface of issues, not the implication of an issue or another aspects under the surface.
I know what kind of answer they want. But if I just answer so, I know that they will not understand things correctly. On the other hands, Koreans ( not current young generations, but till the generation I’m in ) tend to understand by applying individual case which is mentioned in broader way. In other words, if one things is explained, Koreans tend to apply it for broader case and tries to figure out if it can be true for that broadened case. Then they find the optimal boundary where it can be applied.

Back to the Windows 10 stuff..
The Start menu have integrated Start Screen. So, depending on how you see it, you can say it’s still there or there is no Start Screen.

Start menu and integrated Start screen

Start menu and integrated Start screen

There is another aspect.
On desktop, you can set “Tablet mode” forcefully.
Then the Start Screen appears like Windows 8.x.

Changing to tablet mode

Changing to tablet mode


Resurrected Start screen

Resurrected Start screen

However, the reason MS brought its Start menu back in Windows 10 and thus put the precedence of Start Screen backward is that users complaint about the awkwardness of Start screen on desktop and inconvenience of not having Start menu.
So, I don’t think there will be more people to turn on tablet mode on desktop environment.
So, although the Start Screen is there, it will be more rational to say “there is no Start Screen” for most users.

Probably it’s the reason most magazines and blogs for PCs describe that Windows 10 ( for desktop ) don’t have Start Screen and superseded by new Start menu on steroid.

Android UI problem

Android Kitkat has very confusing UI. Actually, Android UI has been like this so far.

There is a ‘turn around’ button on the bottom. it means “Go back”.
However, on top of the screen there is also ‘<‘ button. Usually there was so-called a hamburger button.

Both means “Go back”. However, there is difference where it goes back. The bottom one goes back to its immediate previous screen, while the top one goes way back to a list screen.
Probably from there different view controller was spawned ( if using iOS terminology )

Isn’t it confusing?


Get every new post delivered to your Inbox.

Join 43 other followers

%d bloggers like this: