I'll second this, and throw in a recommendation for Ruby as well. Ruby also comes preinstalled on Mac OS X, and like Python, there are slightly fewer barriers to getting started as opposed to a compiled programming language like Java.blaster_boy said:If all you want to do is bang out scripts, or start with that, why not try python. It's used by quite a lot of people, but it is not a compiled language (it pre-compiles itself, but not fully).
caveman_uk said:First programming language - well mine was Sinclair Basic but I'd recommend a language that doesn't teach you bad habits. OOP is all the rage now so I guess Java is a good suggestion. For portability you can't beat C but it's hardly a beginners language.
Osirius said:
Ditto that. Java is good for a first language because you spend all your time in the JVM. It protects you from a lot of system-crashing mistakes (like calling an operation on a null pointer) and allows you to become a pretty good programmer since you spend more time focusing on logic rather than error trapping.jalagl said:I would suggest Java. [...]
wow. i started off w/ BASIC and Fortran, and i turned out okay.jamdr said:Java [...] for beginners it's really the only option.
public class HelloWorld {
public static void main() {
System.out.writeln("Hello World");
}
}
#include <stdio.h>
int main() {
printf("Hello World\n");
return 0;
}
#include <iostream>
using namespace std;
int main() {
cout << "Hello World" << endl;
return 0;
}
#import <Foundation/Foundation.h>
int main() {
NSLog(@"Hello World\n");
return 0;
}
print "Hello World\n"
++++++++[>+++++++++<-]>.<++++[>+++++++<-]>+.<+
+[>+++<-]>+..+++.++++[>++++++++<-]>.<+++++[>++++++++
++<-]>+++++.<<.+++.------.<+++[>---<-]>+.
jamdr said:Java is the best choice for a beginning programming language for a lot reasons that I'm not going to elaborate on right now. It's also a great language for a lot of other things, but for beginners it's really the only option. There is a reason almost all introductory cs courses are taught in Java nowadays.
Java and OS X is a mixed bag. On the plus side, Apple seems committed to Java because it comes preinstalled on every computer. However, historically Java releases on OS X lag behind Windows releases by years. And since Java 5 (the largest upgrade to the Java language since its first release) is going to go final soon, some recent Java software may not run on OS X. Personally, I think Java 5 is an abomination and completely ruins the language in some respects. But the truth is that if Sun releases a new version of Java, OS X needs to support it to keep up with Windows.
There is also the issue of performance. Java is a very fast language when it is run on Windows. The key word there is Windows. Java performance on OS X is less than exciting and Apple seems perfectly content with lagging behind Windows in yet another way. Now, I don't mean to give you the impression that Java is slow on OS X--it is plenty fast for most applications. But if you are creating huge, complex Swing GUIs or graphical games, you will see what I mean. And this is why Mac users generally have some aversion to Java, while Windows users have no such bias. Anyway, enough ranting. Now go learn Java.
Simon Liquid said:Brainfck
Code:++++++++[>+++++++++<-]>.<++++[>+++++++<-]>+.<+ +[>+++<-]>+..+++.++++[>++++++++<-]>.<+++++[>++++++++ ++<-]>+++++.<<.+++.------.<+++[>---<-]>+.
aHpaepalppaopa pawpaoparpalpadpn0
main, begin
var,message,string
assign,message,@"Hello World\n"
emits,message
exit,0
#include <stdio.h>
#include <unistd.h>
void print( void * str );
main() {
pthread_t hello, world;
char * strhello = "Hello ";
char * strworld = "World";
pthread_create(&hello, pthread_attr_default, (void*)&print, (void*)strhello);
pthread_create(&world, pthread_attr_default, (void*)&print, (void*)strworld);
exit(0);
}
void print( void * str ) {
printf("%s", (char*)str);
}
jsw said:I agree - Java is great. Many reasons have been given, and I agree with them all. To me, the single nicest part is the fact that Java GUI coding is both powerful and portable, a big plus compared to any other language. As far as non-GUI programming is concerned, I like a lot of languages (Java, C++, Objective-C, python, etc.) - but, for a beginner, Swing (Java's GUI stuff, essentially) is, I think, a big plus.
As far as OS X support: Tiger has Java 5 built in. That's a relatively minor lag, as it's barely been released on Solaris/Windows and certainly isn't the basis of any major apps yet. So, by late spring, say, OS X will be using Java 5.
Also, as a plus, OS X makes it very easy to use Java as part of an app based on Objective-C, so you can use Java when it's advantageous, then switch to Objective-C when it better suits your purposes.
However, regardless of language, the most important thing to learn while learning programming is how to approach the problem, something you'll work on regardless of language. A good programmer is a good programmer regardless of the language being used simply because that programmer uses good algorithms.
Edit: - just like TrumanApple wrote as I was replying.
But Java is pretty forgiving while being quite powerful, and it's got a stunningly good library of classes that will run on pretty much any platform you choose, automatically.