Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Another question on Objective-C....

Another question on Objective-C....
Thread Tools
Mac_Nacho
Dedicated MacNNer
Join Date: Feb 2001
Location: Buenos Aires, Argentina
Status: Offline
Reply With Quote
Mar 21, 2003, 09:33 AM
 
Hi there forum again...
First, thanks for answering my previous post on C++ and Objective-C. Now I have a better understanding of the differences between them.

Now the question is, is it possible to develop applications in Objective-C for WinTel?
I mean, is Obj-C really used in that platform?
I am a BIG Mac fan but unfortunately I have to work in a Wintel world.


So my ideal is to learn a programming language that could be used to develop applications for both my beloved OsX and hated Wintel.
You know..two for the price of one.


Thanks again.
N
iMac 1GHz 17" Super Drive
iPod 5GB
     
gralem
Dedicated MacNNer
Join Date: Nov 2000
Location: Malaysia
Status: Offline
Reply With Quote
Mar 21, 2003, 10:04 AM
 
Well, I think that answer has many answers. Initially, "NO". You're not going to be able to take (almost) any code you write in objective-c in OSX and be able to port it to Windows.

But, there are objective-c compilers for both windows and linux (gcc is the first one that comes to mind). But being able to code with objective-c in windows DOES NOT mean that you will be able to have access to the foundation classes or AppKit--the 2 most important parts of developing a Cocoa application using objective-c. And I don't think you're going to use it in Visual Studio.

Most use of objective-c (that I know of) is on the OSX platform. I took a quick look at http://pyobjc.sourceforge.net/ and it even states that the project is focused on OSX and Darwin platforms. (pyobjc is a python-objective-c bridge--I thought that perhaps it would allow you to use python as the front-end on a windows machine and obj-c for the main coding--not going to happen).

There is one option for using your objective-c programs right out of OSX onto windows. If you install WebObjects developer (sorry to bring this up here), you will get objective-c foundation and AppKit classes/headers/interface builder/pbwo--everything you need to code/build/run AppKit based applications on windows. It actually runs quite smoothly. I wrote a calculator app that used the exact same obj-c code from OSX. I didn't even try to use the .nib (may work though). So I rebuilt the interface from scratch. I don't know how easy it is to deploy. I don't really do windows. I would presume that you need 1 copy of WO deployment for every machine that wanted to run my little calculator. Not the cheapest license in the world for a calc app.

Hope it helps. I really don't know of anyone programming in objective-c for windows.

---gralem
     
Mac_Nacho  (op)
Dedicated MacNNer
Join Date: Feb 2001
Location: Buenos Aires, Argentina
Status: Offline
Reply With Quote
Mar 21, 2003, 10:22 AM
 
Yes, that helped a lot.
Thanks
iMac 1GHz 17" Super Drive
iPod 5GB
     
alien
Mac Enthusiast
Join Date: Jan 2002
Location: Trondhjem, Norway
Status: Offline
Reply With Quote
Mar 21, 2003, 06:57 PM
 
The closest you'll get to ObjC/Cocoa outside OS X is GnuStep, www.gnustep.org

This is a quote from their FAQ:

1.1.4 Does GNUstep run on Windows?

The primary targets for GNUstep are free 'Unix' platforms such as GNU/Linux.

That being said, the base library should run on Windows-NT,98 with the Cygwin unix emulation library from Cygnus (http://sourceware.cygnus.com/cygwin/) or the MinGW libraries. At present there are a few problems with networking (Distributed Objects) support, but the library is believed to work.

The gui library needs a win32 backend library to work under Windows-NT. The backend library is a thin layer that converts the GNUstep methods to handle drawing of GUI elements to calls to the win32 API. This is a project is in an alpha state.

The application-wrapper used for GNUstep already allows for multiple binaries to be stored for different systems, so you should be able to write once, deploy anywhere.
     
Mac_Nacho  (op)
Dedicated MacNNer
Join Date: Feb 2001
Location: Buenos Aires, Argentina
Status: Offline
Reply With Quote
Mar 22, 2003, 07:13 PM
 
I'm looking GNUstep at the moment and seems to be a pretty interesting project!
thanks for the link
iMac 1GHz 17" Super Drive
iPod 5GB
     
joltguy
Mac Enthusiast
Join Date: May 2001
Location: 127.0.0.1
Status: Offline
Reply With Quote
Mar 23, 2003, 12:28 AM
 
Originally posted by Mac_Nacho:

So my ideal is to learn a programming language that could be used to develop applications for both my beloved OsX and hated Wintel.
You know..two for the price of one.
I know the topic of this thread ties it to Objective C, but if you really want to develop apps that run [almost] seamlessly on both platforms, learn Java. Sorry, it had to be said.

On OS X, the Java experience is top notch, allowing you to build "native" OS X apps with the Cocoa frameworks. Of course, if you go this route, you will lose the cross-platform capability. With the recently released Java 1.4.1 environment, Apple really pumped up the performance of Swing, meaning you can build your UI in pure Java and still get more than acceptable performance. Then you can take your app and run it on Windoze (or even Linux)... and you don't even need to re-compile. Nice.
     
alien
Mac Enthusiast
Join Date: Jan 2002
Location: Trondhjem, Norway
Status: Offline
Reply With Quote
Mar 24, 2003, 06:45 AM
 
Originally posted by joltguy:
I know the topic of this thread ties it to Objective C, but if you really want to develop apps that run [almost] seamlessly on both platforms, learn Java. Sorry, it had to be said.

On OS X, the Java experience is top notch, allowing you to build "native" OS X apps with the Cocoa frameworks. Of course, if you go this route, you will lose the cross-platform capability. With the recently released Java 1.4.1 environment, Apple really pumped up the performance of Swing, meaning you can build your UI in pure Java and still get more than acceptable performance. Then you can take your app and run it on Windoze (or even Linux)... and you don't even need to re-compile. Nice.
Agreed. Though there are still many "issues" with Java on OS X, things are improving rapidly it seems. And at both universities and in the IT biz, Java is nearly omnipresent these days.
     
Mac_Nacho  (op)
Dedicated MacNNer
Join Date: Feb 2001
Location: Buenos Aires, Argentina
Status: Offline
Reply With Quote
Mar 24, 2003, 09:07 AM
 
Joltguy, actually your answer has been very helpful. I will devote a lot of time to learn a new programming language and I was pretty sure that I had to choose between C++ and Obj-C.
I never really thought about Java, now I'm considering it too.
The fact that code is can be easely ported between Os X and Wintel it's really a plus.
Thanks a lot for your comment.
I will defenitely devote some time to really define what language to learn...
For what I saw, Java seems to derive from C too, isn�t it?
Thanks
iMac 1GHz 17" Super Drive
iPod 5GB
     
joltguy
Mac Enthusiast
Join Date: May 2001
Location: 127.0.0.1
Status: Offline
Reply With Quote
Mar 25, 2003, 08:49 AM
 
Originally posted by Mac_Nacho:
...
I never really thought about Java, now I'm considering it too.


Excellent! It is a fun language to learn, and there is a metric tonne of helpful information available on the web.

...
For what I saw, Java seems to derive from C too, isn�t it?
Thanks
There may be some thowbacks to C, but if you had to choose an ancestor, C++ is probably the closer relation, due to the OOP methodology.

Good luck!
     
WJMoore
Grizzled Veteran
Join Date: Jan 2002
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Mar 26, 2003, 12:31 AM
 
The only example of a non-OS X Obj-C program I have come across is swarm. Java is ok IMHO as long as you don't want to get too serious. If you really want a top notch "native" application you have to use a more native environement, of course you lose pretty much all cross platform functionality on the process.

Wesley
     
Mac_Nacho  (op)
Dedicated MacNNer
Join Date: Feb 2001
Location: Buenos Aires, Argentina
Status: Offline
Reply With Quote
Mar 26, 2003, 09:25 AM
 
It's so difficult to decided what to learn...I know I will have to devote a lot of time to learn a programming language. I think I'm far from deciding where I should go.
There so many chocices.
Learn just C
Learn C++
Learn Obj-C
Learn Java
Learn C#
I want to learn a language it's not tied to one platform (which leads me to C, C++, Java).
Java seems to be kind of slow (isn't it?)
C++ seens to be a bitch to learn
and C is not used anymore
I'm lost honestly...
iMac 1GHz 17" Super Drive
iPod 5GB
     
mmj_ngen
Junior Member
Join Date: Mar 2001
Status: Offline
Reply With Quote
Mar 26, 2003, 10:06 AM
 
Originally posted by Mac_Nacho:
I want to learn a language it's not tied to one platform (which leads me to C, C++, Java).
Java seems to be kind of slow (isn't it?)
C++ seens to be a bitch to learn
and C is not used anymore
I'm lost honestly...
Java can be slow depending on what you are building. It would probably be the easiest to learn if you are just experimenting.

C is still used. It's just a frustrating to use sometimes if you are used to object oriented programming.

From what you have stated, I'd recommend C++. By learning C++, you will learn the importance of certain things that other languages like Java and C# try to protect you from (dynamic memory management). You will probably appreciate those languages much more once you learn them. Also, C++ will introduce you to some of the concepts of object oriented programming, which you wouldn't get from just using C.

If you go the multi-platform C++ route, you may want to consider Qt or better yet wxWindows .

wxWindows maps to native widgets and is free. I beleive that you can also use Python with the toolkit. It's still a little buggy depending on what you are doing, but it's really moving along. I've only dabbled with it, but it seems to have less of a learning curve for simple apps than some of the native frameworks(to which it maps on each platform) such MFC(Windows) and Carbon.

Another nicety of wxWindows, in your case, is that it only uses a subset of C++ in order to ensure a high degree of platform compatibility. For example, STL isn't used because of the great variation of implementations on the different supported platforms. Although, they do offer their own string classes, etc. In other words, you would only need to learn the core language of C++ to start working with wxWindows. You can always incorporate more advanced C++ features at your discretion.
     
Mac_Nacho  (op)
Dedicated MacNNer
Join Date: Feb 2001
Location: Buenos Aires, Argentina
Status: Offline
Reply With Quote
Mar 26, 2003, 10:45 AM
 
mmj, wxWindows seems to really rock!
and seems to be a really active project.
Thanks for the link, really helps
N
iMac 1GHz 17" Super Drive
iPod 5GB
     
Mskr
Forum Regular
Join Date: Jun 2001
Location: Savoy, IL USA
Status: Offline
Reply With Quote
Mar 26, 2003, 03:28 PM
 
Originally posted by Mac_Nacho:
It's so difficult to decided what to learn...I know I will have to devote a lot of time to learn a programming language. I think I'm far from deciding where I should go.
There so many chocices.
Learn just C
Learn C++
Learn Obj-C
Learn Java
Learn C#
I want to learn a language it's not tied to one platform (which leads me to C, C++, Java).
Java seems to be kind of slow (isn't it?)
C++ seens to be a bitch to learn
and C is not used anymore
I'm lost honestly...
My advice is: Learn (just) C first, then pick up Obj-C if you are going to develop on Mac OS X. The others are all derived from C, so to say "C is not used anymore" is not really accurate (well, also because C is used everyday by tons of developers everywhere, especially on UNIX). If you don't understand the core C components of C++ or Obj-C, you'll get yourself into a lot of trouble (I'm mainly thinking about pointer logic), or you'll be doing things very inefficiently. So, learn C first (really, "just" the basic to intermediate levels of C), then learn Obj-C or C++, or whatever. Or, hell, if you like a challenge, learn C and Obj-C side-by-side at the same time. But you can't get away from C syntax or C ideas if you use a C derivative (which includes all the languages you've just listed).

Personally, I think Java is a waste of time, but that's because I'm a C++ snob. Actually, I find Obj-C easier to use, and much faster to develop in for Mac OS X, mainly because of Cocoa.
Software Architect, CodeTek Studios, Inc.

12" AlBook 867 (Combo drive) 640 MB/40 GB (work development machine) -- TiBook 400MHz/384MB/10GB (home machine)
CodeTek VirtualDesktop Pro: Power multitasking! -- DockExtender: Powerful, efficient launcher for Apps, Docs and everything else!
     
juanpacolopez
Dedicated MacNNer
Join Date: May 2003
Location: Atlanta, GA
Status: Offline
Reply With Quote
Sep 26, 2003, 12:32 PM
 
Originally posted by Mac_Nacho:
Hi there forum again...
First, thanks for answering my previous post on C++ and Objective-C. Now I have a better understanding of the differences between them.

Now the question is, is it possible to develop applications in Objective-C for WinTel?
I mean, is Obj-C really used in that platform?
I am a BIG Mac fan but unfortunately I have to work in a Wintel world.


So my ideal is to learn a programming language that could be used to develop applications for both my beloved OsX and hated Wintel.
You know..two for the price of one.


Thanks again.
N
I'll chime in with my 2 cents...

I agree with a previous poster; learn basic, straight, boring 'ol ANSI C first. If you have a basic understanding of C, you can pick up either Obj-C or C++ at your option in a matter of days.

Once you understand the basics of a procedural language like C, and you pick up the basic understanding of object orientation, learning either Obj-C or C++ syntax is trivial at most.

The VAST majority of what you'll need to "learn" to write native GUI apps are platform-specific API's anyways. I could teach a monkey to code in straight Objective-C in a day or two.... it's learning the Cocoa API that could take a lifetime. The MFC API's used in Windows development (Visual Studio at least) are similarly magnificent in scale....

Unless you use Java/Swing for everything (not recommended for high-performance GUI apps) you'll HAVE to learn a different API for each platform, so you might as well get used to the idea.

Past that, if you already have a working knowledge of C, as I said earlier, picking up Obj-C and C++ (both) would be a fairly trivial time investment.
Alex

G7 Software: home Tetrinet Aqua
-----
"Utopia" 1Ghz TiBook SuperDrive w/ 1Gb RAM.
     
theolein
Addicted to MacNN
Join Date: Feb 2001
Location: zurich, switzerland
Status: Offline
Reply With Quote
Sep 27, 2003, 10:23 AM
 
I would second the C++ option, using wxWindows as a starter. Qt from Trolltech, is probably more advanced but isn't free on Windows (think $3000 or so). C++ is still probably the most widely used language for native application development.

There is a line of thought that says you should avoid C and go straight to C++, learning the basics that you would learn in C in C++ instead, as C++ has some minor but important differences to C.

That said, if you're going to make a living on Windows, while MFC is certainly going to be around for many years, it might not be a bad idea to buy a version of C++.Net right now (it's not that expensive, around $100 I think) to start coding C++ under .Net, as .Net is probably where most Windows developers will be moving over the years.
weird wabbit
     
theolein
Addicted to MacNN
Join Date: Feb 2001
Location: zurich, switzerland
Status: Offline
Reply With Quote
Sep 27, 2003, 10:26 AM
 
Originally posted by juanpacolopez:
...

Unless you use Java/Swing for everything (not recommended for high-performance GUI apps) you'll HAVE to learn a different API for each platform, so you might as well get used to the idea.
...
Eclipse's SWT is an alternative to Swing, is fast, native and also available on OSX in the meantime is it not?
weird wabbit
     
Catfish_Man
Mac Elite
Join Date: Aug 2001
Status: Offline
Reply With Quote
Sep 27, 2003, 01:37 PM
 
Originally posted by theolein:
Eclipse's SWT is an alternative to Swing, is fast, native and also available on OSX in the meantime is it not?
Eclipse is dog slow on OSX.... grrrrr....
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 04:58 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,