Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

whooleytoo

macrumors 604
Aug 2, 2002
6,607
716
Cork, Ireland.
The advantage of going with Java, is that your code (and equally importantly - your skills) are very portable.

The disadvantage is, it's too easy. Yes, too easy - a bit like Visual Basic on the PC - a lot of developers can write programs without understanding a lot of the underlying concepts which they need to know. In that respect, I can see why a lot of colleges here teach C++ and assembler first, then Java later on.

I haven't done much Java development on OSX, but if code portability wasn't my primary concern, I'd go for Objective C & Cocoa.
 

cube

Suspended
May 10, 2004
17,011
4,973
Nuc said:
I'm looking to possibly write programs (more or less modeling e.g. atmospheric transport) which requires numerical integration and such.

What do you guys suggest...

Nuc

Use this to narrow down the choices.

Note that some languages let you call Fortran, C (and from there C++), and maybe others.

But what about developing using Maple?
 

jsw

Moderator emeritus
Mar 16, 2004
22,910
44
Andover, MA
macbaseball said:
I'm a bit confused: Should I learn Java or Cocoa. They both seem to be useful, as I could make either widgets or applications.
There are vastly more Java books and resources out there than there are for Cocoa. That said, Cocoa (really, Objective-C with OS X's libraries) is a better choice for Mac-centric development.

You might want to try starting to learn both. One will likely seem more natural to you after a few days, and that's probably the best one to learn first.
 

Nuc

macrumors 6502a
Jan 20, 2003
798
6
TN
cube said:
Use this to narrow down the choices.

Note that some languages let you call Fortran, C (and from there C++), and maybe others.

But what about developing using Maple?
I've used Maple however I've never done anything extensive in it. Are you able to write a code in maple. I think I've seen this done but I don't know to what extent you can write one. I know in Matlab you can do this kind of stuff, but I've never used it.

Nuc
 

CmdrLaForge

macrumors 601
Feb 26, 2003
4,644
3,144
around the world
jsw said:
There are vastly more Java books and resources out there than there are for Cocoa. That said, Cocoa (really, Objective-C with OS X's libraries) is a better choice for Mac-centric development.

You might want to try starting to learn both. One will likely seem more natural to you after a few days, and that's probably the best one to learn first.

If you already know Java - how difficult is it to pick-up Objective-C ? Is that the only option for writing OS X apps with a nice GUI?

Cheers
 

macbaseball

macrumors 6502a
Feb 27, 2005
987
0
Northern California
jsw said:
There are vastly more Java books and resources out there than there are for Cocoa. That said, Cocoa (really, Objective-C with OS X's libraries) is a better choice for Mac-centric development.

You might want to try starting to learn both. One will likely seem more natural to you after a few days, and that's probably the best one to learn first.

Ok, thank you. I think I'm going to pick up some books this weekend...
 

cube

Suspended
May 10, 2004
17,011
4,973
Nuc said:
I've used Maple however I've never done anything extensive in it. Are you able to write a code in maple. I think I've seen this done but I don't know to what extent you can write one. I know in Matlab you can do this kind of stuff, but I've never used it.

Nuc

From Maplesoft's site:

- Language optimized for mathematics saves days of development time
- Customize user interface via Maplets or Maple documents with embedded GUI components
- High-performance hardware-based floating-point computations including ability to compile user functions
- Easy connectivity to MapleNet, other applications and Web sites
- Automatic source code generation in C, Fortran, Java, MATLAB, and Visual Basic
 

freiheit

macrumors 6502a
Jul 20, 2004
643
90
California
macbaseball said:
I'm a bit confused: Should I learn Java or Cocoa. They both seem to be useful, as I could make either widgets or applications.

You can use Cocoa with Java. Cocoa is a framework to tap into system resources and do fancy GUI stuff. Java is a language that takes input, does some processing, and makes output. You can use Cocoa with Objective-C or with Java -- there's even an in-development tool to use Cocoa with the C# language.

Even if you only use XCode's Interface Builder to make a GUI interface and use Java for all the back-end work, you will have successfully used Cocoa with Java. A good place to start by doing some simple beginning programs is Apple's own developer website. They have at least one XCode+Java tutorial, and XCode is already bundled with MacOS X so there's no cost involved to try it out.
 

Catfish_Man

macrumors 68030
Sep 13, 2001
2,579
2
Portland, OR
CmdrLaForge said:
If you already know Java - how difficult is it to pick-up Objective-C ? Is that the only option for writing OS X apps with a nice GUI?

Cheers

I picked up basic ObjC in a week from a working knowledge of Java and a tiny bit of C/C++ knowledge. The only thing that'll bite you is memory management. Reference counting is much less painful than manual mem management, but it can't compare to garbage collection. The advantage of learning ObjC is that a) it's a pretty decent language, and b) it has the best access to Cocoa (Java works with Cocoa, but the API reads like it was written for ObjC, which it was). Cocoa makes all the trouble worthwhile. Also, ObjC is getting garbage collection in a future version of OSX :D (the compiler flag is in there now, it just doesn't work yet).


In response to the original poster: Java is an excellent choice as a learning language. It's used a lot in the real world, is heavily documented, is cross platform, and shields you from some of the more obnoxious bits of programming (manual memory management in particular). From there I moved to Objective-C, but that really depends on whether you're interested in Mac-centric development or more of a variety. I also second the recommendation of Eclipse, but with the note that it's really overkill for beginning projects; like using nuclear weaponry on mosquitoes. I use subethaedit for small projects (with "small" here being defined as one or two classes and less than 300 or so lines of code).
 

HiRez

macrumors 603
Jan 6, 2004
6,265
2,629
Western US
IMHO...

Best for learning procedural programming: C
Best for learning OO programming: Java
Best for backend server coding: Java
Best for web site coding: PHP
Best for Mac programming: Objective-C + Cocoa
Best for cross-platform scripting: Python
Best for Mac scripting with GUI: AppleScript

The good news is all of these and more are available on the Mac, many installed by default. I would definitely start with Java, as it is cross-platform, embodies most object-oriented concepts, has a fairly easy syntax, a huge number of libraries to do almost anything you want, and most importantly has a massive amount of resources available, both in printed form and online. If you have a question about Java or need to find a tutorial or an example app, you can usually do it very quickly if you're using Java. Having said that, I'll tell you I haven't touched Java much since I started Cocoa programming. It's so powerful and so much fun, it's hard to go back. I haven't found anything even close to it for coding GUI desktop apps.
 

Nermal

Moderator
Staff member
Dec 7, 2002
20,973
4,542
New Zealand
This thread inspired me to download Sun's Java Studio Creator, for making web apps. After about 2 hours, I still haven't figured out how to make a simple adder (two text fields, a button, and an output - the intention was to put two numbers into the text fields, click the button, and get the sum in the output field). Java seems too complex for me, back to VB it is :eek:
 

macbaseball

macrumors 6502a
Feb 27, 2005
987
0
Northern California
Nermal said:
This thread inspired me to download Sun's Java Studio Creator, for making web apps. After about 2 hours, I still haven't figured out how to make a simple adder (two text fields, a button, and an output - the intention was to put two numbers into the text fields, click the button, and get the sum in the output field). Java seems too complex for me, back to VB it is :eek:

Get a book. You could follow the tutorials. I'm sure it would make it a lot easier than opening Sun's Java Studio Creator, and just starting.
 

Nermal

Moderator
Staff member
Dec 7, 2002
20,973
4,542
New Zealand
macbaseball said:
Get a book. You could follow the tutorials. I'm sure it would make it a lot easier than opening Sun's Java Studio Creator, and just starting.

I taught myself .NET without a book :) I just grabbed a copy of Visual Studio (Microsoft NZ was giving away free 6-month trials a few years ago) and fiddled with it. I'm sure I picked up the basics a lot quicker than with Java.

Dim FirstValue As Integer = TextBox1.Text <- this works
int firstValue = textField1.getValue(); <- this doesn't

Show me how to do that, and I'll give Java another chance :)
 

Zion Grail

macrumors regular
Dec 24, 2002
104
0
Chicagoland
For learning Java (my favorite programming language), here's the book. Link.

And I do mean the book. (Man, I'm like a freaking advertising over here. I guess it's just a result of seeing a bunch of people asking about learning Java, though.) I have a lot of Java books, and this blows 'em all away.
 

Zion Grail

macrumors regular
Dec 24, 2002
104
0
Chicagoland
jobutex said:
Be sure and brush up on your Hindi, too, because programming jobs are becoming really, really scarce outside of India, China, *slavia, Ireland, etc. I would recommend going into network, system administration, or storage for a job in I/T. Scripting languages like Perl, Python, and Ruby are much more of an asset in these situations.

IMHO, if you really want to learn how to program, skip Java. You have to deal with too much of the interface programming, unless you're doing strictly command line stuff, and Java isn't well suited for that. Learn Perl, Python, or get the books "A Book on C" or "C by Dissection" by Kelly and Pohl. Excellent books on C programming for the beginner.

If you just want to learn to program the Mac for fun, get "Programming in Objective-C" and "Cocoa Pogramming for Mac OS X." That will introduce you to object oriented programming and programming specifically for the Mac.

Why do I not like Java? It's closed source, meaning its future direction is dictated by Sun, who doesn't have a really good track record at a lot of other projects.

The reason Sun won't release the Java code is because we'll then have a million different versions of it flying around and they won't be perfectly compatible. There'll be a Microsoft version, IBM version, Joe-Bob's-basement version, etc. With Sun at the helm, they can ensure cross-platform compatibility. That's Java's big advantage - write once, run anywhere.
 

DeepIn2U

macrumors G5
May 30, 2002
13,047
6,983
Toronto, Ontario, Canada
Zion Grail said:
The reason Sun won't release the Java code is because we'll then have a million different versions of it flying around and they won't be perfectly compatible. That's Java's big advantage - write once, run anywhere.
Taking right from the source.

I know nothing, absolutely NOTHING about programming. I tried Java, really tried and I found that most of it even from Sun; assumes that you have some basic knowledge of C programming.

C, C+, C++, C#, Objective-C, what the hell is the difference?! Can anyone describe in laymans terms their differences, please? Also, how can one be a programmer in any language when the true core of assembling that code, is done via an application that translates it to something the Operating System or cpu can understand? My head really hurts trying to understand this fundamental - mental, hmm.

Seriously though; I understand Java has the advantage of running on a cellular phone directly in a runtime environment, but what about any C type program? I'm interested in learning the code needed to make Series60 applications for Nokia's Symbian smartphone.

Lastly, I'll be seriously learning PHP, Apache, and MySQL - which I find as administration for running a personal website.

Looking forward to that Infiniti FX-45 ;)
 

broken_keyboard

macrumors 65816
Apr 19, 2004
1,144
0
Secret Moon base
Nermal said:
Dim FirstValue As Integer = TextBox1.Text <- this works
int firstValue = textField1.getValue(); <- this doesn't

Show me how to do that, and I'll give Java another chance :)

int firstValue = Integer.parseInt(textField1.getValue());
 

caveman_uk

Guest
Feb 17, 2003
2,390
1
Hitchin, Herts, UK
Prom1 said:
C, C+, C++, C#, Objective-C, what the hell is the difference?! Can anyone describe in laymans terms their differences, please? Also, how can one be a programmer in any language when the true core of assembling that code, is done via an application that translates it to something the Operating System or cpu can understand? My head really hurts trying to understand this fundamental
I don't know about the others as I have never used them. C is a relatively simple language that allows you to do pretty much anything if you know how to do it. Requires extensive use of memory pointers to get stuff done - man I hate all those '&'s and *'s. C++ and objective-C are both supersets of C -meaning they both take C and extend it. They both extend it in different ways. C++ is a much larger language than objective-C. Objective-C on the mac gets it's power and ease of use from the Cocoa frameworks - not the language itself. Objective-C is much more dynamically typed than C++.

You can be a progarmmer in any computer language you want - just because you can't program in binary doesn't mean you aren't one. It's similar to saying that you can't possibly speak a language as you only speak English and not, say, Hungarian (thinks of hard language...). Even people that write assembler aren't really writing in what the machine understands - though they are an awful lot nearer than an Java or objective-C programmer.
 

freiheit

macrumors 6502a
Jul 20, 2004
643
90
California
Prom1 said:
Lastly, I'll be seriously learning PHP, Apache, and MySQL - which I find as administration for running a personal website.

PHP is a good language to know, especially for web development. But thanks to Safari and now Dashboard (in MacOS X 10.4) you could use PHP behind the scenes for some general programming work, too. The best thing is your PHP will be 100% cross-platform (ie. will work on Mac-PPC, Mac-Intel, Windows, OS/2, Linux, etc.) excepting of course any calls you make to specific other programs of one system. There's also GUI frameworks such as PHP-Tk that you can use to build non-native GUI programs based on purely PHP code (again, cross-platform compatible thanks to using Tk instead of Cocoa).

So if your head hurts thinking about C, C++, C#, Objective-C, and Objective-C++, PHP may be a good way to get into programming.
 

DeepIn2U

macrumors G5
May 30, 2002
13,047
6,983
Toronto, Ontario, Canada
freiheit said:
PHP is a good language to know, especially for web development. But thanks to Safari and now Dashboard (in MacOS X 10.4) you could use PHP behind the scenes for some general programming work, too. The best thing is your PHP will be 100% cross-platform (ie. will work on Mac-PPC, Mac-Intel, Windows, OS/2, Linux, etc.) excepting of course any calls you make to specific other programs of one system. There's also GUI frameworks such as PHP-Tk that you can use to build non-native GUI programs based on purely PHP code (again, cross-platform compatible thanks to using Tk instead of Cocoa).

So if your head hurts thinking about C, C++, C#, Objective-C, and Objective-C++, PHP may be a good way to get into programming.

PHP it is, and also gonna start on C++ & Objective-C. Funny thing is for programming apps I'm not even sure which application to work on, but for PHP it'll be for web & phone usuage. Streaming. Thanks freiheit!

@caveman_uk, this past weekend I helped my mother move, and for so many years with lack of communication, we talked. STill fought though, as usual. But I found out that she took a few courses in Cobol ?!! :eek:

If she can do so can I.
 

hhlee

macrumors 6502
May 19, 2005
255
1
Nuc said:
Ok I've programmed in Fortran (not very efficiently). However, if I were to code in obj-c how does these to compare... I've always understood that fortran is more for engineers (which I am) however what kind of comparison is this to obj-c? I'm looking to possibly write programs (more or less modeling e.g. atmospheric transport) which requires numerical integration and such.

What do you guys suggest...

Nuc

Matlab. Yeah, its slow but great to prototype on, lots of built in functions. Once you get your program running, if its too slow (which Matlab is, but it might be okay for your time scale) port to something fast like C
 

lgoss007

macrumors newbie
Jun 17, 2005
13
0
C's and assembling code

In addition to what was mentioned, here is a faq about the C++ language from it's creator http://www.research.att.com/~bs/bs_faq.html. There is some comments about C, Java, and C# there as well as some other faq's about the language. C++ is very good for low level programming (drivers), high performance games (like WoW, Unreal, etc.), and general programs as well (I prefer it to Java).

C# is a .NET language, not to be confused with the Internet (.NET is just a marketing name by Microsoft). It's a language for the .NET platform just like Java is a language for the Java platform, only the .NET platform only really runs well on Windows (Linux support is improving but lags behind). Look at the section of the faq above titled "Is Java the language you would have designed if you didn't have to be compatible with C?" and the one right after it "What do you think of C#?".

And as far as assembling code, well it helps a little to understand but don't worry about it yet. With more experience (and reading the right material) you'll be able to understand more of what is done by the compiler, but it's not really necessary right away. Though you could take a peek at the assembly language itself: http://www.xs4all.nl/~smit/asm01001.htm
 

pubwvj

macrumors 68000
Oct 1, 2004
1,902
208
Mountains of Vermont
kingjr3 said:
If you are looking for something career related (eventually) and cross-platform. Look no further than Java.

Ahh... No... Not Java!!!! Argue, Gasp, Groan...

(The hardware keeps getting faster and faster but the user experience is still dogged because people choke their programs at too high a level.)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.