PDA

View Full Version : New to programming...




zosoeffex70
Oct 28, 2005, 05:53 PM
I'm new to programming of any sort and wanted to learn C/C++, Java or Python languages and do it on my Mac, but I'm a little lost as to how to use these languages for programming on the Mac. Where do I find the right, preferable FREE, software to do that?

Thanks!



HiRez
Oct 28, 2005, 06:12 PM
I'm new to programming of any sort and wanted to learn C/C++, Java or Python languages and do it on my Mac, but I'm a little lost as to how to use these languages for programming on the Mac. Where do I find the right, preferable FREE, software to do that?
Install the Xcode developer tools from your Tiger (or Panther) CD/DVD. You might actually be able to do Python without installing the tools (it's a command-line tool), I can't remember if it's installed in the normal version or not. But anyway, Xcode is Apple's free development IDE that can handle most of the things you want. There are other options for Java development as well, such as NetBeans, Elcipse, and others, but you'd have to download and install those yourself. If doing Python development, you will probably want a good text editor with Python syntax highlighting. I recommend the free TextWrangler, which you can find on www.versiontracker.com. Best of all is for you to use the SEARCH feature on this forum to find other threads about this, your question has basically been answered many times already. Good luck.

Laser47
Oct 28, 2005, 06:13 PM
To program C and C++ on the mac you can use apples xcode, its free. You can download it from the Apple Developer Connection.

zosoeffex70
Oct 28, 2005, 06:22 PM
To program C and C++ on the mac you can use apples xcode, its free. You can download it from the Apple Developer Connection.

Got it thanks. Will search more and I appreciate you input/help!

zosoeffex70
Oct 28, 2005, 06:35 PM
To program C and C++ on the mac you can use apples xcode, its free. You can download it from the Apple Developer Connection.

Excellent, I have it (just recently downloaded it) and wasn't sure of it's potential and with your suggestion I will read the documentation and get started.

Say, do you know of any good books that would get me started programming in C w/Xcode as a beginner?

Thanks for you help! -gene

zosoeffex70
Oct 28, 2005, 06:37 PM
Install the Xcode developer tools from your Tiger (or Panther) CD/DVD. You might actually be able to do Python without installing the tools (it's a command-line tool), I can't remember if it's installed in the normal version or not. But anyway, Xcode is Apple's free development IDE that can handle most of the things you want. There are other options for Java development as well, such as NetBeans, Elcipse, and others, but you'd have to download and install those yourself. If doing Python development, you will probably want a good text editor with Python syntax highlighting. I recommend the free TextWrangler, which you can find on www.versiontracker.com. Best of all is for you to use the SEARCH feature on this forum to find other threads about this, your question has basically been answered many times already. Good luck.

Thanks, this is very helpful - I appreciate you time and quick input! -gene

deanbo
Oct 28, 2005, 06:52 PM
C++ Primer Plus by Stephen Prata is a very good book for beginners if you want to learn C++.

zosoeffex70
Oct 28, 2005, 07:11 PM
C++ Primer Plus by Stephen Prata is a very good book for beginners if you want to learn C++.

Thanks - will note that book. Also, I read in Absolute Beginner's Guide to Programming - Greg Perry - Que Publishing that Visual Basic was a great place to start programming and then perhaps C before C++ or Java since the latter (2) were similar to C and that it would be a good foundation. Now I've learned that VB isn't done a Mac and that it's a 'legacy language' that will soon lose support from MS.

I haven't programmed a lick and just want to figure out the best place to start and do it using my Mac. I guess I need to learn how to use Xcode AND beginning programming - kinda feels like a catch 22.

wala
Oct 28, 2005, 08:15 PM
Xode's native coding language is Objective-C, which is supposed to be an easier to learn and use than any other C dialect. Also, maybe you would like to give Xcode's AppleScript Studio a go before actually going into C.

zosoeffex70
Oct 28, 2005, 09:06 PM
Xode's native coding language is Objective-C, which is supposed to be an easier to learn and use than any other C dialect. Also, maybe you would like to give Xcode's AppleScript Studio a go before actually going into C.

Good deal - thx! I also ran across this info:
http://www.cyberdiem.com/vin/learn.html
Later, Gene :cool:

Nuc
Oct 28, 2005, 09:12 PM
Thanks - will note that book. Also, I read in Absolute Beginner's Guide to Programming - Greg Perry - Que Publishing that Visual Basic was a great place to start programming and then perhaps C before C++ or Java since the latter (2) were similar to C and that it would be a good foundation. Now I've learned that VB isn't done a Mac and that it's a 'legacy language' that will soon lose support from MS.

I haven't programmed a lick and just want to figure out the best place to start and do it using my Mac. I guess I need to learn how to use Xcode AND beginning programming - kinda feels like a catch 22.
If MS drops support for VB what programming language will they have for excel?

Also could someone point me to a good place on visual basic, I've been trying to do some programming in excel. Trying to link a fortran code w/ excel using VB.

Nuc

zosoeffex70
Oct 28, 2005, 10:20 PM
If MS drops support for VB what programming language will they have for excel?

Also could someone point me to a good place on visual basic, I've been trying to do some programming in excel. Trying to link a fortran code w/ excel using VB.

Nuc

Have you stopped by: http://www.xtremevbtalk.com/forumdisplay.php?f=7
May be a good resource.

-gene

gekko513
Oct 28, 2005, 10:33 PM
Visual Basic is horrible from a programmers perspective. You'll be better off by starting with a proper language. C++ is most powerful, but it can be complicated. Java is very tidy and strict, easier than C++, but not as powerful. Some like Python, but I don't know too much about it. I think the advantages of Python is that it has some convenient solutions and has a clean and simple syntax.

If you want to use Xcode, Objective C is the easiest language to use. Xcode and Interface Builder works best with Objective C.

OutThere
Oct 28, 2005, 11:11 PM
If MS drops support for VB what programming language will they have for excel?

Also could someone point me to a good place on visual basic, I've been trying to do some programming in excel. Trying to link a fortran code w/ excel using VB.

Nuc

Ugggghh...Fortran. :eek:

for the OP: If you really want to use XCode (which is an awesome App) go for Objective C which will integrate well with the interface builder, which is a lifesaver. :)

savar
Oct 29, 2005, 12:19 AM
Excellent, I have it (just recently downloaded it) and wasn't sure of it's potential and with your suggestion I will read the documentation and get started.

Say, do you know of any good books that would get me started programming in C w/Xcode as a beginner?

Thanks for you help! -gene

Get started in Obj-C. A good book is the Aaron Hillegrass (Hillegass?) book. There are others...did you read the sticky in the developer's forum? Also, go on usenet and look at comp.sys.mac.programmer.help. Lots of helpful people there.

AlmostThere
Oct 29, 2005, 05:48 AM
and take a couple of minute to think aboute why you want to learn programming?

Do you have an idea for some great programme you want to write?

Are you generally interested in computers and want to take that interest one step further?

Are you tired of manually doing stuff that really should be automated?

What sort of person are you?

Do you want quick, instant rewards - do you need to get a task done, quickly, and then move on to the next. Do you have a hundred ideas running about in your head that need to be fleshed out before the next hundred come along and take their place?

Are you methodical and pedantic? Do you have the time and motivation when yet another, 'one more', tiny, frustrating error crops up. Will you keep pushing on in the face of complexity and frustration? Do you have some grand plan in mind, where every detail matters. Do you insist on perfection and knowing every tiny detail of your projects?

Choosing a programming language to learn really depends on all these things. Most important is to remember that any language is a tool that you use to implement your ideas and as such you need to choose the right tool for each job, so if you fill in a bit more background it will be much easier to give you some good advice.

With nothing else to go on, I would suggest that Python is a good language to learn for a beginner. It is very easy to get started with. It has a fantastic amount of depth. It encompasses everything from web programming to 3D graphics. You name it, it is there.

ll350
Oct 29, 2005, 07:01 AM
At least from the view point of being a n00b in general, and learning java, I found Xcode quite a bit less than intuitive. But your experience maybe different. If you do have trouble with Xcode specifically, you should know that there are other ways to get your feet wet in programming for free. Pretty much every company that makes a program for writing code offers a free version. Personally I'd recommend Eclipse, but that just me.

Anyway this website might be helpful if you have no other access to programing info:

http://www.freetechbooks.com/

Just a word of warning, most of these aren't written with the mac programer in mind, so while the principles of the programming language are the same, the specifics of using Xcode won't be covered. I bought 2 books trying to figure out how to use Xcode, neither of which were as helpful as the Xcode Documentation. You should download the documentation from Apple Developer Connection (you can get an account for free) Once you have the documentation and it is installed, open up "Xcode User Guide" and start reading. It will actually be Xcode 2.1 User Guide, or whatever version of Xcode that you are using.

zosoeffex70
Oct 29, 2005, 07:25 AM
and take a couple of minute to think aboute why you want to learn programming?


• Automation: YES, YES, & YES!
• I'm fascinated with computers/apps/internet
• I could sit in front of my laptop or any computer for hours without interruption and be very happy
• I'm sure I experience frustration when things done work perfectly, but I lie awake at night searching my mind to figure out solutions - a quiet time for an epiphany or the occasional 'EUREKA!' and experience a great sense of satisfaction once a problem is resolved/understood.
• Ideas for programs do come to mind; not really a constant flood of ideas - but I think that some of that creative spark will be enhanced once I begin to get my feet wet with coding and see what's really possible
• My inclinations are towards order, detail, use, function & asthetics

If I start with Python will C/C++/Java be harder to learn? One author stated that C is a good place to start as it builds a solid foundation to learn other 'C similar' languages. Have you found/seen/heard that employment opportunities for Python programmers are abundant/in demand? I guess I have a dual goal of learning a language that will also facilitate employment.

zosoeffex70
Oct 29, 2005, 07:52 AM
Personally I'd recommend Eclipse, but that just me.

I went the website for Eclipse and read this about a Java 'run-time environment':

http://download.eclipse.org/eclipse/downloads/drops/R-3.1.1-200509290840/java-runtimes.html

On the page above it does not display a Mac platform - what to do? Again, I'm very ignorant about programming/IDEs etc...

zosoeffex70
Oct 29, 2005, 08:05 AM
Anyway this website might be helpful if you have no other access to programing info:

http://www.freetechbooks.com/

Say, I found this (@ freetechbooks.com) that looks like a good break down for the n00b programmer - looks like it may help - we'll see still gotta read it!

http://samizdat.mines.edu/howto/HowToBeAProgrammer.html

AlmostThere
Oct 31, 2005, 06:41 AM
If I start with Python will C/C++/Java be harder to learn? One author stated that C is a good place to start as it builds a solid foundation to learn other 'C similar' languages. Have you found/seen/heard that employment opportunities for Python programmers are abundant/in demand? I guess I have a dual goal of learning a language that will also facilitate employment.

Harder to learn than if you try to learn programming with no previous experience? I don't think so.

But learning a low level language will help you more in learning higher level languages than learning a higher level language will help you learn the lower level ones.

The thing with the lower level languages (C/C++, I would probably address Java as slightly higher level) is that there is much more to write to get simple tasks working. What the lower level languages do offer though, is a good insight into how a machine actually works. It is far from necessary to know this to deliver functional, working programmes. The learning process will be much slower, especially if this is self directed learning, and rewards much more spread out.

A week into learning any programming from scratch, it is probably a good level of achievement to have a console app (i.e. run through Terminal) that reads input and offers some sort of response (whooop-di-do!). A month in to a higher level language and you will probably, depending on direction, be able to offer useful web scripting functionality or be touching on aspects of GUI design and graphics. With a lower level language, you will probably still be wrestling with concepts like memory management and pointers.

That is not to say that these languages do not have their place - some of the stuff I am working on at the moment involves billions of calculations and the performance overhead of Python just does not make this a feasible option for running on a regular basis (I still used Python to prototype my algorithm, though). By comparison, I attached some back-end functionality to a website through CGI using Python; I could have used C++, the functionality is still there, but the same task, mostly text / xml processing, would have taken at least twice the time.

Having come from C / C++ to higher level languages, the word I use is describe it is 'rewarding'. There are some surveys on google (er, somewhere) asking programmers what they think about their languages. Ruby and Python were reliably the ones that people actually enjoyed using. Go figure.

As for job opportunities? Much harder to say for a specific language (flick through some recruitment websites) but again you will get to a commercial level of quality (god, I hate that phrase, there is some horrendous stuff written to get something through the door and actually doesn't mean very much at all) in a high level language faster than in a language like C. You won't find that many openings if you have less than 2 years experience in C++, again that's "commercial" experience. I have seen people employed with basic / rudimentary PHP skills employed in entry level positions and who have moved up very quickly to interesting and rewarding projects as they have learned skills on the job.

So, hopefully my previous comment is a little more in context. There is much to be learned from low level languages. Yes, they offer a good foundation to build upon. But, that comes at a price. they can be frustrating with few rewards. Development can be slow and tedious. But if (er, when, naturally) I have that "one great idea" for the archetypal killer app, it is very unlikely that C or C++ is going to be my first port of call. I might come back to it later, but for getting my ideas fleshed out, I need to have skills in a language that allows me express what ever insane, whacked out thought has crossed my mind, not one that requires levels of concentration that would make Uri Geller quake in his boots.

As for automation bit: well, if you are just doing repetitive tasks, moving files, you could do worse that spend an afternoon playing with Terminal.app and picking up bash scripting. Along with a handful of common command line UNIX programmes, it is an extremely powerful tool. Flick through Part 1 of http://www.tldp.org/LDP/abs/html/ to get a picture. For more Mac-centric stuff, have a look at Apple script.

zosoeffex70
Oct 31, 2005, 10:12 AM
Thank you for your well-thought out and helpful response. This helps me to see the trade offs between low/high level languages. I may be going to a community college for a (2) yr AS program and I think it is focused on the low-level languages such as C/C++ and the like. (Although, I'd like to get started - got a coupla months before classes start - with a high level language; perhaps REALbasic...)

Do you mind if I republish your comments on my blog? It could use some substantial input as I find this was.

http://programmingn00b.blogspot.com/

Again, thanks for your time and thoughts!

gene

AlmostThere
Oct 31, 2005, 10:51 AM
Go for it. Copy anything you like.

One analogy that came to me is in the field of image processing. As with all analogies, a pinch of salt is required.

It is much easier to use something like Photoshop (the high level language) to apply named filters and effects to process your image. Behind the scenes, you have the mathematics of convolution, Fourier transforms, Gaussian distribution etc. etc. that you can learn about and understand (low level programming language).

Does knowing this detail make you a better graphic designer? Hmmm, I don't know. It can obfuscate the issues, especially early on and the maths is harder for many people to understand than the visual output. Ultimately it probably makes you more capable of building on the work of others, extending the existing tools and which can result in superior work - you are better able to express uniquely and individually your ideas. It gives more insight into the domain.

It might certainly help learning Photoshop though, e.g. all the little tool parameters have a precise meaning. Change to another app, and they are still there, despite maybe different names. Knowing Photoshop though is not really going to subconsciously turn you into some mathematical genius.

The cost of course being that you are probably making fewer posters / adverts / layouts. It's just not possible if you have 1000 pages of theoretical mathematics to plough through before you start publishing.

The best artists, though, will be the ones who can use the appropriate tool at each stage - use stock tools where necessary, but with the knowledge to custom build a suitable plug-in or processing step where needed.

jeremy.king
Oct 31, 2005, 12:10 PM
The thing with the lower level languages (C/C++, I would probably address Java as slightly higher level) is that there is much more to write to get simple tasks working.

I wouldn't consider C/C++ as low level languages, both provide much abstraction as to what is really going on at a hardware (machine code/assembly) level...I guess its all relative, but having exposure to x86 assembler, C and C++ are a godsend.

AlmostThere
Oct 31, 2005, 03:48 PM
Well that's fair enough but the OP was talking about C/C++, Java and Python, an assortment of 3rd generation languages ;)

jalagl
Oct 31, 2005, 05:17 PM
I went the website for Eclipse and read this about a Java 'run-time environment':

http://download.eclipse.org/eclipse/downloads/drops/R-3.1.1-200509290840/java-runtimes.html

On the page above it does not display a Mac platform - what to do? Again, I'm very ignorant about programming/IDEs etc...

You can download 3.1.1 from http://www.eclipse.org/downloads/index.php, select "Other downloads for 3.1.1" and there's a MacOSX version on that page.

I've been praising Eclipse since the 3.1 release - it works incredibly well (or at least much, much better) on the Mac (in all platforms as well).

HOWEVER, if you want to learn Java, I recommend you use something like TextWrangler (suggested in the thread), and the command line tools. Regarding books, I recommend the Deitel & Deitel How-to books. I really like their approach. Once you manage the basics, you can start using an IDE like Eclipse. IDEs are pretty complex, and if you're starting to learn a language, I think it is better to isolate the complexities of the language from the complexities of the IDE.

CarlosC
Nov 5, 2005, 07:07 AM
AlmostThere, some very good answers. We should give you a soapbox editorial :) Contact me if you're interested.

>Say, do you know of any good books that would get me started programming
>in C w/Xcode as a beginner?
Well, I just recommended the following book in two other threads, so why not go for 3! ;)
http://www.amazon.com/exec/obidos/asin/0321213149/idevgames-20

I would also recommend "Xcode Tools Sensei"
http://www.meandmark.com/xcodebook.html
(Note: Yes, I am the artist of this book's cover, but I also recommmend it for what is in-between the covers) ;)

Cheers

Carlos
www.idevapps.com
www.idevgames.com

NewbieNerd
Nov 6, 2005, 01:33 AM
Language: C/C++ are by far the most important languages in the world. However, they are very messy and pointer-based, which means actually thinking about allocated memory for things. Blah. Don't start with that or you'll probably hate it quickly.

Python - Beautiful, simple language, but is really too high a level to do because it is designed, like Ruby (a fav of mine), for scripting and stuff that is very quick to write. You need to learn how to program and get a feel for things. So don't start here either.

My suggestion: go with Java. Objective-C is too C-based, in that you're going to see pointers (little astricks *) and structs and classes and stuff. You don't see those in Java, but you will be forced to learn programming techniques and terms. Your very first program is going to have terms like 'static' and 'void' and 'public' and whatnot...these things you need to learn, but the learning curve isn't too high. With java you can also make GUIs, i.e. little cute windows that pop up, with ease and it can be very rewarding. I support starting with Java 100%.

As for books, I have the Deitel & Deitel book and I think it is good as well. Right off the bat they are gonna tell you what every line means in your very first program. Another beautiful thing is that, within the first 2 or 3 chapters, they will be showing how to make those GUIs (windows) as well as Applets, which are Java programs which can run in web pages. They don't want 10 chapters for you to know programming pretty well. You will be excited about seeing your own windows popping up instead of just reading text at some command line. Very good book. Find it on ebay/amazon/half.com for cheap.

As far as how to start programming, I know XCode and Eclipse and what not seem popular and interesting, but don't do it. It's WAY too complicated for starting. If you don't use Java, just use a simple text editor and the command line. If you do use Java, check out something called DrJava:
http://www.drjava.org

It is easy to use and simple. A window comes up where you can create new text files and whatever without having to go through all this, start a new project, blah blah junk. You don't need that. To compile things, you just click the `Compile All' button at the top. It will show at the bottom if there were any errors and where they are. If it does compile correctly, you just have to type `java HelloWorld' if HelloWorld.java is your file and poof, it runs your program right in front of you. Nothing complicated. It is simple, and so I HIGHLY recommend it.

That's just my opinion. If you have any questions, feel free to ask. No dumb questions...I still ask plenty of them, hehe. :)

caveman_uk
Nov 6, 2005, 03:42 AM
Objective-C is too C-based, in that you're going to see pointers (little astricks *) and structs and classes and stuff. You don't see those in Java..
So Java doesn't have classes? News to me. The pointer stuff in objective-C is not exactly hard - most of the time you don't actually have to think about them being pointers. Though you're right that's what they are. I found I had to think a lot harder in C or C++ about pointers than in Objective-C. In C++ it's all *, ** (pointer to a pointer - cool!!!) and &. I do think that the Cocoa frameworks should decide if it is actually going to be a fully object orientated language. It seems odd there are structs (like NSRange, NSPoint) knocking about in what's supposed to be an object-orientated language.

gekko513
Nov 6, 2005, 04:57 AM
I do think that the Cocoa frameworks should decide if it is actually going to be a fully object orientated language. It seems odd there are structs (like NSRange, NSPoint) knocking about in what's supposed to be an object-orientated language.
Yeah, it's a bit strange, but there are good reasons why it is the way it is. The dynamically typed Objective C classes are not as efficient as C functions or statically typed C++ classes.

Range, points and rectangles and stuff like that are frequently referenced and would bog down the program if it was done with Objective C classes.

Soulstorm
Nov 6, 2005, 01:40 PM
I have been learning C++ for some months now, and although I have not yet explored the full potential of the language, I must say that I find it fairly easy to use. I had originally programed in Applescript, but I don't think that this is important...

Objects are fairly easy to handle in C++. I am saying this because I am not yet a complete programmer. Sometimes it's good to hear how a newbie sees things with a language you intend to start learning...

I have looked at C and I don't know if you find it strange, but I think that if you start learning C++, it's easier to learn C afterwards, much easier than if you do it the other way around.

I haven't been involved with Objective C yet, but I have heard that C++ is the most important language out there. If you know that language, then it's easy to learn the other C's variations. The only thing that bothers me though, is pointers. Although I understand them, I think it's a pain in the **s. Well, I guess that is the beauty of it, right?

My newbish opinion: Start developing console applications using C++ in XCode, and then I think that the path will be clear for you. It will be easy to decide which road you will choose.

Good luck and welcome to the programming world!

NewbieNerd
Nov 6, 2005, 03:05 PM
So Java doesn't have classes? News to me. The pointer stuff in objective-C is not exactly hard - most of the time you don't actually have to think about them being pointers. Though you're right that's what they are. I found I had to think a lot harder in C or C++ about pointers than in Objective-C. In C++ it's all *, ** (pointer to a pointer - cool!!!) and &. I do think that the Cocoa frameworks should decide if it is actually going to be a fully object orientated language. It seems odd there are structs (like NSRange, NSPoint) knocking about in what's supposed to be an object-orientated language.

Yeah, I meant that Objective-C has BOTH structs and classes and the beginner will can be confused about the differences and which to use, etc. I do agree that Obj-C is not that hard and maybe a good place for a new programmer to start, at least on a Mac, but I think Java is a cleaner, simpler beginning.

GorillaPaws
Nov 6, 2005, 04:04 PM
Dude... if you decide to go the Objective-C route (I'm in the (Slow)process of trying to teach myself), get the Kochan book "Programming in Objective-C" (it is a slow approach - i.e. it doesn't assume you're an experienced programmer, or that you know any C at all) also get a book that will have you doing stuff with Interface Builder like O'Reiley's book "Learning Cocoa w/ Objective-C" or the Hillegass book "Cocoa Programming for Max OS X". Use them together. The Kochan book will teach you all of the language that you will need to learn, but by itself it's kind of tedious, and you'll loose interest FAST because you just make command line programs and stuff. When you start to get boared, switch to the O'Reiley/Hillegass book, It'll rush through the language stuff faster than you want (which is why you have the Kochan book), but it'll have you making apps w/ interface builder that have minimal code, but will open in a window and allow you to add in all of those Apple-centric widgets drag and drop style. Do that for a while until the language stuff gets too far ahead of where you're grasping everything, and then switch back to Kochan. Go back an forth - a great way to get your feet wet with Cocoa programming.

I've also bought a couple of other books and I can tell you to steer FAR AWAY from the Trent/McCormack "Beginning Mac OS X Programming." It looks like the ideal place to get started (especially since it's written for Xcode 2 and Tiger) but don't be fooled, it's trying to be all things to all people, so everything gets watered down so thin that you don't get much of anything out of it e.g. it covers the entire Objective C language in 52 pages.... riiiight.