Couple of weeks back I happened to meet one of my relative in a family function who is in college studying computer science. He is a tech kid who expected so many things from me when I told I am working in computer field for the last 6 years. He is more interested in creating his own computer game rather than playing .When in college people might not have selected a technology path and will be having knowledge in all most all the areas such as Embedded Systems,.Net,Networking,Java etc...He was not an exception and he started shooting his questions when he met a 6 years experienced professional. The conversation (mainly his doubts) touched so many areas from creating small web sites to programming artificial intelligence systems and controlling device through parallel port to creating a robot.
I was able to survive on the programming topics related to assembly language,C,C++,Java & .Net and how the computer functions internally at the register level. But really failed on Obj C used in iPhone,iPad, Symbian in Nokia, embedded systems and robotics. Finally he asked me “What are you doing in your company related to computer science?” .I had to admit that I am developing a highly generic .Net application for executing workflows which is now targeting auditing workflows. Even I don’t know the auditing business because there is another application to author auditing workflow which is carried out by business analysts. One more thing is we are programming one level up from the real machine and OS .ie we are talking /programming to the .Net and .Net will talk to the machine through OS to carry out the tasks.
The conversation stopped there. But when I think about that I feel there are so many things in high level language club which I don’t know. Learning robotics and programming for embedded systems are not at all in the scope at least now. I applied filters again and came to 3 topics VC++,Android & Obj C. Learning VC++ is delayed because I didn’t get a chance to work. It will not be a problem, if I get a chance. Android uses Java which is again .Net like language. So the remaining is Obj-C which I never tried. Yes my next is Objective-C.
Why should I learn Obj C / benefits of Obj-C
My first reason is the popularity of Apple products and this is the way I can make use of their framework.There are so many iPhone clones. But they cannot get into an agreement that which is the real clone. So iPhone is still the king .As everybody knows Cocoa is the framework to program iPad and iPhone and it need Obj-C. When I started ObjC the usage of class got my attention on the first day itself.We need to have an interface and implementation when we write a simple class itself. We need to share that interface only when we distribute that class. There are lot more reasons when we look at the language level.If you are interested please check the below links
As everybody when we start something fresh we look for teachers. Likewise I checked with the iPhone team in my company .Its 2 new joiners fresh out of college with one Mac and one iPad who got trained in WPF and Silverlight by me .According to them XCode is the only way to execute Objective C and now its licensed and it needs a MAC machine. My upgrade request toWin7 and if possible i7 is pending for months.In this situation asking MAC machine from the company to learn Obj C is not at all a question.Again I am alone and only way is google. I could see couple of ways which helps us to learn objective C in windows. Let’s start with GNUStep which I feel the simple way.
Setting up environment in Windows
You can get detailed instructions and download links from the below sites.
According to my experience you need to install 3 things in the given order
- GNUstep MSYS System
- GNUstep Core
- GNUstep Devel
Compiling & Running first ObjC program
Just write a small C program to output HelloWorld which can be compiled in normal c compilers or through visual studio.Don’t add any ObjC features such as classes.Below is a small sample.
printf("God is Love\n");
I normally starts with “God id Love” rather than “Hello World”.The extension for objective C programs is dot(.)m.Save the above program in helloworld.m.Now we have the sample. Then compile using gcc compiler which will give the .exe file.
If the environment variable is not set properly this may cause some errors.In that case set the environement variables properly. It will be the PATH variable in the environment setup.Successful compilation will give an .exe file. Now execute that exe same as normal exe. Now we are in a position to learn Obj C.Next time other language features such as loops ,select etc…Then go to class and objects.