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

What do you recommend to learn as first languages?


  • Total voters
    43
Just start with any language. Life is long enough to learn more than one language and no language learnt will prevent you from learning others!
 
Assembly language.

Don't laugh. At a top university, in the days before everyone had a laptop, in the "Intro to Computers" course for non-CS/engineering/science-majors, they started out teaching an assembly language. It was a toy assembly language with only a dozen op codes, designed to teach the basic concept of the parts of a computer (ALU, addressable memory, etc.). Then they moved on to another toy language, maybe a Scheme derivative, where they taught the abstraction of program as data.

This was not considered a difficult course, just another way to get breadth requirements out of the way.

There's a lot to be said for toy educational programming languages. You don't have to jump into C. Try the books in the kids section of your local library, and see if there are any on computers.

As for brain damage, I know PhD's in CS who started out and got interested this way as kids (hacking Basic and peek/poking 6502 asm on their Apple II, C64, et.al.)
 
My story

Don't laugh. At a top university, in the days
As for brain damage, I know PhD's in CS who started out and got interested this way as kids (hacking Basic and peek/poking 6502 asm on their Apple II, C64, et.al.)

Sort of like me :)

Started with C64 logo, Basic... Then first year college Pascal, then got into the demo scene so (if I remember correctly) mov ax, 0a000 (yay! We hit VGA memory :) ) That got me into x86 assembler, next year was C and MC68HC11 assembler. That got me a Master in Science (I believe that's what it's called)

Later I mostly programmed C/C++ (compiler optimisation won).

And nowadays I'm a senior Perl programmer (no guys, it's not a swear word, Perl can be good for some stuff ;) ) Mostly OO Perl.

And in my spare time I'm dabbling into/trying to teach myself Objective-C within the Cocoa framework.

Oh, yeah, what I wanted to say; Languages like Perl (the higher ones) are more easy to get your head around, but it really, really helps if you start with C. Once you 'learn' programming things 'click' and the specific language doesn't really matter anymore. (I recommenden Starlogo (http://education.mit.edu/drupal/starlogo-tng) to a collegue of mine who's son was interested starting with programming, just to help get 'the mindset')

(For the record, I still have a life with a girlfriend, playing in a rockband, going out and generally drinking too much ;) )
 
Assembly language. :D
Don't laugh. At a top university, in the days before everyone had a laptop, in the "Intro to Computers" course for non-CS/engineering/science-majors, they started out teaching an assembly language. It was a toy assembly language with only a dozen op codes, designed to teach the basic concept of the parts of a computer (ALU, addressable memory, etc.)

I did assembly language in my first year at uni. Quite enjoyed it actually, it was nice being so close to the metal, banging around single bits and running comparators and complicated jumps. It's a bit old-school for today's times, especially for a 15 year old, so I don't recommend getting heavily into it. Learning a little bit about it is fine.

My primary goal is programming for Mac and the iPhone because I love the interface prettiness and the operating system. :)

There you have it. You like the pretty interface and the nice operating system. A perfectly valid reason to want to create more, and that's a helpful hint as to the path that's best for you.

People learn differently. ...

That's why there's no universal answer to this question. The answer will vary from person to person depending on their goals and learning style. Given these variables, I have a few suggestions based on some over-simplified stereotypes derived from an aggregate of the many similar threads on this subject:

Hit the ground running This person wants to get up and running on Apple technologies quickly and will get discouraged if they aren't able to start working with Interface Builder making simple GUI apps relatively quickly. I say go for the Kochan-Hillegass Route. After you've satisfied your need to make "physical" things and see the basics of how apps are made, come back to C and invest the time and energy into mastering the details of how everything works.

GorillaPaws
made the best post in this thread. From what you say, the 'hit the ground running' option seems to fit your age and what you want to do. Hell, it's probably the best for me too if I ever seriously try to get back into programming.
 
I did assembly language in my first year at uni. Quite enjoyed it actually, it was nice being so close to the metal, banging around single bits and running comparators and complicated jumps. It's a bit old-school for today's times, especially for a 15 year old, so I don't recommend getting heavily into it. Learning a little bit about it is fine.


GorillaPaws
made the best post in this thread. From what you say, the 'hit the ground running' option seems to fit your age and what you want to do. Hell, it's probably the best for me too if I ever seriously try to get back into programming.

Tomorrow I can go to the postoffice and get my new book (Stephen Kochan's Programming in Objective-C 2.0 ^^) and tbh, I can't wait!
I only have had access to PDF/e-books so far and they are hard to focus on, for longer times.

But maybe I am the "Hit the Ground Running" type. See some quick results and then just improve it (did I get it right?)

My primary goal is programming for Mac and the iPhone because I love the interface prettiness and the operating system. :)

There you have it. You like the pretty interface and the nice operating system. A perfectly valid reason to want to create more, and that's a helpful hint as to the path that's best for you.

Sarcastic or serious? I am in little doubt lol :)

Thanks! :D

P.S. It is really nice to see so many people care and help out a "little" newbie boy to this new exciting world of 0's, 1's and main()'s :) 55 posts so far, keep them up!
 
Sarcastic or serious? I am in little doubt lol :)

I can see why you might think that, but it's good to be honest about why you like OSX and what you want to achieve. Main thing is to be honest with yourself and follow your curiosity. Doesn't matter if other people think it's not 'cool'. :)
 
Mac OS X ftw.

My three reasons I want to program for Mac is:
prettiness (interface, elegant design)
left sided buttons yay! jk
way too few Mac application

If I succeed some day making an application for Mac, how difficult is it to male it compitable with Windows?
 
Learn C, then Obj-C

Code:
                        |---------------C#
         |----------- Java---------------- 
   |---> C++------------------------------
C  |
   ----> Obj-C-----------------------------

I´m doubtful even that you *need* C++ to master Java (except if you want to hack the JVM runtime ...)

* Before C? : Nothing, with C : assembler embedded (for optimization, device dependent)
* After C-like languages? : scripting and functional constructs ( some C++ templates, Perl, Python, Ruby (and lots more Lua, Scala, ...))
* After that? : The sky is the limit, DSLs, APIs, Frameworks, new languages, "pure" functional languages ...
 
If I succeed some day making an application for Mac, how difficult is it to male it compitable with Windows?

That depends on what language you program it in, what framework(s)/libraries you use, how complicated your program is and if you wrote it to be portable. If you do it the 'mac way', with Objective-C and Cocoa, then it could be very difficult to port it to Windows just like how a Windows .NET application could be very hard to port to a Mac. If, however, you use a language and framework that is supported on multiple platforms, it could be almost trivial.

For example, if you wrote a Mac application using C++ and Qt (my language and gui toolkit of choice) then getting it to run on windows could be as simple as just compiling it on a windows machine. Not only that, the 'mac version' will look and feel very much like a native Cocoa app and the 'windows version' will look and feel very much like an app using native windows APIs. I try to avoid using Objective-C and Cocoa for this very reason. I want my apps to run on both Macs and Windows boxes, if possible. If I must use native OS APIs, then I only use them when I have to and do the rest with portable frameworks/libraries/etc.

This is all getting ahead of where you need to concentrate for now. For now, just worry about learning the basics of some language, be it C, objective-C, java, whatever. You've got lots of time to learn how to write cool looking GUI applications, that could run on multiple platforms.
 
That depends on what language you program it in, what framework(s)/libraries you use, how complicated your program is and if you wrote it to be portable. If you do it the 'mac way', with Objective-C and Cocoa, then it could be very difficult to port it to Windows just like how a Windows .NET application could be very hard to port to a Mac. If, however, you use a language and framework that is supported on multiple platforms, it could be almost trivial.

For example, if you wrote a Mac application using C++ and Qt (my language and gui toolkit of choice) then getting it to run on windows could be as simple as just compiling it on a windows machine. Not only that, the 'mac version' will look and feel very much like a native Cocoa app and the 'windows version' will look and feel very much like an app using native windows APIs. I try to avoid using Objective-C and Cocoa for this very reason. I want my apps to run on both Macs and Windows boxes, if possible. If I must use native OS APIs, then I only use them when I have to and do the rest with portable frameworks/libraries/etc.

This is all getting ahead of where you need to concentrate for now. For now, just worry about learning the basics of some language, be it C, objective-C, java, whatever. You've got lots of time to learn how to write cool looking GUI applications, that could run on multiple platforms.

The only problem that I can think of with that approach is the lack of optimization for each platform. Oh and lack of features that could be present otherwise.
 
I just got my book! I had to get it on the postoffice but, it's finally here!

I just have a quick question about it: where do I get the exercises?
Sure there is his forum, but it's not ALL the exercises there is.

For example: Chapter 4 - 1.
Code:
Which of the following names are invalid names? Why?
Int		playNextSong	[B]6_05[/B]	
[B]_calloc[/B]		Xx		alphaBetaRoutine
clearScreen	[B]_1312[/B]		z
ReInitialize	[B]_[/B]		[B]A$[/B]

Because they can't start with _ or a number, and $ is not legal anytime

Where should I go and check if that is correct? In the back of the book, they refer to informit.com/register, but I can't find it anywhere...

Answers to Exercises, Errata, and Such
You can visit the publisher's Web site www.informit.com/register to get answers to exercises and errata for this book.


-------

Register your book at informit.com/register for convenient access to downloads, updates, and corrections as they become available.

Thanks! :D
 
Or you could try them out in xcode and see if they work.
I did, because I certainly se no problem with naming things _calloc, and _1312 looked suspicious, _ seemed rediculous, as did Int and A$.

But guess what? Only 6_05 didn't compile and run fine!! (I knew that one wouldn't)

Code:
#include <stdio.h>

int main (int argc, const char * argv[]) {
	int Int;
	int _1312;
	int _calloc;
	//int 6_05;
	int A$;
	int _;
	
	Int = 10;
	_1312 = 23;
	_calloc = 32;
	A$ = 43;
	_ = 34;
	printf("%d, %d , %d\n",Int, _1312, _calloc);
	printf("%d , %d", A$, _);
    return 0;
}

If A$ wasn't supposed to work.. then maybe its because you can't be sure what character encoding the document or compiler will be aware of. There are LOTS of reasons not to use names like these, Apple reserves _function methods (or at least they say they do...), but they say nothing about using _name variables.

Time to replace all my counter variables with a single _
 
Thanks for the idea of figuring out, haven't though of trying to compile it.

But that exercises was just an example, so it was kind of not the answer I wanted (tho I am 99% sure I will be using it another time, so I do appreciate it ;))

But anyone know where I can see the exercises? Haven't found it yet
 
Or you could try them out in xcode and see if they work.
I did, because I certainly se no problem with naming things _calloc, and _1312 looked suspicious, _ seemed rediculous, as did Int and A$.

But guess what? Only 6_05 didn't compile and run fine!! (I knew that one wouldn't)

Code:
#include <stdio.h>

int main (int argc, const char * argv[]) {
	int Int;
	int _1312;
	int _calloc;
	//int 6_05;
	int A$;
	int _;
	
	Int = 10;
	_1312 = 23;
	_calloc = 32;
	A$ = 43;
	_ = 34;
	printf("%d, %d , %d\n",Int, _1312, _calloc);
	printf("%d , %d", A$, _);
    return 0;
}

If A$ wasn't supposed to work.. then maybe its because you can't be sure what character encoding the document or compiler will be aware of. There are LOTS of reasons not to use names like these, Apple reserves _function methods (or at least they say they do...), but they say nothing about using _name variables.

Time to replace all my counter variables with a single _

Now try that in Forth.
 
Programmer education algorithm #1:

Step 1. Google it.
Step 2. Search Wikipedia.
Step 3. Ask on a forum.

You left out Steps 1 and 2.

It was more as a joke than serious, that's why I added the "x)" smiley
I will add "jk" next time instead I guess
 
Now try that in Forth.

Code:
VARIABLE Int
VARIABLE _1312
VARIABLE _calloc
VARIABLE 6_05  ( not illegal in Forth )
VARIABLE A$
VARIABLE _

DECIMAL
10 Int !
23 _1312 !
32 _calloc !
605 6_05 !
43 A$ !
34 _ !

: %d ( addr -- ) @ . ;
: ., ( -- ) ." , " ;
: %d, ( addr -- ) %d ., ;

Int %d,  _1312 %d,  _calloc %d CR
A$ %d BL EMIT .,  _ %d CR
6_05 %d CR

Makes me want to program microcontrollers again.
 
Code:
VARIABLE Int
VARIABLE _1312
VARIABLE _calloc
VARIABLE 6_05  ( not illegal in Forth )
VARIABLE A$
VARIABLE _

DECIMAL
10 Int !
23 _1312 !
32 _calloc !
605 6_05 !
43 A$ !
34 _ !

: %d ( addr -- ) @ . ;
: ., ( -- ) ." , " ;
: %d, ( addr -- ) %d ., ;

Int %d,  _1312 %d,  _calloc %d CR
A$ %d BL EMIT .,  _ %d CR
6_05 %d CR

Makes me want to program microcontrollers again.
When I see code like that I understand why there is a caps lock key.
 
When I see code like that I understand why there is a caps lock key.

Some Forths are case-folding. Some aren't. Some have an option. The ANS std lists all the words in UPPER CASE.

My personal preference is case-folding, with most code written in lower case. It always seemed less shouty that way.
 
And then you have you context-sensitive, auto-correcting, auto-completing source editors, with syntax coloring that you set to make your eyes bleed just so you will remember to go out and get a pizza because you have been sitting in front of this elusive bug in thread 2 for the last four hours straight.
 
I think this speaks to the point of why this poll question is fairly useless. People learn differently. Probably the worst thing that could happen is that a potentially talented programmer gets discouraged early and gives up (unless of course programming really isn't for them--then the sooner they figure this out the better).

People want to get different things out of programming. Some like coding really close to the metal, others like working with high level abstractions that allow them to do complicated things quickly. Some people are really passionate about programming specifically for Apple platforms, others want to program professionally where knowledge of many languages and technologies is critical. Some are interested in pursuing programming as a hobby and having "fun" is the prime motivation.

That's why there's no universal answer to this question. The answer will vary from person to person depending on their goals and learning style. Given these variables, I have a few suggestions based on some over-simplified stereotypes derived from an aggregate of the many similar threads on this subject:

Hit the ground running This person wants to get up and running on Apple technologies quickly and will get discouraged if they aren't able to start working with Interface Builder making simple GUI apps relatively quickly. I say go for the Kochan-Hillegass Route. After you've satisfied your need to make "physical" things and see the basics of how apps are made, come back to C and invest the time and energy into mastering the details of how everything works.

Meticulous This person is very detail oriented and wants to build from the ground up; they are patient and don't want to move on to the next thing until they've mastered what they've covered. This person should probably start with C or possibly even assembly.

Broad and Diverse This person's ultimate goals is learning a range of languages, but they like to start off with the easier concepts, and dig deeper into the details after they understand the high-level concepts. I think Python is a great language for this type of person. They will have fewer syntactical issues to deal with and will be able to write code that works on a variety of platforms. Once they feel comfortable solving problems with code they can move on to lower-level languages.

These categories are neither perfect nor exhaustive, but hopefully they are helpful in giving someone trying to figure out how to start some direction (because honestly, with such a diversity of languages figuring this out can be daunting).

You hit the nail on the head with this post right here!
 
If I some day in the feature wanted to do some Windows programming (C++ or C# I believe), will it be possible to learn C fairly quick if I know Objective-C?

What you will find is the learning some specic programming langaue is "nothing" compared to the total job of learning to write software.

It is like learning to spell and use a word processor is to writing a novel. Of cource you need to learn to use the tools but tool use is not the same thing as writing something others will pay to read

Beginning photographers think the same thing: That all they need to learn is how to set the controls on some fancy SLR camera. No. That is the easy part.

Same with programming languages. In any decent sized programming job, I'd say most of the work is finished before you write code. In the beginning you'll be writing toy programs that are so simple that yes, writing the code is the biggest part. But say you want to control a robot that walks on three legs or process radar data into an image or build a secure email server. I'll tell you first hand that in each case and in other non-toy projects the the main part of the task is not the code.

So,... after you've learned some programming language, C, Java, Perl or whatever, and then applied that to a few non-toy projects. Even if the next job uses a language you've never seen you will be able to pick it up very fast. What yoy are learning now is how to write programs. This is much harder than learning a programming language.

Bottom line -- It does not make any difference. Just learn anything, whatever is needed for the job at hand.
 
I just have a quick question about it: where do I get the exercises?
Sure there is his forum, but it's not ALL the exercises there is.

You should find all the answers posted on the forum. Make sure you look under the appropriate chapter in the Answers to Exercises board. If you can't find something, post there and either I or a forum member will be glad to help.

Cheers,

Steve Kochan
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.