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

RNDesigns

macrumors newbie
Original poster
May 16, 2009
11
0
USA
Hi all,

I'm new to this forum so I'll also use this post as an introduction.

I want to learn to program badly and I'm not having much luck at all. I've been trying to teach myself for years with very limited success. My first attempt was with RealBasic and I managed to do a few things with it.

I've been a Mac user for years (since about 1991) and have recently discovered XTools and have have trying to learn it along with Objective C and Cocoa.

Over the past couple months I've visited dozens of websites, read a lot of documentation and worked my way through many tutorials. No matter where I go, what I read or what I accomplish it seems like everything starts out in the middle and there is no really good place to get a basic understanding of programming.

For example, every thing that is a starting point for learning Objective C says you need a thorough understanding of C. I found what I thought was a good site for learning C and started working through it and learned a good deal, but in the end it really didn't help me. in understanding Objective C.

I am currently reading the "The Objective C Programming Language" at the Apple Developer website. (The 1.0 version because I don't have Leopard yet)

My problem seems to be not being able to get a handle on syntax. I can't seem to find a comprehensive document that gives the methods for objects. It seems everything I read assumes you know something else that I don't. Case in point: I tried to make a screensaver. I had success in making one from a tutorial but all I really did was copy code. When I tried to adapt it to my own needs it all blew up. The tutorial used rectangles an I wanted to make a simple line. I thought NSBezier path was what I needed to use but nothing I tried would make a line.

I don't want to ramble on and on. Maybe this will give someone here a key to help me know what to do from here. I'm not a stupid person; I know I can get this if I can just find someone to help a non-programmer from the beginning.

Thanks for reading.
 

GorillaPaws

macrumors 6502a
Oct 26, 2003
932
8
Richmond, VA
Get the Kochan book: "Programming in Objective-C 2.0: 2nd edition". It's really well written, and will give you the foundation you're going to need to move on to Cocoa.
 

RNDesigns

macrumors newbie
Original poster
May 16, 2009
11
0
USA
Stop with hat C baggage and start here:

http://htdp.org/2003-09-26/
I got this far:

To focus our studies on the important concepts of computing and not on these details, the teaching languages of DrScheme deal as much as possible with numbers as precise numbers. When we write 1.25, DrScheme interprets this number as a precise fraction, not as an inexact number. When DrScheme's Interactions window displays a number such as 1.25 or 22/7, it is the result of a computation with precise rationals and fractions. Only numbers prefixed by #i are inexact representations.

Exercise 2.1.1.

Find out whether DrScheme has operations for squaring a number; for computing the sine of an angle; and for determining the maximum of two numbers. Solution

Exercise 2.1.2. Evaluate (sqrt 4), (sqrt 2), and (sqrt -1) in DrScheme. Then, find out whether DrScheme knows an operation for determining the tangent of an angle. Solution

Get the Kochan book: "Programming in Objective-C 2.0: 2nd edition". It's really well written, and will give you the foundation you're going to need to move on to Cocoa.

I don't want to buy any books.
 

eddietr

macrumors 6502a
Oct 29, 2006
807
0
Virginia
I don't want to buy any books.

Then, unfortunately you're starting at a pretty big disadvantage and you've answered your own question about why you're struggling with this.

I don't buy books very often anymore either. But that's after 25 years of programming. At that point reference docs are more than enough.

But if you're just starting out and you can't take a class or two to help you get started, then at least consider buying a couple of books. Yes, it is possible to learn without books. It's also possible to walk from NY to Boston. But why would you want to?
 

RNDesigns

macrumors newbie
Original poster
May 16, 2009
11
0
USA
Then, unfortunately you're starting at a pretty big disadvantage and you've answered your own question about why you're struggling with this.

I don't buy books very often anymore either. But that's after 25 years of programming. At that point reference docs are more than enough.

But if you're just starting out and you can't take a class or two to help you get started, then at least consider buying a couple of books. Yes, it is possible to learn without books. It's also possible to walk from NY to Boston. But why would you want to?

Maybe you're right and maybe, after all is said and done I'll have to shell out 50 bucks or however much to learn this.

On the other hand, I'm kinda worried about doing so. The internet is a wonderful place to learn lots of stuff. What if a book doesn't get me any further than what I've gotten off the internet? Then I'm at the same place as now and a few dollars shorter.
I'm telling you, I've done a lot of searches for a lot of things and so far I've been able to learn everything I've needed to know on every subject except this and one other for free.

In other words, I find it hard to believe that the only usable knowledge about programming can be learned from purchasing a book.

WADR,
Rick
 

RNDesigns

macrumors newbie
Original poster
May 16, 2009
11
0
USA
I don't mean to sound like a tight-as y'all.

I guess the main thing is that all I want to do is stuff for myself. I don't want to develop games for sale or anything like that. If that was my goal I'd be more than willing to buy a book or any other tools to get the job done but to be honest I just want to do this to learn something new and maybe if the opportunity presented itself I could give back something.
 

GorillaPaws

macrumors 6502a
Oct 26, 2003
932
8
Richmond, VA
Kochan's book is around 600 pages long (and it doesn't even cover the app kit stuff). There is a LOT of basic theory to understand before you can do much of anything. Some of the theory is basic programming concepts and logic, and the rest is specific to objective-c--all of it is pretty essential.

It's true that there is a ton of freely available information out there on the web, but usually it comes in bite-sized chunks. The reason for this is that many people are willing to volunteer their time and expertise to helping share knowledge with others in small bits. However, very few are willing to put together a massive and comprehensive project on the scale of teaching a beginner to programming most of what he needs to know to be a competent Cocoa programmer. The time/energy/resources required to produce something on this scale really dictate that it be released in a published form.

To use an analogy, I can certainly look up most any legal principle or significant court ruling on the web, but there really aren't any free resources out there that would give me the knowledge necessary for passing the bar. I can personally attest that Kochan's book really helpped me personally, and it's only 30 bucks. It's not really that big of an expense in the big picture, and if you somehow manage to read the whole thing and not find it valuable, you can always re-sell it. You could always try your library (I donated my 1st edition copy to my local library so maybe someone near you did the same).
 

chrono1081

macrumors G3
Jan 26, 2008
8,456
4,164
Isla Nublar
I don't want to buy any books.

:eek::eek::eek:

Books are really the only way to learn programming in depth. As another poster mentioned you will find bits and pieces online, but you get what you pay for and online is free.

I've never used the Kochan book but I know I will be ordering it. Coming from C++ I can work my way through some online tutorials but I know they are lacking a lot.

If you will be learning programming you will end up buying books. LOTS of books. Even once you finish them you will always be looking back to them for references.
 

t0mat0

macrumors 603
Aug 29, 2006
5,473
284
Home
One way is to have the book next to you on a benchtop as you work on playing with code on your desktop/laptop. You can dip in whenever, and follow the book, or find things in the book as you hack the code. Check your mail.
 

RNDesigns

macrumors newbie
Original poster
May 16, 2009
11
0
USA
One way is to have the book next to you on a benchtop as you work on playing with code on your desktop/laptop. You can dip in whenever, and follow the book, or find things in the book as you hack the code. Check your mail.

I checked my mail. I need a way to get in touch with you.
 

HyperSnake

macrumors member
Jan 5, 2009
74
0
Switzerland
The web is a great place, but you never find big tutorials there, believe me I tried it when I was in your situation just 3 months ago. After a night of research I found out I would need a book. Kochan's book tought me everything and guess what? I'm currently finishing my second iPhone app. To say you want to learn programming but not buy a book is like saying "I wanna learn how to read and write but I don't wanna go to school". When you have learned how to program( or as in the example, write ), sure
All the help you'll need is online but the for
the basics, you'll need a book(or as in the example, go to school.)

PS. Unless you're really stupid, I can tell you that programming is not difficult to learn.
 

firewood

macrumors G3
Jul 29, 2003
8,108
1,345
Silicon Valley
The suggestions here are garbage.

If you are having trouble, then learn a really simple programming language first, not Obj-C for Mac OS.

Look in the children's section of your local library and see if there are any easy intro to programming books there. Look for a beginning programming book you find entertaining and can understand quickly, doesn't matter if it's for Logo or Basic, or some other currently unfashionable language. Script a few really ugly web pages using HTML and Javascript. Or play with perl, python or Squeak on your Mac.

Then move on to C and Obj-C. You will know far more in the end.

In the early days of military aviation, they put smart strong recruits directly in regular line aircraft, and some really huge percentage were killed. Then they made new pilots learn their chops in little ground trainers that looked more like toy amusement park rides, and the rate of dead pilots went way down.


ymmv.
 

carlosbutler

macrumors 6502a
Feb 24, 2008
691
2
i agree with the previous poster. although programming in children's section is a bit strange, but w/e

start of with the most basic of coding, HTML, PHP, Javascript and then try Java if you want. There are loads of things on Java, and some great development programs such as Eclipse or NetBeans.

Once you have an understanding of php and javascript or java for example why if, else if, loops, classes, methods, method overloading, polymorphism etc then you are all good to start basics of C or something like that.

ive only just started first year of computer science and we have been taught html, css, php, haskell, java, sql and other things. haskell was the weirdest one, but all really easy.
 

iBadger

macrumors member
Apr 20, 2009
56
0
I know you are looking for C programming but you want to learn the fundamentals. I'd recommend checking out Java for your first language. My university switched from C++ to Java and the community colleges around me now use Java. Once you get the basics down you can pick up any language.

You can download a simple straight forward IDE like - Dr. Java
http://www.drjava.org/
Easy enough to get you programming fast and you won't have to worry about all the bells and whistles of other IDE's.

As far as books I highly recommend - Building Java Programs: A Back to Basics Approach .
Look around pick it up USED $40- http://www.amazon.com/Building-Java...=sr_1_1?ie=UTF8&s=books&qid=1243138133&sr=1-1

It's a book for the classroom, it is straight forward with plenty of small programs/projects at the end of each chapter. It starts out with the very basic and get you into more advanced stuff.
 

skochan

macrumors regular
Apr 1, 2006
150
0
California
I guess I'll add my 2 cents to this discussion. First, I agree that an understanding of some basic programming concepts is helpful. I don't agree, however, that you should learn a language like Java or C first. I have posted elsewhere in this forum my opinion that learning a procedural language if your goal is an object-oriented one is a mistake. Why learn an approach to programming that you later have to essentially "unlearn"? It's much better to start with an object-oriented approach to problem solving, algorithm development, and program construction. If Objective-C were not a superset of C, I wonder if learning C would still be recommended first? I doubt it. That's not to say that later on you will not need to learn things like structures, pointers, etc., but why learn all that before you learn how to define a class or send a message to an object?

If you do decide to use my book, there's a good support site for the book that exists to help you with your questions, I'm active there as are the other members who are very willing to lend a hand.

Best of luck,

Steve Kochan
 

firewood

macrumors G3
Jul 29, 2003
8,108
1,345
Silicon Valley
If Objective-C weren't a superset of C it would be Squeak... a very attractive academic and teaching language that has (rounded) 0.0% traction in the real world.

I wish there were books on Squeak programming, but does it have enough market share to interest a good author?

C works because it's almost just a macro assembly language for DEC minicomputers... and now for RISC micros. You can use C to make code run real fast on real hardware with very little memory (and cache, and battery power). Perfect for mobile and green computing.

Dynamic OOP allows one to rapidly create more reliable apps that scale up better. Perfect for RAD, rich GUI and maybe distributed cloud computing.

The marriage is what made this hybrid language succeed (and continue to succeed).

IMHO.
 

skochan

macrumors regular
Apr 1, 2006
150
0
California
C works because it's almost just a macro assembly language for DEC minicomputers... and now for RISC micros. You can use C to make code run real fast on real hardware with very little memory (and cache, and battery power). Perfect for mobile and green computing.
IMHO.

I'm not disagreeing with your statements; however you could extend the argument to learning assembly language before C, and I don't think that's necessary either. Once again, I agree that C needs to be learned, but as a teacher, I'd rather not have a student have to learn all about functions, structures, malloc, pointers, etc. before defining their first class or sending their first message (This is for new programmers once again.)

I think tackling a problem from an object-oriented perspective is very different from approaching the problem procedurally. So why learn one approach to programming first and then have to almost unlearn it after? Of course, a combination of the two approaches will ultimately be the best tools for the programmer.

As an example, early in my book I introduce a Fraction class and develop methods for performing operations on them like addition, subtraction, etc. If you learn C first, you'll write functions to do similar things and pass around structures. That just doesn't seem like the right pedagogical approach to me.

I welcome this discussion as I spent a long time deciding to take the approach of not teaching C first.

IMHO. :)
 

firewood

macrumors G3
Jul 29, 2003
8,108
1,345
Silicon Valley
I recall a undergraduate computer survey course for non-majors. University of California campus. Long ago. No textbook, since the survey covered a dozen completely different topics in computing. The only programming language they introduced was a toy assembly language for a cardboard computer. Not in any real detail of course, but the professor wanted even non-programming students to have a feel for the underlying machine before going off onto other survey topics such as AI, social aspects of computer use, and etc.

So, yes, I could extend the argument that the first chapter of an intro to computing book should start off with an assembly language (in a safe emulated environment).

Then I would skip to something like Squeak, Logo, Basic, or some other well sandboxed early education language, where one can get some fun and immediate output with only a very few lines of code, and not knowing the details isn't dangerous. It's far easier to learn to experiment with and debug algorithms in this kind of environment.

Then I might move on to C and Obj-C.

Then the novice programmer would have a better chance of realizing that they are working in the middle of an abstraction ladder, and hopefully post less unbelievably clueless questions here.


imho.
 

hudsonr

macrumors newbie
Aug 2, 2009
2
0
Houston, Texas
Beginner - Objective-C

To all:

I have no programming experience and have purchased Steve Cochan's Objective - C 2.0 book/video. I have just gotten started and would also be interested in taking structured classes. I have check around on the web and classes on Objective-C range from 2-7 days and do not include meals and travel at a cost of $1500-$5000. That's a lot of money for a 2-7 day class in my opinion.

Can anyone suggest where I cam get hands-on training for Objective-C at a more affordable price? I am located in Houston, Texas.

Any comments are welcome.

Thanks!

Hudson Reed
Houston, Texas
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.