I'm going to start Objective-C programming soon

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
ElmerCoder
Posts: 10
Joined: March 5th, 2013, 8:00 pm

I'm going to start Objective-C programming soon

Post by ElmerCoder » April 11th, 2013, 5:48 am

Hi, I've been following all the 22 beginner videos and I've ordered 2 books. One about c programming and one about c++.
But I want to start to learn Objective-C as soon as possible also.
Which one should i start reading ?
c or c++.
On a site they said it's easier to go from c++ to objective-c.
I don't know which one I should read first, please help!! :)

Actually I'm not sure if I would buy an IMac to be able to program in app store.
I'm going to get a MacBook when I start High School ( everyone will get one )
I'm in the 9th grade atm.
Do you guys know if you can get as many downloads as in app store in android market for example?
Is it a big difference between downloads in App store and in Android market?
Would like to know because if I start learning a lot of coding I'm going to make a game that I've been thinking of in my brain, etc.. :)

User avatar
Xanderxavier
Posts: 9
Joined: July 27th, 2012, 5:32 pm

Re: I'm going to start Objective-C programming soon

Post by Xanderxavier » April 11th, 2013, 12:55 pm

Any C code tends to work in Objective C, so theoretically any book on C should be done before C++ or objective C, however your suppose to use objective C in a different manor then C, so any C code in objective C whilst it will function will not be "objective C", similar to C in C++.

If you spent to "Long" working on C it may begin to be harder to learn C++, but meh, chile's beginner series teaches you C with a few C++ bits thrown in and his intermediate C++, so I guess its not to important which you do 1st, toss a coin or something.

However when they say its easier to move from C++ to objective C they are also correct, they mean that long term C programmers who have learned to think of programs, and program in C will have a harder time moving to Objective C, then C++ programmers, this is because C is not generally object orientated, so knowing C++ will mean you think of things in terms of objects, which will help you in objective C, whilst knowing in C will provide you with no such advantage, however the syntax is different, so it wont help you from an actual coding perspective but from a conceptual one.

C++ is a object orientated language, initially a superset of C, but has moved beyond C by providing its own version of nearly everything whilst retaining backwards compatibility, like C++, Objective-C is also a superset of C, but much more thin, this adds the smalltalk messaging system to C, put simply C++ & Objective C are 2 different ways to modify C, both are based on C but both have moved beyond it, in their own specific way, though C++ is in some ways further removed.

I think the wiki page http://en.wikipedia.org/wiki/Objective-C provides useful information on the differences between C & Objective C: here's the most pertinent bit's from that page:
Objective-C is a thin layer on top of C, and moreover is a strict superset of C; it is possible to compile any C program with an Objective-C compiler, and to freely include C code within an Objective-C class.

Objective-C derives its object syntax from Smalltalk. All of the syntax for non-object-oriented operations (including primitive variables, pre-processing, expressions, function declarations, and function calls) are identical to that of C, while the syntax for object-oriented features is an implementation of Smalltalk-style messaging.

Messages
The Objective-C model of object-oriented programming is based on message passing to object instances. In Objective-C one does not simply call a method; one sends a message. This is unlike the Simula-style programming model used by C++. The difference between these two concepts is in how the code referenced by the method or message name is executed. In a Simula-style language, the method name is in most cases bound to a section of code in the target class by the compiler. In Smalltalk and Objective-C, the target of a message is resolved at runtime, with the receiving object itself interpreting the message. A method is identified by a selector or SEL — a NUL-terminated string representing its name — and resolved to a C method pointer implementing it: an IMP.[6] A consequence of this is that the message-passing system has no type checking. The object to which the message is directed — the receiver — is not guaranteed to respond to a message, and if it does not, it simply raises an exception.[7]

Sending the message method to the object pointed to by the pointer obj would require the following code in C++:
obj->method(argument);
In Objective-C, this is written as follows:
[obj method:argument];

Both styles of programming have their strengths and weaknesses. Object-oriented programming in the Simula style allows multiple inheritance and faster execution by using compile-time binding whenever possible, but it does not support dynamic binding by default. It also forces all methods to have a corresponding implementation unless they are abstract. Smalltalk-style programming allows messages to go unimplemented, with the method resolved to its implementation at runtime. For example, a message may be sent to a collection of objects, to which only some will be expected to respond, without fear of producing runtime errors. Message passing also does not require that an object be defined at compile time. An implementation is still required for the method to be called in the derived object. (See the dynamic typing section below for more advantages of dynamic (late) binding.)
The Mobile market on Apple App Store & Android market is a bit of a lottery for indie devs, even with a good quality game:
http://www.gamesindustry.biz/articles/2 ... elunky-dev

On a side note theres a hell of allot more androids out there then iphones, unfortunately theres also a hell of allot more android games in its store then the iphone store, not that the app store isnt swamped in its own right, so theres no clear picture, its pot luck everywhere you look.

You might find this article (not to mention the site) useful, meh you can make do with a mac mini for making stuff on mac, damn site cheaper, and as long as you not planning to use it as your main pc does the job, apple stuff is all expensive and frankly not worth it, better off buying and building your own pc from components get a pc for 1/4 of the cost with twice the performance, and stick any os you like on it, or even several,

Gl to ya

ElmerCoder
Posts: 10
Joined: March 5th, 2013, 8:00 pm

Re: I'm going to start Objective-C programming soon

Post by ElmerCoder » April 11th, 2013, 4:28 pm

Thanks a lot for the answer, it was a great answer, I'll probably start reading the c book and then go on to c++
When I've read both I'm going to start learning Objective-C
I will probably make Android games most :).
I'll tell planetchili when I've uploaded my first app!
Thanks again.

User avatar
Xanderxavier
Posts: 9
Joined: July 27th, 2012, 5:32 pm

Re: I'm going to start Objective-C programming soon

Post by Xanderxavier » April 11th, 2013, 5:12 pm

np, btw, dont forget Ouya, the new kickstarted console, may well be perfect for indie dev's, and its android based.

Err http://www.kickstarter.com/projects/ouy ... me-console

Link to official site on there.

ElmerCoder
Posts: 10
Joined: March 5th, 2013, 8:00 pm

Re: I'm going to start Objective-C programming soon

Post by ElmerCoder » April 12th, 2013, 6:47 pm

Wow that looks awesome, unfortunately i wont be able to make such a nice game for them if I'm able to :P
Just got my books today and started reading the C book :D, I'm on page 30 something.
Now I'm going to continue reading, thanks!

ElmerCoder
Posts: 10
Joined: March 5th, 2013, 8:00 pm

Re: I'm going to start Objective-C programming soon

Post by ElmerCoder » April 12th, 2013, 7:10 pm

Btw i haven't found out if you can use Objective-C to program Android apps.
I know that c and c++ works but they say it's a bit of a problem there. Do you know anything about it?

User avatar
Xanderxavier
Posts: 9
Joined: July 27th, 2012, 5:32 pm

Re: I'm going to start Objective-C programming soon

Post by Xanderxavier » April 18th, 2013, 3:45 pm

Not to much personally at this point other then the general gist of things, I'm working on making my own Cross-platform engine complete with SDK, eventually I plan on incorporating Windows Phone, Android & Iphone "modes" within the engine so you can do all the work on one tool, which can then output the game in the target platform of your choice (obv this includes web (HTML5 & opengl es2 with javascript, and hopefully consoles, linux, mac etc), obviously mobile development have restrictions so you will have to set the type of project from the beginning, else set limits on the project for mobile or so on targeted for mobile environment somewhere to allow it to run, wont be much of an issue with Windows Mobile or android development, but ios will require some support from iOS to make said middle-ware possible, so probably will be a while.

However being neck deep in engine-code atm and being the lead programmer (and its using my engine, 2d mode) on one joint project and also being the well everything on two other (entirely my) game projects (1 on my engine also, 3d) and one on cryengine3 , I don't have the time to more than cursorily glance at it for now, I will eventually get into it, but not right now however I do have a little info for you, you will find of use:


Err found this article :
http://www.computerworld.com/s/article/ ... s_and_cons

May be of use:
Programming languages
For developers who have one app in mind and envision their code running on multiple mobile platforms, the going is rough in today's world.

Android apps are written in the Java programming language. Many developers have made careers in enterprises by becoming very proficient in Java, so developing for the Android platform is a natural fit for those folks.

On the other hand, applications that run natively on the iPhone operating system are written in Apple's Objective-C, a dialect of the more common C language that has elements of Smalltalk. (Technically speaking, Objective-C is a small, strict superset language on top of C, so any C program will compile with an Objective-C compiler, and a developer can include C code within an Objective-C class.) Developers who have spent their careers working with C and C++ probably won't find Objective-C to be a difficult language to pick up, although there may be speed bumps along the way.

"There is no obvious way to write one set of code that targets both platforms," says Matthew Baxter-Reynolds, director of AMX Software Ltd., a software development firm in England, and author of the upcoming book Multimobile Development: Building Applications for Any Smartphone. "You cannot run Java on iPhone, and you cannot run Objective-C on Android."
I put the most important bit in bold, some multiple environment apis are linked in article which may be of use also:

http://www.androidcentral.com/google-de ... ive-c-code

The above Google developed tool may be of some use, designed to make it easy to port code between the languages, with some limitations, ultimately you need to learn both to some degree, fortunately both Java and Objective C are "C like" languages so learning them wont be to difficult hopefully with time and patience and attention to detail, however some people have no problems learning and using multiple programming languages, others get all mixed up if they use more than one, only way to find out which type you are is to try it alas.

Gl to you :)

Post Reply