对于初学者来说哪个更容易:RubyCocoa 或 ObjC/Cocoa
我过去听过一些关于哪个更成熟的争论:RubyCocoa 或 Obj-C/Cocoa...但我觉得答案正好落在真正欣赏答案的“新手”身上。
所以问题是:对于一个几乎没有编程经验的初学者来说,学习 Ruby 并通过桥梁探索 Cocoa(然后可能解决 Obj-C)或者直接跳到 Objective-C 更容易吗?可可。
这两个社区都很强大并且拥有大量资源,但正如许多人指出的那样,Obj-C 的语法令人望而生畏。 也许对于真正的初学者来说,学习 Ruby 比学习 Objective-C 更容易?
更新:我很抱歉,但是当我说“学习 Ruby 并探索 Cocoa”时,我并不是想通过 RubyCocoa 学习编程,而是学习 Ruby(一旦感到足够自信)就开始探索 Cocoa并有可能利用他们不断增长的技能来解决 Obj-C 问题。
I've heard a few debates in the past over which is more mature: RubyCocoa or Obj-C/Cocoa... but I have felt that the answers jet right over the "newbie" that would truly appreciate an answer.
So the question is: for a total beginner, with little-to-no programming experience, is it easier to learn Ruby and explore Cocoa via the bridge (then possibly tackle Obj-C) or to straight up jump right into Objective-C and Cocoa.
Both communities are strong and have a plethora of resources, but as many people have pointed out the syntax of Obj-C is just daunting. Perhaps for a true beginner it would be easier to learn Ruby then tackle Objective-C?
Update: I apologize, but when I said "learn Ruby and explore Cocoa" I did not mean to learn programming via RubyCocoa, but rather to learn Ruby (and once one feels confident enough) begin to explore Cocoa with the possibility of leveraging their growing skill-set to tackle Obj-C.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
我不建议学习使用 RubyCocoa 进行编程。
我喜欢 Ruby,并认为它是学习编程的绝佳语言,但 RubyCocoa 桥的记录还不够完善,因此我推荐它作为学习环境。 您将同时学习通用编程概念、Cocoa 框架和 RubyCocoa 的特性。 有很多东西要塞进你的脑子里。
如果您有决心并决心从 Cocoa 开始,请从学习 Objective-C 开始。 否则,您可以从学习 Ruby 开始,然后在您感觉更适合作为一名程序员后过渡到 Objective-C。 一旦你完成了所有这些,你就可以使用 RubyCocoa,但是你就会知道它不会让你发疯。
I would not recommend learning to program with RubyCocoa.
I love Ruby and think it's a great language to learn programming, but the RubyCocoa bridge isn't documented well enough that I'd recommend it as a learning environment. You'd be learning general programming concepts, the Cocoa frameworks and the quirks of RubyCocoa all at the same time. That's a lot of stuff to shove into your head.
If you're bound and determined to start with Cocoa, start by learning Objective-C. Otherwise, you could learn Ruby to begin with and then transition to Objective-C once you feel a little more comfortable as a programmer. And once you've done all that, you can use RubyCocoa, but then you'll know enough that it won't make you go crazy.
我将从苹果宣扬的内容开始:Objective-C/Cocoa
I would start with what Apple is preaching: Objective-C/Cocoa
编写代码是容易的部分
没有意义:
尝试看看哪个容易,如果你选择简单的方法,你总是会出错。不要害怕困难,因为困难就是不要害怕。
尝试以这种方式比较语言/方法,根据我添加的帖子,在这种情况下思考什么是简单/好/难是语法问题,最终归结为解释,美在情人眼中.
根据他们最终尝试使用该技术做什么,您会发现某些方法比其他方法“更容易”。简单是一件很难定义的事情
只有一个问题很重要:人们之前知道什么接触过这两种方法中的任何一种吗? ——你说:
适合完全没有编程经验的初学者
我的回答:
经常在我住的地方附近有游客问:
“我如何从这里到达地名 X?”
这里的人通常会回答:
“如果我是你,并且我试图到达地名 X,我就不会从这里开始......”
所以......你的问题的答案是:
都不是
总计初学者应该始终按照@Tafkas所说的学习编程基础知识..(不一定需要学习OOP语言..但编程...),然后再决定学习和/或实现什么。 (这+需求收集)
..否则学习这些语言/技术技能的人将只是另一群脚本小子,正在成为复制粘贴代码猴子
Writing Code is the Easy Part
No point really in:
Try to see which is easy, if you are opting for the easy way, you will always get it wrong.. fear not what is hard, for hard is to fear not.
Trying to compare languages/approaches that way, as per the post I added, thinking what's easy/nice/hard in this case is a question of syntax, which ultimately boils down to interpretation, beauty is in the eye of the beholder.
Depending on what they will ultimately attempt to do with the technology you will find somethings are "easier" than others in one approach or the other..easy is a hard thing to define
Only one question matters: What does one know before being exposed to any of the two approaches? -- you said:
for a total beginner, with little-to-no programming experience
My answer:
Often near where I live tourists ask:
"How do I get to placename X from here?"
People here usually answer:
"If I were you, and I was trying to get to placename X, I wouldn't start from here.."
So.. the answer to your question is:
Neither
Total beginners should always study the basics of programming as per what @Tafkas said.. (not necessarily needing to study OOP languages.. but programming...) before making any kind of decision on what to study and/or implement. (This + requirements gathering)
..Otherwise the people learning these language/technology skills will be just another set of script kiddies on their way to becoming copy paste code monkeys
从 RubyCocoa 开始的问题是,您最终会同时学习 Ruby 和 Cocoa 以及两者之间的交互。 我会说学习 ruby,或者学习 Objective-C/Cocoa。 直接跳入 RubyCocoa 会让你失望。
The problem with starting with RubyCocoa is that you end up learning both ruby and cocoa and the interaction between the two at the same time. I would say learn ruby, or learn Objective-C/Cocoa. Jumping right into RubyCocoa is going to throw you off.
听起来您的目标是学习使用 Cocoa 进行编程,使用 Ruby 或 Objective-C 作为语言。
虽然我从未使用过 Ruby(或 RubyCocoa),但我的理解是 Cocoa 是用 Objective-C 作为主要语言编写的,而桥梁(Python 和 Ruby)位居第二。 虽然它们通常工作良好,但使用 Objective-C 中的 Cocoa 时存在一些不存在的问题。
我想说你应该走 Objective-C/Cocoa 路线。 如果你想学习 C(这会很有用,因为 Objective-C 是 C 的超集),那么先从另一种语言开始可能也不错,如果你想走 OO 路线,那么先从 Java 开始。
这并不是说 RubyCocoa 不起作用或没有用处。 它的功能很棒,但我不认为它是 Cocoa 编程的起点。
It sounds like your goal is to learn to program in Cocoa, using either Ruby or Objective-C as the language.
While I've never used Ruby (or RubyCocoa, for that matter), my understanding is that Cocoa is written with Objective-C as the primary language, and the bridges (Python and Ruby) come in second. While they generally work well, there are some rough edges that aren't there when using Cocoa from Objective-C.
I would say that you should go the Objective-C/Cocoa route. It might not be bad to start with another language first - C if you want to learn it (which would be useful, since Objective-C is a superset of C), or something like Java if you want to go the OO route.
That's not to say that RubyCocoa doesn't work or isn't useful. It's great for what it does, but I don't think that it is the place to start with Cocoa programming.
我建议,如果您想认真地为 OSX 和/或 iPhone 编写应用程序,我强烈建议您尝试一下 Objective-C 和 Cocoa。
原因很简单:
无法保证 Apple 会像更新 Cocoa 一样更新 RubyCocoa。
不要误会我的意思,学习 Ruby 是一门很棒的语言,我认为学习它不会出错。 但是现在,如果您现在可以选择学习或学习,请选择 Objective-C/Cocoa。
I would suggest that if your going to be serious about writing Applications for OSX and/or the iPhone I would highly suggest you get your feet wet with Objective-C and Cocoa.
The reason are simple:
There is no guarantee that Apple will keep RubyCocoa updated as much as they do with Cocoa.
Don't get me wrong, learning Ruby is a great language and I don't think you can go wrong learning it. However right now if you have the option right now to learn either or, go with Objective-C/Cocoa.
我认为,如果您想为 OS X 或特别是后来的 iPhone 构建严肃的应用程序,那么使用 RubyCocoa 会导致您面临一条更艰难的道路。
主要原因是能够找到您可能遇到的常见编程问题的答案。 Objective-C/Cocoa 周围有一个新兴的社区,有很多论坛支持、代码片段、示例等。如果您了解 Objective-C,那么您将更容易快速学习如何使用 Cocoa。 您的同事也可以更轻松地对您的代码进行故障排除,并在您遇到困难时为您提供帮助。 Objective-C 确实并不难学,特别是如果您有一定的 OO 概念基础的话。
I think you're in for a harder road by going with RubyCocoa if you want to build serious applications for either OS X or especially later for the iPhone.
The main reason is simply being able to find answers to common programming questions that you might have. There is a burgeoning community around Objective-C/Cocoa with a lot of forum support, code snippets, samples, etc. It will be infinitely easier for you to rapidly learn how to you use Cocoa if you understand Objective-C. It will also be easier for your peers to troubleshoot your code and help you out when you get stuck. Objective-C is really not that hard to learn, especially if you have some kind of grounding in OO concepts.
我建议从 oo 语言开始,例如 c++ 或 java。 了解了 OO 的基本概念后,学习 Objective-C 应该不会太难。
ruby cocoa 的问题是不能保证苹果将来会支持它。 他们过去已经放弃了可可与爪哇之间的桥梁。
I would suggest to start with an oo language such as c++ or java. After understanding the basic comcepts of oo it should not be to hard to learn objective-c.
The problem with ruby cocoa is that there is no guarantee apple will support this in the future. They have dropped the cocoa-java bridge in the past.
我认为这取决于初学者已经知道多少。 如果你已经了解面向对象编程,那么你绝对应该学习 Objective-C。 以消息传递、委托和类别等范式进行思考将有助于理解 Cocoa 系统。 如果您掌握了几种语言,但没有面向对象编程,那么您可能也有足够的经验通过 Cocoa 学习 OOP,但要了解它处理事物的方式与 C++ 等语言不同。 如果你的编程经验很少,那么短期内 ruby 可能会更好。
需要记住的 Objective-C 的另一个优点是手动引用计数内存管理范例。 它比 malloc/free 更容易处理,但它不允许 Java 和脚本语言产生的惰性。
I think this depends on how much the beginner already knows. If you already know object oriented programming, you should definitely learn objective-c. Thinking in paradigms like messaging, delegation, and categories will help a lot to understand the Cocoa system. If you've got a few languages under your belt, but no object oriented programming, then you probably also have enough experience to learn OOP through Cocoa, but understand that it handles things differently from languages like C++. If you have very little programming experience, then ruby may be better in the short term.
One other advantage of objective-c to keep in mind is the manual reference counting memory management paradigm. It can be much easier to deal with than malloc/free, but it doesn't allow the laziness that Java and scripting languages engender.