PDA

View Full Version : Is there a fun way to learn a programming language?



jgrabham
August 12th, 2007, 06:08 PM
Im bored, but looked at a page on C++ and nearly collapesed with boredom, how can I learn a language and have fun at the same time?

Or is that impossible?

Lord Illidan
August 12th, 2007, 06:15 PM
I am in almost the same state as you are..except that in my case it's c#.

What I am doing is skipping most of the chapter in the book, and doing just the excersises...looking back at the book when I get stuck..and doing it just for the challenge...sometimes it gets addictive...othertimes you need a break and come on the forums, as I am doing.

I am using Deitel's How to Program C#...too much Visual C# stuff, but I am getting on..with Mono on Linux :P

sumguy231
August 12th, 2007, 06:32 PM
Maybe you could start with a lighter, interpreted language like Python where you can get going a little faster.

BobCFC
August 12th, 2007, 06:50 PM
I started programming as a kid. It was always games and graphics that spurred me on.

Look for some tutorials on game programming such as gamedev.net and try to code some cool demos of graphical effects. They can start off very small such as Plasma effects that you can learn in an afternoon.

Try looking at other peoples code. Even start by copy and paste. Then change one variable and run the program to see what difference it makes. Then make more changes until you understand it.

It takes many years but if you enjoy something you can master it and then you will be top of the class easily, because your classmates will be doing boring business stuff like databases instead of graphics and their hearts wont' be in it.

argie
August 12th, 2007, 07:04 PM
Answer: Ruby
Reason: This book: http://poignantguide.net/ruby/chapter-1.html

bruce89
August 12th, 2007, 07:12 PM
I'm doing C instead.

Wolki
August 12th, 2007, 07:17 PM
Answer: Ruby
Reason: This book: http://poignantguide.net/ruby/chapter-1.html

What I wanted to post. Very entertaining book. :)

The fun way to learn a programming language is to program something. Start small, and go for an "easy" language (like Python or Ruby) that will allow you to see results quickly. If you find that's not fun for you, don't program.

popch
August 12th, 2007, 07:20 PM
It would depend a fair deal on the number of programming languages you already know.

The first one is just that: your first contact with programming. Expect it to take time. Choice of the first language largely determines also how long you will take and how hard it will be. In addition, it will determine whether you will be able to write structurally sound programs.

The second one will be harder, because you have to sort out which 'features' of the first one are applicable to programming 'as such' and which ones are just properties of the first language you learned.

It's going to be much easier after your n-th (depends a bit on the languages, your skills and how you hold your feet when yawning).

Unless you have very strong reasons to do so, I would not begin with C++. I would suggest a look at Smalltalk. Squeak is a nice implementation. Smalltalk is the grand-daddy of nearly all object-oriented languages, is much more fun than C and yields results faster than programming in C. You can also goof off a bit and poke around in the code just for fun.

Spr0k3t
August 12th, 2007, 07:29 PM
Im bored, but looked at a page on C++ and nearly collapesed with boredom, how can I learn a language and have fun at the same time?

it's a state of mind. You won't find the fun in it until you can think of something fun to do. I was bored to tears in my first programming class until I wrote a game of snakes... I was the king of klass, and it was quite awesome.

Gremlinzzz
August 12th, 2007, 07:34 PM
No there's no fun way to become a hacker its a geek thing either your a geek or your not.If it bores you your a Bart Simpson there are no Bart Simpson programmers.
:guitar:

Spr0k3t
August 12th, 2007, 07:37 PM
I am using Deitel's How to Program C#...

Dude, I am so sorry to hear about your pain. That book is easier to read than some steamy beach novel written in another language though.

I just wish programming instructors would go for the good books rather than the Deitel or Thompson bs. I got so sick of the junk instructors asked us to purchase that I purchased a book I knew would help and ignored the rest. When it came time for homework or "answer the questions", I'd just copy the info I needed from some other sucker.

My recommendation for anyone trying to learn programming: purchase a reference book rather than a teaching book. The reference books will give you loads more information, samples, guides, and howtos than what you can find in the repetition books. Not to mention, the reference books are far more valuable after you have learned the language.

argie
August 12th, 2007, 07:42 PM
What I wanted to post. Very entertaining book. :)

The fun way to learn a programming language is to program something. Start small, and go for an "easy" language (like Python or Ruby) that will allow you to see results quickly. If you find that's not fun for you, don't program.

Seriously, hilarious.

To the OP: You may also want to try poking around in the source code for some of the games in the repositories once you've got the basics down. It's pretty easy to add new stuff or to change some things on some of the simpler games.

creedog
August 12th, 2007, 08:28 PM
Can Ruby on Rails be learned independently of ruby, or do you need to learn ruby before you can even think of using RoR

nrs
August 12th, 2007, 08:45 PM
I started writing games, almost right away. Learning a language on its own was never very fun for me, but each time I ran into a wall, I was forced to learn a little more, and was able to improve the game. -- that was the fun part.

Now I have fairly proficient knowledge of C/C++ and a host of other languages.

bchaffin72
August 12th, 2007, 08:57 PM
Do some research on various languages, and find one that appeals to you. An interpreted language might have its advantages, especially if you are new to programming. I started with BASIC many a year ago, and although I have not touched it in years , I learned a great deal from it. I currently use C. Just dig into good tutorials and example code for your chosen language and try to avoid 1000 page books that say too much, at least at first. Get some simple basics in place that you understand and go from there.

I am currently studying socket programming under Linux, and getting ready to write a simple server. I work by just digging in and getting the basic concepts down. Patience pays off well in the beginning.

jfinkels
August 12th, 2007, 09:12 PM
A fun way to learn? Work on designing a program that does something hilarious to your friends' computers, like delete all text files and replace them with files that say "YOU SUCK."

gnuman
August 12th, 2007, 09:34 PM
Just a few things:

Try the Head First books, as they're very well written. I use their HTML/CSS book with high school students:

http://www.headfirstlabs.com/index.php

Also, JavaScript is a great language to learn by getting examples and trying to figure them out from the source code. Either grab the code right off of interesting sites, or visit a site like:

http://www.geocities.com/SiliconValley/7116/

Or, for an interactive JavaScript tutorial:

http://www.w3schools.com/js/

I recently went into a college bookstore and saw they were using C++ For Dummies as the introductory programming textbook. Hmmm... Not sure what to think about that.

I'm surprised no one has suggested you start with Assembly language! :)

Darkhack
August 12th, 2007, 09:44 PM
I would just take it in small pieces and not be in a rush to learn the whole language in a day. I don't want to get into a language flame war, but C++ is a very complex language with a lot of added junk that only forces a programmer to spend more time fighting the language than actually thinking about their project which makes it more boring than other languages to learn because you feel it necessary to learn stuff that you ponder as to whether or not you'll ever need to use in the real world. I prefer C myself. Here is a list of project ideas that you could try out.

http://mindprod.com/project/projects.html

ltk5
August 12th, 2007, 09:47 PM
Answer: Ruby
Reason: This book: http://poignantguide.net/ruby/chapter-1.html

Just started reading this book :D
The comics are hilarious,.. haha chunky bacon :)

popch
August 12th, 2007, 09:48 PM
I'm surprised no one has suggested you start with Assembly language! :)

Do you think there is a marked difference between C++ and Assembly? The syntax is a bit uglier, but otherwise both are pretty much the same.

bread eyes
August 12th, 2007, 09:57 PM
Find some interesting source code in that language.

kellemes
August 12th, 2007, 10:09 PM
Find a way to earn some money with it.. that makes it fun.

aks44
August 12th, 2007, 11:04 PM
Do you think there is a marked difference between C++ and Assembly? The syntax is a bit uglier, but otherwise both are pretty much the same.

LMAO. Are you just plain uninformed or is it only a flamebait? :p

popch
August 12th, 2007, 11:09 PM
LMAO. Are you just plain uninformed or is it only a flamebait? :p

Not if you ever have used an assembler with decent macros. Structurally, I really see no great difference between the two, and that is, of course, as it should be. Both tools are great if you want to do your coding very close to the machine architecture.

Now, if you want to accomplish something more useful in the problem domain, there are programs with which you get a better job done in shorter time and with more fun, to boot.

bread eyes
August 12th, 2007, 11:13 PM
LMAO. Are you just plain uninformed or is it only a flamebait? :p

Well they're not exactly like night and day either.

BobCFC
August 12th, 2007, 11:30 PM
Do you think there is a marked difference between C++ and Assembly? The syntax is a bit uglier, but otherwise both are pretty much the same.

Try doing template metaprogramming in assembly. I don't think you realise the difference between C and C++

aks44
August 12th, 2007, 11:35 PM
Not if you ever have used an assembler with decent macros. Structurally, I really see no great difference between the two

Well they're not exactly like night and day either.

After all it's a well known fact that C++ is only a fancy C, which in turn is just a fancy assembler...

</sarcasm>

C++ has this reputation because it easily allows low level operations. But it really is a multi-paradigm language, which also easily allows very high level designs.

Try doing a combination of OOP and metaprogramming with strong exception guarantees, using assembler macros. Or maybe implement transactional software memory (which mixes very low level concepts with very high level ones).

EDIT: BobCFC you beat me to it concerning the metaprogramming :D

popch
August 13th, 2007, 07:38 AM
After all it's a well known fact that C++ is only a fancy C, which in turn is just a fancy assembler...

Sorry OP, I didn't mean to take the thread so far off topic. The operative words were 'fun' and 'learning'.

ssam
August 13th, 2007, 09:15 AM
if you want to learn python then there is the python challenge (http://www.pythonchallenge.com/).

it wont teach the basics, but it will help you get a good look at the standard library