Mac What programming language should i pick?

Keytachi

macrumors regular
Original poster
Sep 14, 2006
161
0
i want to learn a language but i dont know wich one :( i thought of Visual Basic for a start but... is that a good language to start with?
 

robbieduncan

Moderator emeritus
Jul 24, 2002
24,638
61
Harrogate
Visual Basic is a Microsoft propietary language. You cannot use it natively in OSX. Personally I think everyone should learn C as that way you learn enough about how things work to understand what is going on and it's a good gateway to Objective-C. This is not a very fasionable attitude these days though. Most people will say Java!
 

ChrisBrightwell

macrumors 68020
Apr 5, 2004
2,294
0
Huntsville, AL
I often prescribe Java as a first language, simply because it's portable and forgiving.

C/C++ errors tend to be a bit cryptic and intimidating. Java, IMO, tends to be quite good about telling you exactly what went wrong and exactly where it happened.
 

robbieduncan

Moderator emeritus
Jul 24, 2002
24,638
61
Harrogate
ChrisBrightwell said:
I often prescribe Java as a first language, simply because it's portable and forgiving.

C/C++ errors tend to be a bit cryptic and intimidating. Java, IMO, tends to be quite good about telling you exactly what went wrong and exactly where it happened.
I agree about the compiler error messages but Java does not teach you about how the machine works, the fundamentals of data structures or the lower level workings of languages. Once you know and understand C you have a good feeling for what the other languages are doing, even though they abstract the raw bits away. And in Obj-C at least you can always drop to raw C when you need to...
 

ChrisBrightwell

macrumors 68020
Apr 5, 2004
2,294
0
Huntsville, AL
robbieduncan said:
I agree about the compiler error messages but Java does not teach you about how the machine works, the fundamentals of data structures or the lower level workings of languages.
This could go the other way, too. You don't *have* to know how the C memory model works or what the signature of an overloaded stream operator is to be a decent programmer.

Most beginning programmers I know don't start in C. Most seasoned programmers I know didn't start in C. We all started in BASIC, FORTRAN, COBOL, PASCAL, Java, or some scripted language (Ruby, Python, Perl, etc).

C and C++ are very good for learning the nitty gritty of computer innards. Even then, Assembly is just as good, if not better, than C/C++ for that. None of them, IMO, are good entry-level languages.
 

crees!

macrumors 68000
Jun 14, 2003
1,921
26
MD/VA/DC
Keytachi said:
i want to learn a language but i dont know wich one :( i thought of Visual Basic for a start but... is that a good language to start with?
Ah, but what do you want to do with your soon to be programming skills? Create desktop applications, web apps, server-side applications, dashboard widgets, etc...? Granted there are basics to programming but you should learn the language you plan on using or one that's in the general ballpark to get the job done.
 

savar

macrumors 68000
Jun 6, 2003
1,952
0
District of Columbia
Keytachi said:
i want to learn a language but i dont know wich one :( i thought of Visual Basic for a start but... is that a good language to start with?
NO!

That's not a good language at all if you're interested in learning the science. C or Java would be much better choices.
 

Keytachi

macrumors regular
Original poster
Sep 14, 2006
161
0
Kunimodi said:
Hi, Keytachi. The answer to your question depends on what your goals are. Why do you want to learn to program?
well first of all i want to finish MyCGy (Make your computer greet you) and then i wanted to learn a base language i dont have any specific goal, i just want to know a language first and then ill decide wht i can do :p
 

MarkCollette

macrumors 68000
Mar 6, 2003
1,555
32
Toronto, Canada
Your first programming languages should be English and pseudo code :)

The key is to learn to describe what a program should do, in a very high level way, and use step-wise refinement to break that description down into more and more detailed steps, resulting in a precise algorithm. After that, whichever programming language you use will be a mere technicality. At least, for beginner programs :)
 

ChrisA

macrumors G4
Jan 5, 2006
11,609
408
Redondo Beach, California
Keytachi said:
i want to learn a language but i dont know wich one :( i thought of Visual Basic for a start but... is that a good language to start with?
I've been at this from the 1970's. and full time from the early 80's. I'll tell you,
there is no "best" language.

I am surprized that no one has asked you what kinds of programs yu want to write. This matters a lot. In fact some things simply can't be done in some languages a.

For example are you wanting to write code that runs on a web server to generate HTML? Or you wanting to write an Aqua application that runs on a Mac. Does the cose need to be portable to Windows and other non-Mac UNIXes. Or maybe your long term goal is to write cose that will fit inside some device like a Robot or air defence radar. or more likey you are interrested in game development.

What are your long term goals?
 

bousozoku

Moderator emeritus
Jun 25, 2002
13,979
3
Gone but not forgotten.
Python is a good starter language because you must use good programming techniques to get results and you receive quick feedback without compiling.

Visual BASIC is a poor starter language because it allows slop more than most. If you're looking for form-based programming, you can download JBuilder Foundation for free and fill in the blanks using Java instead of BASIC. REALBasic would allow you to programme using BASIC but once again, it allows slop simply because BASIC is a poor language.
 

ChrisA

macrumors G4
Jan 5, 2006
11,609
408
Redondo Beach, California
MarkCollette said:
Your first programming languages should be English and pseudo code :)

The key is to learn to describe what a program should do, in a very high level way, and use step-wise refinement to break that description down into more and more detailed steps, resulting in a precise algorithm. After that, whichever programming language you use will be a mere technicality. At least, for beginner programs :)
You've got this exactly right. Way back when I was in school one of the proffs did not let students code in a compilable language. It was a kind of "structured English" that he made us use. He said to many students would simply change stuff at random untill the program worked and never understand what they were doing. (This actually works with toy programs.)

Later when you are doing non-toy projects you find that a typical pogrammer spends only about 1/6th of his time wriing code. Making software is like painting a house. The very last step is to apply the paint all the hard work in in the "prep".
 

Keytachi

macrumors regular
Original poster
Sep 14, 2006
161
0
well i wanted to learn a mac/windows language, one that would work in all OS. i might go to java and then a C
 

Kunimodi

macrumors member
Sep 8, 2006
65
0
Ashland, OR, USA
Keytachi said:
...then i wanted to learn a base language i dont have any specific goal, i just want to know a language first and then ill decide wht i can do :p
Keytachi said:
well i wanted to learn a mac/windows language, one that would work in all OS. i might go to java and then a C
Thank you. It sounds like you would like to learn a general purpose language and, broadly speaking, how to program. Java is currently quite popular as a CS learning language because it is a powerful language which experience with can be a valuable job skill. However, Java is also a complex language with an enormous class library for which even very experienced Java programmers require reference documentation now and then.

Consider the classic 'Hello World' example in Java. To create even the simplest self-contained, compiled program in Java, you need to declare a class with a name matching that of the file (except for the .java suffix) and then add a very specific method to it:

Code:
public class HelloWorld
{
    public static void main(String[] args) {
        System.out.println("Hello, world.");
    }
}
This needs to be in a plain text file named HelloWorld.java. You would then compile it (e.g. using the command line 'javac HelloWorld.java') and then run it (e.g. 'java HelloWorld'). Even simply printing out the text is rather verbose.

There are many high level languages that run on all major platforms which allow you to program powerful, well structured applications with far fewer lines of code and, empirically, much less development time. Using these languages, you can also learn sophisticated programming techniques such as OOD (Object Oriented Development), functional programming, network communication and multithreading, usually with greater ease than with the many C variants (including Java).

Many advanced libraries are available in these high level languages, allowing access to databases, xml parsers, GUIs and more. Several of them have interpretive modes that allow you to immediately get a response to each line of code that you enter (much like using the command line). This can be wonderful for learning how to program.

Here are some high level languages that enjoy these features. I'll list them in the order that I would recommend them to you, but I'd advise you to try several and see what you like best:

Python

Ruby

Perl

PHP (Normally used for web development, but also good for general use)

Lua

Tcl/Tk

If you're mainly interested in making GUI programs, these days they are normally event driven and it can be very efficient to use a RAD (Rapid Application Design) drag-and-drop style IDE. I'd highly recommend waiting a while before you start doing GUI programming as it is fairly complex once you get beyond the basic, shallow level (in other words, where there is no model or controller (MVC)).

Have fun and happy hacking!
 

x704

macrumors regular
Apr 15, 2006
118
0
ChrisA said:
You've got this exactly right. Way back when I was in school one of the proffs did not let students code in a compilable language. It was a kind of "structured English" that he made us use. He said to many students would simply change stuff at random untill the program worked and never understand what they were doing. (This actually works with toy programs.)

Later when you are doing non-toy projects you find that a typical pogrammer spends only about 1/6th of his time wriing code. Making software is like painting a house. The very last step is to apply the paint all the hard work in in the "prep".
I am starting to wish I started like that too... I first started in BASIC and sorta did a pinball move between a few languages and setteled down in Java.

Because I did not get much insight or help I am now wishing that I started with pseudo code and later wrote it for java (which I also wish I started in).

In java you can't mix the different data types accidently which would keep you from possable debuging problems you will have.