# Help me learn to program, please



## voice- (Aug 5, 2003)

Hey, just looking for pointers. I have absolutely no clue about any programming language, but here's my plan:

I want to create a Solitaire game for Mac OS X (of course with different rules than the ones currently out)

Gotta start somewhere, so I figure I'll start here. What programming language should I use, how do I learn this in the easiest way, and will I need a program for writing this (what program)?

Thanks for your time


----------



## Arden (Aug 5, 2003)

Your best bet is probably REALBasic, if that's all you want to do.  Pick up that and a book about using it and you should be set.

If you ever want to advance in programming, like into C++, I recommend you enroll in a class at your local community college or university.  That way, you're focused on the material and you can't just "put it off."  Besides that, books are a good way to go if you can dedicate yourself to reading it and learning from it.


----------



## voice- (Aug 5, 2003)

Will REALbasic allow me to take advantage of a few elements like tranparancy and animation?
I'd also like to take advantage of a few OS X features...this will start as a Solitaire, but I want it to eb the ultimate Solitaire in time, with high score lists on Rendevouz (sp?), custom background (including transparent) and custom decks...


----------



## brianleahy (Aug 5, 2003)

I've never user RealBasic, so can't speak to it's capabilities, but you could start by looking at the software's website: 

http://www.realbasic.com/realbasic/rb_indepth.html

This page in particular lists the capabilities of the language.   It sounds fairly powerful.

If you want to be Mac native, and really have access to everything the Mac can do, you can download the Apple developer tools for free (after a free registration) and have unlimited access to Apple's online documentation, including sample code.  Unless OS9 capability is important to you, I strongly recommend the Cocoa framework over Carbon.  Cocoa programming is an absolute dream.

Howver, I should warn you that if you're starting with NO coding experience AT ALL, this is a much harder road to walk.  There are a lot of important concepts you need to understand before the sample code will be of any use to you, and Apple's docs, while quite good, are not aimed at an absolute beginner.   RealBasic would actually be a good way to 'get your feet wet' in this respect.  Maybe move to Cocoa for version 2.0!

If you do decide to try cocoa, there are a lot of great books and online tutorials that can get you started.   The O'Reilly series are good, for instance.  Best of luck.


----------



## Arden (Aug 5, 2003)

If you're using graphics with alpha masks in REALBasic, then you can use transparency.

Cocoa is the next step, and Project Builder is the way to use it.  Definitely get the Developer Tools when you're done with Basic.


----------



## wiz (Aug 8, 2003)

tell u what! get a book on objective-c/cocoa, it's  not that hard. then you'll be able to program almost every type of program for osx.


----------



## Arden (Aug 8, 2003)

For free!


----------



## Trip (Aug 12, 2003)

I started with REALbasic. Bought the Dummies Guide and started building apps the next day. VERY simple to use. But it really takes time to create a good-looking/running application.

REAL is the way to go. But if you're looking for raw power start with C, go to C++, and then upgrade to Cocoa with the Apple Developer Tools.


----------



## Lycander (Aug 12, 2003)

www.macdevcenter.com - nice subsection devoted to Cocoa

http://www.cocoadev.com/

http://www.stepwise.com/StartingPoint/Cocoa.html


----------



## Nummi_G4 (Aug 15, 2003)

Hey dude. I hate to burst your bubble... but I dont think you will be writing a Solitare game anytime soon.  I think your best bet is to take out a Learning C book from the Library. That's "C". not C++ or C#.  Yes, you will only be able to write programs that run in the terminal, but you have to start somewhere.


----------



## bootedbear (Aug 15, 2003)

Hmmm, your mileage may vary, but I disagree with the choice of C as a first language. 

I've been in this business for 26 years and have worked in almost every programming language there is, and think C is just too 'loose' for use as a beginner language -- too much room to develop bad habits that you have to unlearn later.

I'd go with Java as a first language personally.

hth,
bear


----------



## elander (Aug 15, 2003)

bootedbear: I second that. Java is a good choice for several reasons, and the most important one being that it is totally object-oriented. Learning object oriented programming first is a good thing, since it keeps you away from bad programming habits. Java is probably the best choice, since you can't "cheat", ie throw in a little procedural stuff to glue things together.

If you're serious about learning to program, get the book "Objects first with Java" and download BlueJ from www.bluej.org. That'll give you a good start. You can find links to web sites selling the book from the BlueJ site.

BTW: I'm not affiliated with neither BlueJ nor Sun. Just like the stuff...


----------



## Arden (Aug 15, 2003)

No disclaimer necessary.

Java may be the way to go for beginning programming, but why is it so _slow?_  A certain file-sharing program I use that was written in Java takes a long time to start up, and the program itself has interface quirks that make me wonder.  What's up with that?


----------



## wiz (Aug 15, 2003)

the speed of the execution depends on the jvm largely.

if the jvm is well tweaked for ur comp, u'll get better speeds.


----------



## willmac (Aug 18, 2003)

Hey, nobodies mentioned Python  Its an interpreted language so you don't need to compile sourcecode everytime you make a change (like with C++ or Realbasic). 

I'm learning to programme right now, and after trying out C++ for a while I realised that I had gotten in over my head. Transfered to Python and am having much more fun now. Checkout the website below for some info and beginners guides. Still plan to learn C++, but only when I have more experience.

Enjoy, will

http://honors.montana.edu/~jjc/


----------



## cfleck (Aug 18, 2003)

word of advice.  dont start programming in any language with the intent of developing a program.  it will be some time after you start learning before you can develop anything useful. 

another thing, as you can probably gather here, there is no sure fire language to start with.  find a friend or colleague that can help you with a particular language so you dont have to rely solely on a book.  good luck


----------



## voice- (Aug 18, 2003)

I have no friends who know how to program. I have one friend who thinks he's THE hacker since he's put a downloaded script on a floppy and successfully screwed up a Windows computer with it, but that's the closest I get.

Whatever I choose, I know I'll learn eventually. First I just want a goal (since I don't want to learn EVERY language out there to find a suitable one). I want it to be 100% OS X compatible, and, if possible, making apps easily ported to Windows or Linux (in case it's a hit).

Thanks for the suggestions, people, I'll look into these more closely, and then choose one.


----------



## mr. k (Aug 18, 2003)

Im sure someone has mentioned Python before, but I'm in the same kind of position as you voice, and am using this tutorial to get into it.  Python is a very simple language, and good because it introduces you to the basics of programming (variables, loops, I'm still learning) without having a real hard to understand grammar.   I hope to move on to C after I get python down pretty well.


----------



## Orbit (Aug 22, 2003)

Get realbasic fits all your needs and as the name says its realbasic to learn/use and powerful enough for a begginer/intermediate programer

im currently learning it now so if you want more info then PM me


----------



## Arden (Aug 23, 2003)

Well, you _could_ start with Applescript Studio...


----------



## GreenMadona (Aug 28, 2003)

I agree that in term of language Python is the most interesting I saw. Now it search itself and hasn't a library very clean. That's also a script language not doing gui isn't rewarding.

Java is certainly a good choice (clean language, high internet support with plenty high quality free learning stuff) and Apple is going to it : Now integrated to Project Builder, at least very well implementend to get really standard gui with standard Java stuff, easy way to get out of Java and make direct call to the System api and Objective-C. But choosing Java will imply a strong investment. Still a good choice.

AppleScript is very special, I hate its false "human language". In term of language it is also very limited. But its integration ot the System, its mix of scripting approach and easy gui building and using with AppleScript Studio. Plus its links with the unix shell commands make it a great toy to play with. I write toy but you could do very fast concrete things as usefull tools.

Later with it's wide connections, you have many way to use it as a base to see further :
- Exploring more its ability to command other application.
- It's connection to unix command shells to use it to encapsulate more and more complex unix command tools.
- It's open architecture that allow you call Objective-c method or even (less easy) Java stuff. That could be an easy way to make more fun first steps in complex worlds.

So afterall, despite all its limitations, despite it is too special, that's an interesting choice to start with particularely when AppleScript Studio is free.


----------



## bootedbear (Aug 28, 2003)

OK, so I'm the slow one...



> Java may be the way to go for beginning programming, but why is it so slow?



Since Java is a platform-independent interpreted language, it will never be quite as fast as a compiled language, though the JVMs are getting better and better.

The majority of the Java-perceived slowness is mostly in the programs themselves -- especially those that rely on the GUI (Swing library). It's hard to write programs that use Swing well, so most don't.

Non-GUI Java programs give compiled programs a run for their money (and work on multiple systems right off the bat).

bear


----------



## retrotron (Aug 30, 2003)

Here's a thought. Start with something that requires no libraries and no advanced concepts. The first order of business is probably to learn not just the basics (variables, loops, conditions) but also how to use the basics (i.e. the basics are easy to understand and are definitely intuitive, but learning to use them to accomplish everything under the sun is a step that can't be skipped). While languages such as C++, Java, or Cocoa are excellent languages, you can't even begin to start playing with the basics, e.g. output a variable, until you understand libraries (and/or objects). Imagine all you have to do before you can simply output a basic variable in Project Builder. That's an awful lot of complicated stuff right up front and seems to defeat the learning process. I'd start with something that just lets you start typing basic commands and run the thing. Python and REALBasic I think are great suggestions, and maybe perl or php would be too. 

Here's my suggestion, and you'll all laugh  but think pedagogically here: Flash Actionscript. It's easy to use, you don't have to understand anything at all about programming, you just open Flash, start typing commands, and running it. There are about a million tutorials for anything you want to learn how to do, so it seems to me like a great "first language" (not to mention a useful one). Also, designing user interfaces is a lot simpler with actionscript than other languages because AS is part of Flash. There are so many things about "interfaces" that need to be learned, but Flash lets you get into it without being overwhelmed by all of interfacing's complexities. Once you understand how basic programming works, how OOP works, and how interfacing works with something simple like Flash, moving into Java or Cocoa is so much more natural. The learning curve remains steady that way rather than bogging the learning curve down with too much up front.


----------



## Arden (Aug 31, 2003)

That's a great idea!  ActionScript is built right into Flash, meaning you don't have to program anything extra to get it to work well with a UI you design.  While it's simple to build a UI in Interface Builder, it's not so simple to get it to work in Objective-C.  Flash would be a great "training wheels" step!


----------

