开发者

If I start learning C on Ubuntu will it give me an edge when I start learning Objective-C later this summer? [closed]

开发者 https://www.devze.com 2022-12-30 15:35 出处:网络
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, r开发者_C百科eferences,or expertise, but this question will likely solic
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, r开发者_C百科eferences, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 10 years ago.

I know Ruby right now, however I want to learn a new language. I am running Ubuntu 10.04 right now but I am going to get a Mac later this summer. Anyways I want something more for GUI development. I was wondering if I should learn C on Ubuntu right now, and then learn Objective-C when I get an iMac? Will learning C give me an edge? Or should I just learn Python on Ubuntu and then learn Objective-C when I get a new computer?


It's frequently helpful to learn programming languages in the order they were created. The folks that wrote Objective-C clearly had C and its syntax, peculiarities, and features in mind when they defined the language. It can't hurt you to learn C now. You may have some insight into why Objective-C is structured the way it is later.

C has a great, classic book on it, The C Programming Language by Kernighan & Ritchie, which is short and easy to digest if you already have another language under your belt.


Sure Objective-C is quite easier to learn if you know C and quite a few books on Objective-C even asume you know C.

Also consider learning a bit about MacRuby for GUI development ;)


If you're going to start learning C on Linux, you'll want to start out with Glib and GObject... Gtk for GUI, etc. They are the most pervasive and easy to learn libraries for doing many things which are sadly left out of the standard C library.

You'll get some sense of object oriented design since GObject implements a type system on top of C, but the syntax will probably confuse you more than help as you move to Objective-C. For instance, all function names in C are in a global scope, depending on what includes your source file references. Groups of functions for operating on a certain set of types tend to be prefixed the same, using the name of the object type they belong to.

gtk_widget_show_all(widget);

vs.

widget.showAll();

It's only a syntactic difference as there is a very real type system implemented, it's just not part of the C language, but implemented on top of it by GObject. There are great tutorials on GLib and GObject to get you started.


Learning C will definitely be of help, as Objective C inherits its many properties and adds to it.

You could learn Objective C either from 'Learn Objective C on the Mac', this one's really a great book, and then if you plan to learn cocoa, get 'Learn Cocoa on the Mac' or the one by James Davidson, they should give you a fine head start, you can then consider moving to the one by Hillegass, and for a stunner 'Objective C developer handbook' by David Chisnall, this is a keeper, you can read it in a month or two.

For the compiler I would point you to clang though a gcc and gnustep combination will work. clang is a better choice if you want to work on Obj C 2.0 features and it is under heavy development.


Yes. Learn how to program in C.

0

精彩评论

暂无评论...
验证码 换一张
取 消