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

liptonlover

macrumors 6502a
Mar 13, 2008
989
0
sorry forgot my smiley face I'm not actually mad :D
Yes I know it's not considered an "ideal" language to learn, but I did learn a lot from it and I'm sure it made it easier to learn C and objective C than if I had no programming experience at all, like I said so actually it kind if is useful. It was easy to learn, and it put me in a position to learn other languages.

Ugh... labels and goto. Those are supported in the modern BASIC I used to use, but I was warned and knew well enough to steer clear of them.

I'm fortunate not only that I got into programming at a very young age, but that my dad knew more than just BASIC and warned me of those bad habits. So actually I guess if you don't have a good teacher learning BASIC is the worst language if you're serious about programming.

And like I said, I wasn't actually mad/offended just forgot to add a smiley face :cool: so it's all good.

On a side note... looking back I actually got into programming earlier than I thought... I was about 8-9 when I started watching my dad program, and while I wasn't writing my own apps then I was learning and asking a LOT of questions. I remember fondly asking him a million and one questions :rolleyes:
 
You have mentioned twice that you are impatient, so I would strongly suggest you go with python. It will take you a long way, you can do 95% of what you can do in C and you will progress much faster than with C. Learning C, especially outside any formal course of study, will likely prove very frustrating and you will experience the satisfaction of solving problems and programming much more quickly with python.

The Hillegass book is definitely not a wasted purchase if you want to build OS X apps (as in the cool Cocoa desktop ones), which can also be done in python. And, on that basis, the answer to the thread title, is definitely no, btw.

Most good programmers will at some time delve into C and if you stick with programming this will come fairly naturally as you try to solve problems and optimise your code and learn new skills.
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
I think to summarize this thread:
1) No, you don't need to learn C before learning Objective-C
2) Yes, you should learn C before learning Objective-C

=)

Essentially the real take-away here is everyone has a different opinion and experience in terms of learning programming and Objective-C in specific.

I don't think anyone is harmed by learning C first, and especially if your goal is C++ or Objective-C which are a near-superset and proper-superset respectively, it's definitely a solid foundation. If you have an Objective-C book that covers C concepts first, you should be fine. I would want to at least know how pointers work, general syntax (operators, statements, control structures), and function invocation before diving into the parts of Objective-C that are not C.

-Lee
 

liptonlover

macrumors 6502a
Mar 13, 2008
989
0
If you want to get started in ObjC without going through a C textbook though, really the cocoalab.com book is excellent. It's close enough to up-to-date that you won't have a problem with it, and it's very humanish not just listing a bunch of facts, but acting like you're having a conversation. It's also pretty short, you don't have to have a book sitting uncomfortably on your lap to read it since it's a pdf, and it assumes you don't know C. And if you don't understand a term, simply google it!
 

I'm a Mac

macrumors 6502
Original poster
Nov 5, 2007
436
0
You have mentioned twice that you are impatient, so I would strongly suggest you go with python

I'm not really an impatient person, I just didn't like the idea of having to learn an entire language before learning what I wanted to learn: objective c and cocoa. Thanks for the tutorial on cocoalab, it really helped. The kochan book turned out to be pretty useful too, I just had to get past the fact that I wasn't supposed to understand everything at first, but to keep reading on and read the explanations later.

Also, is visual basic the same thing as BASIC? Next year, I was thinking of taking a computer programming I course, but according to the description it "provides a foundation to programming with visual basic". Is this worth taking, or is it going to be no use if I want to get into Cocoa? Also, what's with all of the fuss about C++ on this forum? What can you do with C++ in mac programming?
 

Aranince

macrumors 65816
Apr 18, 2007
1,104
0
California
Yes, Visual Basic is a Basic language and won't really help you at all...since its for Windows only. C/C++ is somewhat simpler than Objective-C, because its not what they call dynamically typed. I have experience with Java and C++, and looking at ObjC code scares me.
 

cherry su

macrumors 65816
Feb 28, 2008
1,217
1
You have mentioned twice that you are impatient, so I would strongly suggest you go with python. It will take you a long way, you can do 95% of what you can do in C and you will progress much faster than with C. Learning C, especially outside any formal course of study, will likely prove very frustrating and you will experience the satisfaction of solving problems and programming much more quickly with python.

The Hillegass book is definitely not a wasted purchase if you want to build OS X apps (as in the cool Cocoa desktop ones), which can also be done in python. And, on that basis, the answer to the thread title, is definitely no, btw.

Most good programmers will at some time delve into C and if you stick with programming this will come fairly naturally as you try to solve problems and optimise your code and learn new skills.

I'd recommend Python and Java. Both have easy syntax and have good integration with OS X. As for tutorials and documentation, search for stuff on google. Actually, I can give you some code samples of "Hello World" in several languages:

C:

int main() {
printf("Hello World!\n");
return 0;​
}

C++:

int main() {
cout << "Hello World!" << endl;
return 0;​
}

Java: (must be saved in file called "helloworld.java")

public class helloworld {
public static void main(String args[]) {
System.out.println("Hello World!\n");​
}​
}

Python:

print "Hello World!"

And in the possibly weirdest language, Brainf***:

++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.

Sorry if I confused you with this very long post!
 

aLoC

macrumors 6502a
Nov 10, 2006
726
0
Cocoa has Objective-C APIs for a lot of things, but not everything, sometimes you just have to use C. Also, Cocoa is built on a layer called CoreFoundation, which is pure C, and which pokes through quite often.

You should probably at least do a quick overview of C before learning Obj-C, but maybe you can save some of the nitty gritty details until later.
 

Jaschr

macrumors member
May 27, 2008
39
0
I'm a noob as well, so excuse my ignorance. You guys have been comparing different programming languages throughout the thread, how does Applescript fit in?
 

liptonlover

macrumors 6502a
Mar 13, 2008
989
0
I don't know applescript personally but from what I can tell you can use it for smaller tasks, using it like an advanced automator or to make little apps. Check out apple's official applescript page, that shows you right there things people have done with it.
 

pilotError

macrumors 68020
Apr 12, 2006
2,237
4
Long Island
Snip...
Also, is visual basic the same thing as BASIC? Next year, I was thinking of taking a computer programming I course, but according to the description it "provides a foundation to programming with visual basic". Is this worth taking, or is it going to be no use if I want to get into Cocoa? Also, what's with all of the fuss about C++ on this forum? What can you do with C++ in mac programming?

The truth is that all languages have a basic foundation. Things like loops, variables, functions, parameters, etc. are pretty much the same across all languages. Each language has its own way of doing things, but essentially, a loop is a loop. It does one thing, loops for some number of times. Syntax in C/C++ and Ojbc are the same, Java too for that matter. When you get into the scripting languages, some things are very different (Perl), but don't get caught up in that.

One thing to realize when starting out is not to get caught up in the implementation. If you know one object oriented language, you can pretty much apply those concepts in any language.

The other thing to realize is that the user interface API's are very different on each platform, but the concept is pretty much the same. Buttons, Dialog Boxes, Text Boxes, etc. each have a mish mosh way of doing things.

Learning C is a decent place to start. It will give you a good foundation of the basics. It will also let you appreciate the fact that everything you do in C has to be written from scratch. There are no Class Libraries or Foundation Classes that provide all the builtin stuff.

The Kochan book will give you a good foundation. Don't get too caught up in being a C expert. I would then recommend the Cocoa programming for OS X by Aaron Hillegass. That will give you the introduction to objective C and Cocoa, and will give you a solid foundation in both of those. The cocoadev site has a bunch of really good tutorials, but there isn't a solid progression like the Hillegass book.

Once you've gone through the second book, think about what you want to accomplish (think up a small program) and try and complete it. There's no education better than doing something new that you can't rely on a book for. It forces you to think about the problem. Then you can more effectively use the tutorials on cocoadev to learn things that you want to incorporate into you program. It's better to do this, because you have a context in order to place things in. Going through tutorials is nice, but when you have no where to apply them, they become meaningless exercises after a while.
 

aLoC

macrumors 6502a
Nov 10, 2006
726
0
I'm a noob as well, so excuse my ignorance. You guys have been comparing different programming languages throughout the thread, how does Applescript fit in?

Scripting languages are more "high level" than languages like C. You typically make your program by joining together other programs in to some kind of workflow. By contrast, in a language such as C, what you are joining together is not other programs, but more fundamental things such as commands and functions.
 

Sander

macrumors 6502a
Apr 24, 2008
521
67
What I saw nobody mention yet is that Kochan's book is really not a good text on object orientation. When introducing inheritance, he makes the classic mistake of making "Square" inherit from "Rectangle", which is plain wrong.
 

I'm a Mac

macrumors 6502
Original poster
Nov 5, 2007
436
0
What I saw nobody mention yet is that Kochan's book is really not a good text on object orientation. When introducing inheritance, he makes the classic mistake of making "Square" inherit from "Rectangle", which is plain wrong.

I haven't really read that part yet... Should I skip that chapter? Where could I get a good description of object orientation?
 

pilotError

macrumors 68020
Apr 12, 2006
2,237
4
Long Island
What I saw nobody mention yet is that Kochan's book is really not a good text on object orientation. When introducing inheritance, he makes the classic mistake of making "Square" inherit from "Rectangle", which is plain wrong.

Does the latest edition of "Programming in C" cover inheritance? It shouldn't since "C" isn't object oriented, but hey you never know...
 

atreju85

macrumors newbie
Apr 1, 2007
2
0
Difference between learning how to program and learning a language

Hi, I'm a Computer Science student from Italy and I just wanted to share an insight with you.

You want to learn to program Cocoa.
Cocoa is a framework that you code in Objective-C, so you must know Objective-C.

Objective-C is a superset of C, so you really need to know some C. Maybe you won't need to be a C wizard, but C is everywhere in Objective-C.

One last point, the most important one :): there is a difference between learning to program and learning a language. If you never programmed before you have to start with a book that will teach you how to program from the beginning, using a language as an example, and not with a C reference book, which is something that programmers use when they don't remember something.

In Computer Science at University we use this free book: http://www.htdp.org/
It's a beginners book and covers many important topics like recursion and ordering algorithms, but it uses Scheme, which is a functional language, much different from C.

If you want to start with C I suggest this:
http://www.deitel.com/Books/C/CHowtoProgram5e/tabid/1704/Default.aspx

I have the C++ version and it's crystal clear.

So good luck and don't confuse "programming" with "programming languages"! It's like confusing the ability to write a book and the ability to use Word (or Pages ;)).

Programming is about algorithms. The language is a tool to implement the algorithm you are thinking about.
 

psingh01

macrumors 68000
Apr 19, 2004
1,586
629
I would also recommend the "C How to Program" book. I used the C++ one in college and thought it was well written. Learning your first language will be hard and will take time just to let everything sink in. However, once you learn one, learning others will be much easier :)
 

hayesk

macrumors 65816
May 20, 2003
1,460
101
I'd recommend getting a good book on algorithm design and analysis too. And another on UI design. You can be an expert on language syntax and frameworks, but still make crappy software.
 

HiRez

macrumors 603
Jan 6, 2004
6,265
2,630
Western US
You have mentioned twice that you are impatient, so I would strongly suggest you go with python.
That would lead me to strongly suggest you not become a programmer. I don't know how you could be a successful one without a good amount of patience. In my experience, most of programming involves solving puzzle after puzzle, some large and some small, and tracking down bugs. This is also what makes it interesting to me because I like puzzles, but it's not for the impatient.

Having said that, I also think Python would be an excellent learning language. But, I also feel it's important to find interesting projects to keep you motivated, and for me personally, it's pretty cool when you can have a sophisticated working user interface up and working very quickly, especially one as slick as a Cocoa interface. So for that reason I wouldn't say jumping right into Objective-C and Cocoa would be the worst thing, as long as the person has the mindset and, well, patience, to explore the ins and outs of C, fundamental programming concepts, standard algorithms, design patterns, etc.. The Hillegass book actually does an amazing job of getting you up and running from practically scratch and teaches a few fundamentals along the way.
 

CaptainZap

macrumors regular
Jan 17, 2007
170
0
What I saw nobody mention yet is that Kochan's book is really not a good text on object orientation. When introducing inheritance, he makes the classic mistake of making "Square" inherit from "Rectangle", which is plain wrong.

Just curious, why is it so wrong?
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
Just curious, why is it so wrong?

I am actually curious about this as well. I wouldn't fight hard on either side of this argument, but it seems to be that a square is a special case of a rectangle. Whether or not one would need a special square class or not might be questionable, but why is this wrong?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.