Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
C++, Xcode and (my favourite) BASIC :D

Dont waste your time with Java.
How about explaining why Java is a waste of time (because I totally disagree), instead of making blanket unsupported statements. I could just as well say BASIC is a waste of time.
 
How about explaining why Java is a waste of time (because I totally disagree), instead of making blanket unsupported statements. I could just as well say BASIC is a waste of time.

Blanket statements like....
The only reason to learn C is if you need to program in C, and that's not very common anymore.

Learning to program in C (at least as far as reading through the "Learn C on the Mac" book goes) will not teach anyone bad habits in an OO programming world.

Seriously, how many threads have we all seen where people are asking for help with trivial subjects like primitives, pointers, or C-Style Arrays. All of that would make so much more sense after "learning C" than if they just jump straight into an Objective-C book or iPhone dev book.

Let us not forget that Objective-C is C!!! Seriously, selectors are just functions, and class variables are just structs. There is nothing that Objective-C can do for you that you cannot do for yourself in C. Objective-C/Foundation/Cocoa all just provide immensely useful functions and structs (classes).
 
Blanket statements like....


Learning to program in C (at least as far as reading through the "Learn C on the Mac" book goes) will not teach anyone bad habits in an OO programming world.

Seriously, how many threads have we all seen where people are asking for help with trivial subjects like primitives, pointers, or C-Style Arrays. All of that would make so much more sense after "learning C" than if they just jump straight into an Objective-C book or iPhone dev book.

Let us not forget that Objective-C is C!!! Seriously, selectors are just functions, and class variables are just structs. There is nothing that Objective-C can do for you that you cannot do for yourself in C. Objective-C/Foundation/Cocoa all just provide immensely useful functions and structs (classes).
Fair enough. I failed to consider that aspect. My bad. C is used for programming in Objective C, but it's less useful to learn so if that isn't the goal. If C++ is the goal, then I think learning it to start is a perfectly good path.

But to state that Java is a waste of time is ludicrous, especially if you're interested in making a living out of programming. It's a perfectly valid and powerful language, and it's ubiquitous. There are far fewer opportunities to make a living as an Objective-C programmer.
 
Forget about Java. If you pretend to program to the Mac, you better learn C, then learn Objective-C. It's not hard. I found many books, but the only good book I found is called Cocoa Programming for Mac OS X 3rd edition. It was wrote by a man who worked for NeXT, then he taught Objective-C to Apple employees. This book is really really good. You just have to have a little knowledge in C or C++. It doesn't make you give up and explain everything in a easy way to understand.
 
No, it's more than C, since it's a superset of C.


How about anything OOP?

It is a superset of C, but the objective-c runtime is programmed and implemented in C. Every method/selector is a static function. You can ABSOLUTELY create functions that work on structs, and that is really what object oriented programming boils down to. In fact, we have all worked with functions that return already setup structs such as NSMakeRange();

A good example of OOP in "C" only would be functions like this (Quartz drawing)
Code:
CGContextSetRGBFillColor (myContext, 1, 0, 0, 1);

Its a C function that takes a Core Graphics Context "Object" and sets the color.

I ASSURE you if you wanted to implement "Objects" in C it would be 100% possible. Its just not setup for you.


For further reading check out any Apple documentation on Core Foundation.
http://developer.apple.com/mac/libr...eference/CFStringRef/Reference/reference.html
Look! String objects implemented, written, and accessed in C !!!11!
Oh and there are functions CFRetain(); and CFRelease(); that are just C functions that you send an object pointer.
 
Yeah I'm also only 14 and starting programming. I only know XHTML, CSS, HTML, some Flash, etc. Should I start with C or C++???
 
One more question,

At what age do people usually start programming?

Am I too young or too old?

I know Bill Gates and Paul Allen started at 13/14....
 
"Some people seem to think that C is a real programming language, but they are sadly mistaken.”

- Linus Torvalds

Since only few people will have written more code in C than Linus Torvalds has, just take his word for it. And in my own programming experience, C is just a low level system programming language - nothing you would use to --efficiently-- write applications with.

Pascal can do the very same job as C, and it actually has been used even by Apple to write parts of the old Mac OS. That was before C, and later C++, and then Java, became all the hype - and marketing.

Objective-C is not, and will never become, a mainstream language. It's the choice if you want to stay in Apple land, but in the rest of the world, Objective-C is of absolutely no use because nobody uses it. Repeat: Objective-C is exclusive to Apple. Unless you are married to Apple, don't bother learning it.

C# is what Java always was supposed to be, but never managed to become. It's one of the things that Microsoft really did right: A programming language for programmers. Java, on the opposite corner, is a programming language for project managers and maybe academics. Too many unnecessary rules and protocols that are just in your way. C# and the .NET framework were designed to get a job done. On a personal note, C# is the only "curly braces" language that I do not find ugly as hell or that I hate with a passion.

However, programming languages are only means to end and tools to get a job done. And there is no "one true" programming language that's ideal for all purposes. It always depends on what you actually want to do.

Would I use something other than BlitzMax to write a game? I doubt it. I wouldn't write an own 3D engine, I would just use an already existing one. And -oops- there goes my need to use C or C++. Compiled BlitzMax code is almost as fast as optimized C++ code, but BlitzMax is a much more efficient language to code in than C++. So why should I slow myself down by using an object-oriented systems programming language when I could use something that's far more comfortable to use?

I wouldn't use Java for GUI apps. Except for SWT, Java does not have a GUI toolkit that looks native on any platform. And, as already said, Java slows you down with all its unnecessary protocols and academic design choices. It's no longer painfully slow, but it's also not as nice to use as C#. And with the Mono framework, I can also be truly platform independent with C#, so there is no need to use Java. None at all.

Python. That's probably a great language to learn programming, especially since it is a hybrid scripting language that supports various programming paradigms. You can write procedural code with Python, but you can also use an object-oriented style. (Okay, the same can be said about C++.) However, I wouldn't use Python to write GUI apps that I want to sell - the deployment issues alone are a pain in the neck. It's a great scripting language for Linux servers, though.

So... Where would I start if I had to do it again? Back in the early 80s the answer was simple: BASIC. It was the only thing that was pre-installed on the computer, so there was little choice other than using what the computer manufacturer gave you.

But today? Difficult, because there are so many possible routes and once again, it all depends on where you actually want to go.

Starting with Python probably is the safest thing. It's free, it exists for all platforms, it has many uses, it is powerful and always a handy tool in -any- environment, may that be at home or in a company.

After that, I'd probably learn C#.

If you want to go professional, you also should learn the basics about C. At least enough to be able to read and understand some source code. You don't have to actually use it yourself. Keep in mind: It's a widely used systems programming language. And unless you want to write the next version of the Linux kernel or the next 3D engine for id Software, you really don't have to be a C Guru in this world.

And as I've already said: Objective-C is an Apple-only thing. And I don't want to marry Steve Jobs, that's for sure.
 
I didn't know any programming languages before I went to uni (I knew a fair amount of JavaScript and SQL PHP stuff although thats piss easy really) and the first languages we were taught were Haskell (because we were doing logic and functional programming and therefore i would ignore) and Java for OO.

At the moment I am personally learning to program for iPhone because thats what I want to do. So I would learn a language that you are actually going to use, considering that you are still at school you wont need to earn any money of them so look around and see which one you fancy trying, if you dont like it change to something else.
 
Just start. You're not going to be irreparably damaged by any of the languages or paradigms mentioned here. Don't start with BASIC or fortran, and you'll be fine. any antecdotal evidence of some programmer being unable to adapt to a new language or paradigm means they are a bad programmer, not that they are poisoned by past experience with a particular language.

I feel that background with C gives a better understanding of how the machine, memory model, etc works. And it makes you appreciate a garbage collected or retain-counted memory management system, and might just make you aware of leaking references, etc. With that said, you can live without those things, and come back to them later if you want.

The main point is just do it. Whatever language and paradigm you start with will not make or break your future in programming. Algorithms and problem-solving are the crux, the language and paradigm are just details. You should be able to pick up a new language pretty quickly, and match the style of any team. That is the easy part.

If you're getting frustrated, then change gears. Giving up is the only thing that will have permanent negative repercussions. Those of us that might argue about the minutae are nerds, and the only reason this gets dragged out so often is passion for programming. Hopefully you get the same spark, and in a few years you'll be a nerd arguing about some inconsequential technical detail.

Good luck, get coding.
-Lee

Wow lee, you'd be good at writing books!
 
"Some people seem to think that C is a real programming language, but they are sadly mistaken.”

- Linus Torvalds

Since only few people will have written more code in C than Linus Torvalds has, just take his word for it. And in my own programming experience, C is just a low level system programming language - nothing you would use to --efficiently-- write applications with.

Pascal can do the very same job as C, and it actually has been used even by Apple to write parts of the old Mac OS. That was before C, and later C++, and then Java, became all the hype - and marketing.

Objective-C is not, and will never become, a mainstream language. It's the choice if you want to stay in Apple land, but in the rest of the world, Objective-C is of absolutely no use because nobody uses it. Repeat: Objective-C is exclusive to Apple. Unless you are married to Apple, don't bother learning it.

C# is what Java always was supposed to be, but never managed to become. It's one of the things that Microsoft really did right: A programming language for programmers. Java, on the opposite corner, is a programming language for project managers and maybe academics. Too many unnecessary rules and protocols that are just in your way. C# and the .NET framework were designed to get a job done. On a personal note, C# is the only "curly braces" language that I do not find ugly as hell or that I hate with a passion.

However, programming languages are only means to end and tools to get a job done. And there is no "one true" programming language that's ideal for all purposes. It always depends on what you actually want to do.

Would I use something other than BlitzMax to write a game? I doubt it. I wouldn't write an own 3D engine, I would just use an already existing one. And -oops- there goes my need to use C or C++. Compiled BlitzMax code is almost as fast as optimized C++ code, but BlitzMax is a much more efficient language to code in than C++. So why should I slow myself down by using an object-oriented systems programming language when I could use something that's far more comfortable to use?

I wouldn't use Java for GUI apps. Except for SWT, Java does not have a GUI toolkit that looks native on any platform. And, as already said, Java slows you down with all its unnecessary protocols and academic design choices. It's no longer painfully slow, but it's also not as nice to use as C#. And with the Mono framework, I can also be truly platform independent with C#, so there is no need to use Java. None at all.

Python. That's probably a great language to learn programming, especially since it is a hybrid scripting language that supports various programming paradigms. You can write procedural code with Python, but you can also use an object-oriented style. (Okay, the same can be said about C++.) However, I wouldn't use Python to write GUI apps that I want to sell - the deployment issues alone are a pain in the neck. It's a great scripting language for Linux servers, though.

So... Where would I start if I had to do it again? Back in the early 80s the answer was simple: BASIC. It was the only thing that was pre-installed on the computer, so there was little choice other than using what the computer manufacturer gave you.

But today? Difficult, because there are so many possible routes and once again, it all depends on where you actually want to go.

Starting with Python probably is the safest thing. It's free, it exists for all platforms, it has many uses, it is powerful and always a handy tool in -any- environment, may that be at home or in a company.

After that, I'd probably learn C#.

If you want to go professional, you also should learn the basics about C. At least enough to be able to read and understand some source code. You don't have to actually use it yourself. Keep in mind: It's a widely used systems programming language. And unless you want to write the next version of the Linux kernel or the next 3D engine for id Software, you really don't have to be a C Guru in this world.

And as I've already said: Objective-C is an Apple-only thing. And I don't want to marry Steve Jobs, that's for sure.

Thats a lot of subjectivity in there. I know people that hate C# BECAUSE OF .Net. I don't "like" .Net because of the unnecessary bloat it adds to programs (I had a BASIC app that went from 456KB to 1.2MB porting to .Net) and the lock-in it causes.

IMO, if I had to learn C++ or C#, I'd go C++ with QT. I'm only learning Obj-C because were porting my dads lawfirm to macs but I've also taken a shine to Obj-C and Cocoa. So when/if I learn C++ I can use QT on other platforms and Obj-C++ on Mac OSX.
 
C# is what Java always was supposed to be, but never managed to become. It's one of the things that Microsoft really did right: A programming language for programmers. Java, on the opposite corner, is a programming language for project managers and maybe academics. Too many unnecessary rules and protocols that are just in your way. C# and the .NET framework were designed to get a job done. On a personal note, C# is the only "curly braces" language that I do not find ugly as hell or that I hate with a passion.

C# and Java are almost exactly the same. There a few very small syntactic differences but the real difference comes with cross platform compatibility and for that Java wins hands down all the time.

Mono does not support most of the recent .Net 3.5 features and is unlikely to support .Net 4 for ages therefore you can't truly call it a cross platform solution.

Java on the other hand is supported by just about every major operating system under the sun (and some not so major ones too). Performance between the two is pretty comparable too.
 
One more question,

At what age do people usually start programming?
When they get interested in doing so. Which can be 9 or 99.

Am I too young or too old?
You are the right age. You are the right age, because you have the reached the point where you want to learn it. Don't let anyone tell you that you are too young or too old to learn something. Sometimes it might be a bid idea to do it, though. Skydiving at 100 years. Having kids at 14 years. But you can always learn the principles behind it. Parachute design or how best to teach children something.

I know Bill Gates and Paul Allen started at 13/14....
Who cares what other people did. What you want to do (with your life) is more important. Within limitations, you obviously can't go around murdering people without consequences. Ask the advice of people who have your best interest at heart, but in the end it is your decision. You have to live with yourself, we don't. But it would be nice if you take us into consideration. Now, get of my lawn.
 
...I ASSURE you if you wanted to implement "Objects" in C it would be 100% possible. Its just not setup for you.
...

You can do object orientated programming in C. It just takes more work and results in slightly klunky syntax when compared with languages that offer it "natively".

I am interested to know how you would do polymorphism (dynamic binding) in C, because without that you do not have OOP.
 
I am interested to know how you would do polymorphism (dynamic binding) in C, because without that you do not have OOP.

Void pointers.

Edit: To go into greater detail you implement a base class (struct) with a void pointer and have every other struct "inherit" from it. That base class then holds a pointer to the specific instance of every class allowing you to determine its type at runtime.
 
well, i am 17 and have applied to various colleges in hopes of learning computer science (w.e that means. general term). anyways, i too would like to learn a language, but i dont know what the difference between java, c, c++, etc is. could someone help eliminate my ignorance? basically, what is java used to create? c? so on and so forth?
 
well, i am 17 and have applied to various colleges in hopes of learning computer science (w.e that means. general term). anyways, i too would like to learn a language, but i dont know what the difference between java, c, c++, etc is. could someone help eliminate my ignorance? basically, what is java used to create? c? so on and so forth?

Just pick one and start! If you are going to be a programmer or software engineer then you are going to use so many different languages that it won't matter where you started.
 
C++, Xcode and (my favourite) BASIC :D

Dont waste your time with Java.

why is java a waste of time??

Java is used in pretty much everything nowadays, and is a good essential language to know..

C/C++ are good to start with, and then moving to Java and .NET would be good. Perl, Python and Ruby would be some good ones to learn as well. Correct me if I am wrong, but OO coding is only good for Windows and linux, not Mac OS, right? Just started my Bachelors for Computer Engineering, not in my programming classes yet, so I dont know much...

well, i am 17 and have applied to various colleges in hopes of learning computer science (w.e that means. general term). anyways, i too would like to learn a language, but i dont know what the difference between java, c, c++, etc is. could someone help eliminate my ignorance? basically, what is java used to create? c? so on and so forth?

Tell me your not going for a general degree. You wont get much in the line of work that way. Pick something definitive, like programming/engineering, Game System engineering/programming, etc. Try to go with a college that offers jobs after college completion. I go to DeVry and have a choice of pretty much any job I want. Just some food for thought. As for the languages, C/C++ are the most common, and afaik know are used for games the most. Java is used in about everything now. Cell phones, mp3 players, web-based email, some game consoles, you name it. Hell, even some point of sale registers use it.
 
why is java a waste of time??

Java is used in pretty much everything nowadays, and is a good essential language to know..

C/C++ are good to start with, and then moving to Java and .NET would be good. Perl, Python and Ruby would be some good ones to learn as well. Correct me if I am wrong, but OO coding is only good for Windows and linux, not Mac OS, right? Just started my Bachelors for Computer Engineering, not in my programming classes yet, so I dont know much...



Tell me your not going for a general degree. You wont get much in the line of work that way. Pick something definitive, like programming/engineering, Game System engineering/programming, etc. Try to go with a college that offers jobs after college completion. I go to DeVry and have a choice of pretty much any job I want. Just some food for thought. As for the languages, C/C++ are the most common, and afaik know are used for games the most. Java is used in about everything now. Cell phones, mp3 players, web-based email, some game consoles, you name it. Hell, even some point of sale registers use it.

OO is good on any platform on any CPU on any OS. OO is a programming style, (Style used loosely) and is praised highly for its simplicity and power.

OO; here is object, do stuff to this object, object returns value.
Procedural; worry about what to apply this code too later. But as it stands Procedural languages are the only way to make an OS kernel.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.