Forums » Off-Topic

learn to program!

May 12, 2005 .mousepad. link
Does anyone know a good, free way to learn programming? It would be preferable if it worked on a macintosh. I dont care what language or whatever, as long as it is an easier one to learn.
May 12, 2005 macguy link
Try this: http://www.truebasic.com/
I learned that last year, and this year I'm learning real basic.
May 12, 2005 roguelazer link
http://www.rubycentral.com/book/

Ruby is a much better language to start with than BASIC. Plus it's free and already installed on Mac OS X. If you get into it, I reccommend purchasing the 2nd edition of the book that I linked to at the beginning of the post. Quite a bit has been added in Ruby 1.8 that's not covered in the online version.
May 12, 2005 Solra Bizna link
If you learned BASIC, start learning another language immediately, to prevent BASIC from getting absorbed! It teaches you so many stupid things...one of the biggest obstacles I've found to teaching people any real language is that they only knew BASIC and completely cannot grasp the concepts involved in a structured/OOP language....
I've heard a lot of positive things about Ruby, and it's closer to a real programming language. I'll second Rogue's recommendation here.
-:sigma.SB
May 12, 2005 Tyrdium link
The C++ book I used in Fundamentals of Computer Science was pretty decent. It also covers the more theoretical aspects, which is nice.

Link (note: broken to save formatting):
http://www.amazon.com/exec/obidos/
tg/detail/-/0534390978/qid=1115950367/
sr=1-3/ref=sr_1_3/002-2934205-8260868?v=glance&s=books
May 13, 2005 softy2 link
Kernighan and Ritchie.

Foreva!
May 13, 2005 zamzx zik link
I'm doing C...I'll look up the book.
May 14, 2005 margoth link
I would recommend some "programmer friendly" and decently modern language. Ruby being one, Java another. C and C++ are powerful for some tasks but not a good choice for learning programming.
May 14, 2005 Suicidal Lemming link
Since you're gonna be using a macintosh, I suggest poking around on Apple's developer site.
http://developer.apple.com/
May 14, 2005 zamzx zik link
I'v already done HTML, tis' quite simple! so is C both about the same thing. think : vendetta cammands only...harder
May 14, 2005 Indra link
I've always been curious: is HTML a programming language or not? there are some who think HTML and PHP are programming languages, but then there are some who say they aren't.

/me looks at html suspiciously and pokes it with a stick. are you really a language?
May 14, 2005 zamzx zik link
erm, kinda, its for making web page's...so...yeah....kinda..
May 14, 2005 Beolach link
HTML is a Markup Language. Whether that qualifies as a "programming" language is debatable; I would personally say yes. In any case, it is a "computer" language.

PHP IMO is more clear, and is definitely a programming language.

From http://en.wikipedia.org/wiki/Programming_language :
A programming language or computer language is a standardized communication technique for expressing instructions to a computer.

So far, I would say HTML fits this definition just fine - HTML is a standardized communication technique for expressing instructions to a computer regarding how to render the HTML document.

It is a set of syntactic and semantic rules used to define computer programs. A language enables a programmer to precisely specify what data a computer will act upon, how these data will be stored/transmitted, and precisely what actions to take under various circumstances.

Here it gets more iffy: is the webpage resulting from HTML a computer program, or a computer document? Or both?
May 14, 2005 red cactus link
C and C++ are a terrible choice for a beginner's language. HTML is a good starting point, I suppose, because it builds the starting foundations that you need for programming.

Way back when I was working in a Mac environment, the first language I learned was REALBasic. It's a wonderful beginner's language, and Mac based. Also a fantastic community. And it's got a very slick IDE, allowing for instant results! Yay! Haha talking about it almost makes me want to go back to Macs :p.

http://www.realbasic.com/

And the book I used to learn it is called REALBasic: The Definitive Guide by Matt Neuburg, published by O'Reilly (so you know it's good).

(And..people may disagree, but Perl is one of my absolute all-time favorite language. It was one of the first languages I learned, and it's very forgiving and extremely unbelievably flexible and fun to program in.... So you might want to check that out too.)
May 15, 2005 Beolach link
/me disagrees w/ red cactus. C/C++ are decent choices for a beginner programmer. But what to start with really depends a lot on what & how much you want to learn. Personally, I'd suggest starting with assembly & then moving up to higher level langauges. Or even before assembly, start with basic electronics & logic circuits. It's tougher & takes longer to learn, but you get an extremely thorough knowledge of how programming works.

Most likely in practice you will rarely if ever use assembly, but it gives a very strong background knowledge to build off.
May 15, 2005 red cactus link
Ok, I had actually forgotten about assembly language. I agree, it most likely would build an enormously strong foundation for programming in a new person. The only thing is...it's tough enough to put someone off of programming unless they're unusually interested. Also, unless you pick up a book on Win32 assembly language (and I've yet to see one) all they have available are 16 bit assembly language books, which teach you how to make nice DOS programs, but nothing actually worthwhile. (Not to mention the taboo of modern languages...labels and goto statements :p). ((Though this is beside the point, because this guy would be needing to learn PPC assembly language, which is completely different.))

Also, with languages like HTML and REALBasic, you have pretty much instant results, which is more likely to drive a person to learn more, go more in depth, etc.

As for C/C++...maybe it's just me. I have three books on C++ and I've gone back to them so many times over the last 5ish years, but I've never ever ever gotten past pointers and references with a solid foundation. At one point I remember reading up until virtual functions, but that was with extremely shaky knowledge, certainly not solid enough to program with in the workforce.
May 15, 2005 mcnut link
I know this makes me evil but: I don't particularly care for Java. I'm a die-hard C and C++ fan. ASM is something you should have a good grasp on, but in reality its application this day and age is very limited. Many programming and scripting languages are great to start with because they have similar syntax to C++, and utilize the same ideaology, therefore making it easier to learn C++ when you get to it. Anyone here learned C# yet? I don't know if I want to or not.
May 16, 2005 Solra Bizna link
You aren't alone, mcnut; I don't like Java, it's a little too bloated, and C and C++ are still the best, most versatile languages I've encountered.
When people ask me to teach them "programming," I usually start with Lua. Then again, most of them turn out to not really be interested, so it doesn't last for very long...
-:sigma.SB
May 16, 2005 ctishman link
GAH! You're exactly where I was six months ago. I understood HTML, and every time I asked to learn how to program, people threw books about their favorite language at me, and left me even more confused than before.

Before you can learn a language, you must understand the basic structures and logic of programming, and every book I've read is too obsessed with their language's syntax to actually teach you how to program. Pick up this book:

http://www.amazon.com/exec/obidos/tg/detail/-/061901590x/002-6522302-5048012?v=glance

It's expensive, so buy it used if you can (I see a good copy for $8.70). This book does not teach a programming language. Instead, it explains programming logic such as:

•Variables
•IF THEN ELSE and CASE structures
•All major types of loops
•Arrays and array processing

in a clear an accessible manner using pseudocode. Once you understand that, you have the basis from which to tackle real languages. Additionally, it explains good programming practices such as IPOs, flowcharts and desk checking which despite their being a bit of a pain in the ass, can save you hours of work in the debugging stage.

I can't stress this enough: buy this book. It's a godsend.
Jul 15, 2005 DekuDekuplex Ornitier link
Re: .mousepad.

> Does anyone know a good, free way to learn programming? It would be preferable if it worked on a macintosh. I dont care what language or whatever, as long
> as it is an easier one to learn.


Structure and Interpretation of Computer Programs, commonly known by the acronym "SICP" ( see http://mitpress.mit.edu/sicp/full-text/book/book.html ), a copy of which is freely available on the Web, is an excellent text for learning fundamental programming skills applicable to any language. I used parts of this book in my first course when majoring in computer science at Yale. The particular language used in this text is Scheme, a dialect of LISP (LISt Processing language), but most people who master this book can reportedly pick up almost any other language within a few days and apply the skills there as well. It is also used in "6.001 - Structure and Interpretation of Computer Programs," a required course for computer science and electrical engineering majors at MIT.

In addition, there are supplementary video lectures available freely online at sicp-video-lectures ( see http://community.schemewiki.org/?sicp-video-lectures ).

In addition, there is a #scheme ( see http://community.schemewiki.org/?%23scheme-on-freenode ) IRC channel on the Freenode network for discussing Scheme issues.

In addition, there is a Yahoo! Groups sicp-vsg · SICP Virtual Study Group ( see http://groups.yahoo.com/group/sicp-vsg/ ).

In addition, there is an interesting article, "Mastering recursive programming" ( http://www-128.ibm.com/developerworks/linux/library/l-recurs.html ), discussing how learning recursion "yields maintainable, consistent, provably correct code."

There is also a useful Scheme-related menu system for Emacs, Quack ( http://www.neilvandyke.org/quack/ ).

I program on my Mac in Scheme in Emacs using Scheme 48 ( see http://www.s48.org/index.html ), Version 1.2 (since officially updated to 1.3).

There is also a thread, "Beginning Programming Theory" ( see http://ubuntuforums.org/archive/index.php/t-28578.html ), on Ubuntu Forums ( see http://ubuntuforums.org/archive/index.php/ ) about this very topic. One of the posters there, named "toojays," wrote the following:

> If I could go back in time 10 years and teach myself programming, I would do it in this order:
>
> 1) Emacs Lisp
> 2) Scheme
> 3) Python
> 4) C
> 5) An assembly language
> 6) C (revisit this with new eyes after doing ASM)


Personally speaking, I would definitely agree with the top two choices. I program in C, too, but the need to use pointers and explicitly to allocate/deallocate memory space make it a pain in the neck, IMHO, when compared to Scheme for learning how to program.

If SICP proves to be too difficult, you can also read How to Design Programs ( see http://www.htdp.org/ ), also freely available on the Web, which reportedly purports to contain roughly the same content as SICP, but in a more modern teaching style.

Whatever you do, stay away from the early versions of BASIC (Beginner's All-purpose Symbolic Instruction Code). It will just teach you to write spaghetti code with GOTO statements all over the place, and will corrupt your mind. I started with BASIC myself before going to college, and had a very difficult time in unlearning it.

-- DekuDekuplex Ornitier