全く新しい、真にユニバーサルな言語へ。
皆さんiOS開発の際にお世話になっているObjective-Cですが、一部の開発者の方々から以下の様な否定的な意見をいただくことがあります。
- とっつきにくい
- 文法がキモい
- @や[]がキモい
- シグネチャが無駄に長い
- Apple製品でしか使えない
確かにObjective-Cは習熟すればこれらの欠点を補って余りある素晴らしい言語ですが、これからの更なるモバイルアプリの世界の拡充のためにはより一層多くの開発者に愛される言語になる必要があると私は考えました。
そこでこの度ご紹介するのがObjective-Cをさらに使いやすく、さらに親しまれるように、全く新しく一から作りなおした新言語
Objective-🍣
です!
Objective-🍣とは
以下の様な特徴を持つ言語です!- 驚異的に短く、真にユニバーサルな、洗練された文法を持ちます。これまでのプログラミング言語は基本的に英語による記述を強いるものでした。Objective-🍣は真に全人類にとってユニバーサルな絵文字をサポートすることで、この問題をすべて解決しました。Objective-🍣の親しみやすい文法にはすべてのプログラマがシンパシーを感じることができます。
- Objective-Cと100%のランタイム互換性を持ちます。新しいiOSが登場してもその瞬間からあなたはObjective-🍣の圧倒的なパワーを手にすることができます。
さっそくObjective-🍣で書かれたサンプルコードを見てみましょう!拙作確率計算機のコードをObjective-🍣に書き換えてみました!
before
after
なんというこれまでにない全く新しいソースコード!あのキモかった@や[]、長ったらしいメソッド名がその姿を消しています!そのあまりの美しさには全プログラマが歓喜の涙を流すこと間違いありません!
Objective-🍣の導入方法
こちらのobjsushi.hをあなたのプロジェクト上でincludeするだけで使用できます!簡単ですね!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// objsushi.h | |
// Objective-🍣 | |
// | |
// Created by akisute on 2014/04/01. | |
// Copyright (c) 2014年 akisute. All rights reserved. | |
// | |
#ifndef objsushi | |
#define objsushi | |
#define ✈️ #import | |
#define 🉑 @interface | |
#define ㊗️ @implementation | |
#define 🎉 @property | |
#define 🍣 @ | |
#define 🍺 [ | |
#define 🍻 ] | |
#define 😲 * | |
#define 👫 : | |
#define 📱 UI | |
#define 🍐 NS | |
#define 🆑 CL | |
#define 🌁 View | |
#define 🌁🎮 ViewController | |
#define 🔤 Label | |
#define 👉 Button | |
#define 🚰 Table | |
#define 📜 Scroll | |
#define 🈯️ Delegate | |
#define 💾 DataSource | |
#define 📰 String | |
#define 🈳 void | |
#define 🆓 nil | |
#define 🔑 key | |
#define ✉️ [[[[UIApplication sharedApplication] keyWindow] rootViewController] presentViewController:[MFMailComposeViewController new] animated:YES completion:NULL] | |
#define 👍 [[[[UIApplication sharedApplication] keyWindow] rootViewController] presentViewController:[SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook] animated:YES completion:NULL] | |
#define 🐦 [[[[UIApplication sharedApplication] keyWindow] rootViewController] presentViewController:[SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter] animated:YES completion:NULL] | |
#endif |
Objective-🍣を使ってみる
それでは早速ビルドしてみましょう!
あれ
えっちょ
\(^o^)/
ちなみに日本語セレクタ自体はXcode 5以降で普通に使えますよ。