iphone - 哪种语言是替代 Objective-C 的最佳语言?

标签 iphone objective-c

看完Is a virtual machine for Cocoa programming inevitable? ,我想知道如果替换真的发生,您心目中的语言是什么,为什么?

Fixable complaints in the language and APIs include

  • the lack of tuples, slices, maps or associations at a syntax level;
  • the lack of template programming;
  • the lack of namespaces;
  • the lack of default parameters to methods;
  • the lack of operator overrides/overloading;
  • leaks and premature collection by the garbage collector;
  • the wordy, camel-coded naming conventions;
  • the lack of package management;
  • the lack of out-of-the-box support for "business" APIs like REST, SOAP, SQL, etc.
  • Even the commonly mocked square bracket method invocation syntax could be changed if the need existed.

附注请每个答案使用一种语言。

最佳答案

投诉的有效性如何:

Fixable complaints in the language and APIs include

  • the lack of tuples, slices, maps or associations at a syntax level;

那又怎样?

  • the lack of template programming;

这是 C++ 模板吗?然后使用 Objective-C++。就个人而言,我认为我们在 Objective-C 中没有它们是一个加分项。

  • the lack of namespaces;

这个是有效的。我非常喜欢 namespace 。

  • the lack of default parameters to methods;

这是我很高兴没有在 Objective-C 中的另一个特性

  • the lack of operator overrides/overloading;

这是我很高兴没有在 Objective-C 中的另一个特性

  • leaks and premature collection by the garbage collector;

因此修复垃圾收集器的错误。

  • the wordy, camel-coded naming conventions;

我喜欢冗长的命名约定。它使代码更易于阅读。 OTOH 如果你是一个没有注意到这些只是惯例的人。编译器不会强制您使用它们。

  • the lack of package management;

包会很好。

  • the lack of out-of-the-box support for "business" APIs like REST, SOAP, SQL, etc.

有很多库可用于这些。

  • Even the commonly mocked square bracket method invocation syntax could be changed if the need existed.

经常被不真正使用该语言的人 mock 。当我第一次开始使用 C 语言时,我非常讨厌它的语法,但你会习惯的。

除了添加 namespace 支持之外,我认为没有紧迫的理由改变 Objective-C 的任何内容。这就是我的答案:Objective-C。

关于iphone - 哪种语言是替代 Objective-C 的最佳语言?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3263949/

相关文章:

objective-c - 地幔和核心数据 : Only one Model

objective-c - 使用 parekit 进行简单的标记解析

ios - 检索记录中的核心数据混淆

iphone - JSONValue ARC 问题

iphone - iOS - 导航标题未更新

iphone - 如何将图像缩放到全屏模式?

objective-c - 检测鼠标悬停在 Dock 上,任何 Dock 图标单击

javascript - 更换 iPhone 上的文档正文

iphone - iOS SDK : How can I check if a port is open?

ios - 将 swift 闭包存储为 objective-c 类的属性,其中使用 typedef 声明 block