Recommendations needed for good AI references [closed] - xna

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I've been asked to help out on an XNA project with the AI. I'm not totally new to the concepts (pathfinding, flocking, etc.) but this would be the first "real" code. I'd be very thankful for any resources (links or books); I want to make sure I do this right.

The standard textbook and a great place to start is Russel and Norvig's Artificial Intelligence: A Modern Approach. You can also get MIT's Intro AI course via OpenCourseWare

These links might be useful to check out, for a beginning (even if most are mostly game-oriented):
http://www.a-i.com
http://www.kynogon.com
http://openai.sourceforge.net
http://www.botspot.com
http://aigamedev.com
http://www.aiwisdom.com
http://igda.org/ai/
http://gamedev.net
and http://www.gameai.com, who has already been mentioned..

I was surprised not to find in the above answers any of the books I though of so here goes, the books that any development team in a game studio will always have:
Game Programming Gems (there are 7
books by now).
AI programming Wisdom (I think 4 are out).
Both series are combined of many very useful articles and browsing through the first two of each series (the game programming gems have AI chapters which includes several very good articles) will give you nice understanding of both basic and advanced techniques used currently in the game industry.
BTW - you can also gain understanding in other areas like data structures, effects, 3D and sound.
Enjoy the reading,

I have to comment that AI: A modern approach is a pretty dry read.
If you're actually interested in AI, and want to stay interested, you are much better off going with Norvig's gift to the world: Paradigms of Artificial Intelligence Programming. Not only is this a great intro to AI, it's a great intro to beautiful programming.

I second "Artificial Intelligence: A modern Approach". It is really good at explaining the items in a basic, understandable manner. It's also a book that is used in many universities to teach students the basics of artificial intelligence.
Maybe it is not such a bad idea to take also take a look at the slides they use in the courses, to get a basic idea on the topics at hand.

There's an XNA specific tutorial on flocking.

You might find the blog, wiki and forums on AiGameDev.com useful.

Russel and Norvig's Artificial Intelligence: A Modern Approach.
Be warned, this book is a bit of a door step. Very detailed and generally very good. I would probably recommend some of the online sites first to get a flavour for the types of algorithms you might need and then selectivly dive into Russel and Norvig to get a more in depth view of the implementation.
Dont forget the usefulness of online forurms such as this or aigamedev.com as I used these extensivly throughout my own AI degree. You might also find that you need to buy a specific game AI book to help with some game logic as this can be substantially different from AI 'application' logic. In game scenarios I think you're generally lucky if you get ~5-10% of the processing time whereas in an application the AI is generally the only thing running and this allows for much more advanced and processor heavy techniques. This is also something that you might need to consider and Im not entirely sure that Russel & Norvig is the best place.
Good luck with the project, I wish I was in your shoes!

Two references of interest should be
Artificial Intelligence for games (Ian Millington)
Programming Game AI by example (Matt Buckland)
I second the reference to the AI forum at gamedev.net. particularly because some of the key posters on that forum work in the industry (including the writer of AiGameDev.com), or use AI & related techniques like planning and optimisation in practical domains.

Amit's A* Pages are extremely helpful in writing pathfinding code. Lots of meaty theoretical and practical info there.

I've always found Steve Woodcock's Game AI site to be a great reference. It includes discussion, source code, and pointers to books, conferences, etc.

I would second: Programming Game AI by example (Matt Buckland)
This book gives great algorithms that should easly port to XNA.

I just read some excerpts from AI a modern approach, mostly because I'm interested in the matter, not because I could actually use it. AI a modern approach is quite good, it's well written and really interesting, however I don't know if you can use it, maybe not if you are more looking for code samples..

Related

Which Programming methodology to used for Final Year Project? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I am a final year Computer Science Student and as part of my Bachelors degree I am doing a project on Data Mining of Microarray DNA expression data. I will have to develop a few algorithms such as Bayesian Networks to run on my datasets to find out how each variable(genes) affect each other.
As part of my Project Proposal I have to talk about which methodology I will use to develop my software. From what I have learnt in school and from extra reading I find that the Incremental Development model seems a good idea. I would run 2- 3 iterations of Plan, Design, Implement until I get the full functionality of the software. Could somebody with more knowledge than me please tell me it this sounds like a good idea.
The reason why I am not 100% sure which methodology I would use is because I don't have a team to work on the software, I don't have a client with requirements and I am very limited in terms of the amount of time to work on the project as I have 3 other modules. All the methodologies which I have read about seem to be for big software projects with teams of developers. What do you do if you are just 1 person and focusing mainly on getting 3-4 algorithms to work rather than focusing on getting broad range of functionality.
I was also thinking of using UML to get a better idea what I want the software to do and using like a stripped down version of an Object Oriented Methodology.
My guess would be I would have to use parts of more than 1 methodology at a very basic level but I just can't pick.
I am very confused and lost on the subject so any help is greatly appreciated.
Thank You,
For these types of work, I would suggest not to pay much of attention to methodologies, because after all, what matters is the algorithm. But, for the sake of having a response for your dilemma, I would suggest using XP (eXtreme Programming). Why?
Is light
It doesn't require filling many papers as RUP & others
Is more suited for changing evironments, such as yours
Just take a fast search at Google for XP methodology and you'll get a bunch of useful results. ARUP (Agile RUP) might be worth looking also.
I hope I can help you.
XP/TDD is harmonious with the scientific method; each iteration is a theory, the tests are experiments
It takes a lot of discipline to follow a methodology while working solo, make sure you pick one that isn't labour intensive or you'll never live up to it.
If I was back at school in your situation with what I know now I'd probably go for Test Driven Development. Unit tests are ideal for testing algorithms and will leave you with a body of tests that you can use to demonstrate that you did follow a methodology.
Your idea to do the project in several iterations of plan, design, code and test is fine however with small projects it's sometimes difficult to resist the urge to do it all at once.
In case you do get carried away and finish the project in just one or two iterations, keep notes about the order in which you did things (ideally use a version control system) so that you'll at least be able to fudge your documentation to make it look like you used several iterations. Not that I'd endorse such an approach of course ;-)

Path to Become a Better F# Programmer [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I would like to hear from you folks that have achieved a high-level of proficiency in F# (and also in functional programming in general too) what should be my steps from now on to become a better/professional F# programmer?
I already know much of the F# syntax and have some years of experience with C++. My goal is, as an engineer and mathematician, to design better scientific libraries (linear algebra packages, partial differential solvers, etc.).
what should be my steps from now on to
become a better/professional F#
programmer?
Keep coding everyday :)
I jumped on the F# train in Sept '07, before that I had a boatload of C# experience. It took about 3 months or so for me to stop writing code as C# with a little funnier syntax and start picking up on the right coding style :)
Tips and things that helped me:
I found that F# makes it really hard to write non-idiomatic code, really easy to write good, clean code. If you find yourself fighting the compiler, 9 times out of 10 your doing something wrong. Go back to the drawing board and try again.
The entire concept of immutability was a mystery at first, but implementing all of the data structures from Okasaki's Purely Functional Data Structures was hugely helpful.
During some slow days at work, between '08 and '09, I wrote a wikibook. I haven't looked at it in a while, but I'm sure its really bad --- but, the experience of explaining the language to others was a good jumpstart for someone like me who normally wouldn't have enough motivation to start a pet project in F# :)
Map, Fold, and Filter are your friends. Try to express algorithms in these functions rather than implementing a loop with recursion.
Non-tail recursive functions are almost always easier to read and write. See here.
Project Euler. Lots of people recommend it, I didn't find it particularly helpful at all. You might get more use from it than me if your a mathematician, however.
<3 unions! Use them!
Falling back on mutable state -- big no-no. At least for beginners. The worst beginner code is full of mutables and ref variables. Immutability is an alien concept at first, so I recommend writing fully stateless programs for a while.
Still, the best advice is just keep coding everyday.
Hope that helps!
-- Juliet
Like any other language now that you know the syntax and the basics it's time to write code and more code.
Make sure you have the core concepts of functional programming down.
Work on a large project so you also get familiar with the large and not just the small.
Write a few immutable data structures.
Work on a large project without using inheritance.
If your familiar with design patterns implement some of them in a purely functional way and notice how some of them disappear.
F# is about mixing functional and OOP styles. Once you've done a fare amount of abstraction without inheritance bring it back and start mixing the styles together. Find a balance.
Since your goal as an engineer and mathematician is to design better scientific libraries may I suggest as a learning exercise working on a video game style simulation. Something that involves physics and math but also requires control of state.
I can only agree that trying to explain functional programming to others is a great way to learn it. I spent a lot of time about thinking the structure of my F# book and I think it really helped me to understand how functional concepts relate. Even giving a talk on F# in your company or to your friends should have a similar effect.
When I started learning F#, I started working on the F# WebTools project. I think this was quite useful, because many components of the project were perfect for functional programming, so I learned many functional tricks (because they were the best way to solve the problem). The project processed source code tree of F# and translated it to JavaScript, so I was using a lots of recursive functions and discriminated unions.
The area you're working in is quite different than my, so I cannot give you any specific advice, but it is a good idea to write programs in a clear functional way - even if you think that it would look nicer if you wrote it in the C++ style. When you write it, you'll probably find some way to simplify your code.
So, I think that the tips I could give are:
Try to explain F# to others - this helps you to organize ideas in your mind
Pick good problems to start with - e.g. algorithmic problems, processing tree structures, etc.
Write as much F# as you can and don't be afraid to start with a solution that does not look perfect to you - I rewrote my first program so many times!
you very probably don't want to hear from me as I have not achieved a high level of proficiency with F#, but I have set myself the goal of getting there (much like your self).
I thought I might suggest what has turned out to be my biggest learning tool: Stubbornness.
I set my self a large-ish project (a game, just as gradbot suggests). I then decided to code using as much immutable data as possible regardless of the performance costs.
Then if I couldn't find a way to use immutable data I'd come here and ask for help.
The hoops this stubborn approach forced me to jump through has been a brilliant learning exercise, as (just as Juliet mentions) F# allows you to write really ugly C# if you let your self get lax.
Right now I have tile based 2D world and a little man who can find his way to the treasure and back home again using A* path-finding ... The only thing I mutate is the title of the window it's displayed in.
I only got serious about learning F# towards the end of July (I'd dabbled before then) and this project has taught me a huge amount, along with the help of the guys here at StackOverflow.
The other answers do a good job of suggesting ways to practice your F# writing skills, which is obviously very important. However, something which doesn't seem to have been emphasized much is reading F# code, which is just as important in my opinion. There are a lot of people doing cool stuff with F#, and one of the best ways to learn about the different corners of the language is to read about what they're doing. This will help you pick up idiomatic style and will also expose you to more design patterns, language features, and functional programming techniques than you would be likely to encounter if you were just solving a problem using F# on your own.
The F# blogs syndicated on Planet F# are a good place to start, but there are also several excellent books and presentations on the language.
This only answers part of your question, but as you talk about wanting to create libraries in F#, the F# component design guidelines just came out:
http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/fsharp-component-design-guidelines.pdf
If you are interested in scientific libraries I suggest you to take a look at Jon Harrop's F# for Scientists.
Also to catter for your mathematician side I suggest you to read Doets-Van Eijck The Haskell Road to Logic, Maths and Programming, although written in Haskell, you will certainly be able to follow most of the text, and re-implementing the samples in F# could be a nice exercise.

Learning libraries without books or tutorials [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
While many ask questions about where to find good books or tutorials, I'd like to take the opposite tack.
I consider myself to be an entry-level programmer ready to move up to mid-level. I have written code in c, c++, c#, perl, python, clojure, vb, and java, so I'm not completely clueless.
Where I see a problem in moving to the next level is learning to make better use of the literally hundreds upon hundreds of libraries available out there.
I seem paralyzed unless there is a specific example in a book or tutorial to hand-hold me, yet I often read in various forums where another programmer attempts to assist with a question. He/she will look through the docs or scan the available classes/methods in their favorite IDE and seem to grok what's going on in a relatively short period of time, even if they had no previous experience with that specific library or function.
I yearn to break the umbilical chord of constantly spending hour upon hour searching and reading, searching and reading, searching and reading. Many times there is no book or tutorial, or if there is, the discussion glosses over my specific needs or the examples shown are too far off the path for the usage I had in mind or the information is outdated and makes use of deprecated components or the library itself has fallen out of mainstream, yet is still perfectly usable (but no docs, books, or tutorials to hand-hold).
My question is: In the absence of books or tutorials, what is the best way to grok new or unfamiliar libraries?
I yearn to slicken the grok path so I can get down to the business of doing what I love most -- coding.
Give a good programmer a manual and they can figure it out quickly. It is not reading books or tutorials that makes you a good programmer, it is actually programming. Practice. You want to be better and learn better, write more code. Set small coding goals or think of a simple application to make. The more you write while looking up syntax in books and tutorials, the more those syntaxes and practices will "click." The reason many are able to "grok what's going on in a relatively short period of time" is because most programming is just syntax.
I'll give you a personal example. I picked up a book on Objective-C to figure out iPhone development. Sat there reading it all last summer. Didn't know squat when I sat down to write the application I designed up in Photoshop. Sure, the ideas are up in my head, but I did not have any practical knowledge to execute them yet. At first the syntax was extremely confusing to me, but I have a lot of experience with programming in general, animation, and UI design, so once I "memorized" the syntax, the code started flowing more naturally. Now I can write Obj-C pretty fluidly without a manual and have better understanding of what task will be difficult and what will be easy.
My question is: In the absence of books or tutorials, what is the best way to grok new or unfamiliar libraries?
How about doing what you just did: asking a question here on StackOverflow? From my experience, questions of the type "how to do task A, B or C using library X" get answered fairly quickly, especially if they are beginner questions, and no matter how esoteric or outdated the library might appear to the questioner. In fact, on several occasions I have witnessed such questions being answered by the developer of the library himself.
Even if a library seems to have "fallen out of mainstream" quite a long time ago, chances are that there are still a few people here on SO who are using it or have used it at some point in the past.
Most importantly, you no longer have to "spend hour upon hour searching and reading [...] discussions that gloss over [your] specific needs, or examples [that] are too far off the path for the usage [you] had in mind", because you can tailor your question here on SO to your very own personal needs.
Libraries provide developers with a domain specific set of concepts with which to solve problems, not unlike natural (spoken) languages. The similarity is deeper than that: the same way knowing more natural languages makes it easier to pick up a new one, experience with more libraries eases the transition into using a new one. There's no magick bullet here: the more experience you have, the faster you progress because you can anticipate what using the library to solve the task might look like.
That aside, these are the things I find help when picking up a new library:
working examples with source, like the SmartGWT showcase
small API/simplicity, like XStream or CvsReader
high quality documentation, like the one from hibernate
The bet way to learn without books is in my opinion to start programming. Solving the problems which are facing you will teach you how to use the library.
If you want to inspect or search or learn a .NET assembly - Reflector. Its free, and very powerful.
http://www.red-gate.com/products/reflector/

What are the essential concepts all programmers should learn and use? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm currently learning to program, and I didn't take CS classes so I'm basically starting out on the bottom. I have been putting together code on and off for many years, but haven't really had a good understanding of essential concepts needed for enganging in bigger projects. Object-orientation is an obvious one, and I feel I'm beginning to understand some of the concepts there. Then there is a lot of buzz and methodology, such as MVC, UML, SCRUM, SOLID and so foth and so on.. I've looked at many of these but I'm always stumped as most explanations seem to require some understanding of other concepts.
I want to learn this stuff the "right" way, so where do I begin?
What are the overarching constructs I need to understand that enable me to understand all the underpinnings of software architecture/design/development?
What am I missing?
Are there constructs and concepts that can and should wait until I've cleared the foundation?
The SOLID principles are probably the most important.
From those you understand the motivation behind using a pattern such as MVC, why people think of persistence ignorance as important and so on. They are at the core of the majority of good practices.
Loose coupling, high cohesion.
And as for books, Code Complete covers almost everything at some level, at least.
Software development is a HUGE arena and you should be careful that you don't take on too much too quickly. Unless you're going to go in the direction of functional programming I'd suggest you start off by making sure you fully understand the concepts surrounding OO design and programming as this should be your foundation.
Once you understand that well you'll be able to understand design patterns a lot better and get a feeling for when to use them.
I'd suggest you try out a few languages till you find one you feel comfortable with, personally my favourite language is Ada which is a very pure OO language but in the business world I work in C# which still has a lot of issues but these are outweighed by the more vibrant job market.
I wouldn't worry too much about Scrum at this stage as you need to focus more on your dev skills before worrying about project management.
The most important thing is to work with as much code as possible, download lots of good reference solutions and work through the code till you understand it, and try and keep an eye on the development trends.
If its viable you may also want to considering attending some developer conferences too as these can be very inspirational.
Stay away from ACRONYMS (including those you've listed) and Methodologies(tm). At least in the beginning.
Read good books. Start with this one: Pragmatic Programmer. Learn algorithms and data structures, possibly from Introduction to algorithms by Cormen et al.
Write a lot of code. Practice is more important than anything else.
How to test software with unit tests. Being able to do that will solve 90% of all the other issue automatically since you can't test while they are around.
When you know how to test, you can start on advanced topics like design.
I'd recommend "Object Oriented Analysis and Design with Applications" by Grady Booch et al. The latest editoin has detailed explanation of concepts of OOAD including MVC, UML (which he invented), and discussions on how to manage the whole process of software development. The second part of the book exemplifies all this by developing 5 sample systems (with sometimes orthogonal aspects from the very core).
Another good one is of course Design Patterns by GoF which will give you an idea of loose coupling, ways to efficient encapsulation and reuse of code, etc
For what concerns the algorithmic part, take any book which is not bounded to a particular programming language. My favorite is Introduction to Algorithms by T. H. Cormen et al, it gets a bit theoretical at some points, but I especially like it when they are proving certain things and not just asking you to believe it.
When you are working with any modern general purpose language, it is probably a good idea to get a handle on patterns (MVC or Model-View-Controller is one). The book by the "gang of four" is a must read for this, or at least research a few and use it as a reference.
clicky
Refactoring is another concept that should be in your arsenal. The book by Martin Fowler on this subject is a very nice read and helps understand the aforementioned patterns better also a little explanation about UML is included.
Can't post more than one hyperlink so...
search on amazon for: Refactoring, Improving the design of existing code
When you want to communicate your designs UML (Unified Modelling Language) is the 'tool' of choice for many people. However UML is large and unwieldy but Martin Fowler (again) has managed to boil it down to the essentials.
search on amazon for: UML Distilled (make sure you get the most recent one)
SCRUM is one of many methods that is used to manage software development groups, I do not think there is much merit in learning that when you are just starting out or on your own. Especially not in detail.
Hope it helps...
PS: SOLID I haven't heard about yet, somebody else has to help you there.
You'd have a decent foundation if you surveyed basic Data Structures, Algorithms, and Algorithms Analysis.
I think that you should start coding real world problems to get a feel for problems in the programming domain.
Then you have a better background to understand why objects are important. Then, after managing objects, you will learn why patterns and OO principles are important.
Personally, I highly recommend the Agile Software Development, by Robert C Martin.
But it may be a long and tiresome read unless you have a feel for the problems being solved. I'm afraid that you may need 500-1000 hours of coding at the minimum before you get an appreciation that the problems being solved are real.
And it probably takes 7000+ hours before you develop an instinctive heart-felt pain from merely reading the problems, making this sort of book become the page-turner that it should be.
Regrettably, many of the sound practices that you should develop are only appreciated after having to live with your code over time. If you just do many excercises and abandon the code afterwards just "because it works", then you are missing out on the greatest pain of all. It is a luxury our industry does not have, and "technical debt" is a very very real and costly to those with large code bases.
I feel kinda silly answering my own question like this.. :) But one valuable resource I've found for learning to write code, is the Euler Project at http://www.projecteuler.net
It's basically a collection of mathmatical problems that you solve by writing your own solution to it. Once you've found the answer to a particular problem, you're allowed access to that problem's forum where different solutions are discussed. I was amazed at how much I was learning in a) solving a challenge, b) reading about other peoples approaches and c) how many programming languages there are out there! :)
The problems start out easy (you can tell by the number of people who's solved them) and progress to harder and harder problems.
Currently I'm working on problem #3, having solved the previous two... I recommend you start chippin' away at them, no matter your level!

Did you feel learning to program with turtle graphics was useful? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm preparing to teach someone to program. When I learned the course material, I used turtle graphics for the first few exercises. In reading introductory textbooks, I have not found one that uses the technique. Did others find this approach helpful? If not, what is a better way to learn to program?
I think it depends on age of the target group.
If they are children (I would say up to 12-14 years), doing any easy graphics is a good way to motivate them; on the other hand, don't expect them to learn much about real programming or algorithms.
If they are teens (14-18), it's perhaps still good to use some algorithms that give pretty results (for example 3D or fractals), but since they are older and capable of more abstract thinking, I don't think 2D turtle graphics is interesting enough.
If they are older, doing any graphics is a distraction. At that age, they should have enough inner motivation to learn without anything fancy.
To sum up, I think that fancy graphics serves more motivational role (that you see what you did fast, and it's easy to show others what can you do with a computer) than learning role (that it would make learning real programming easier).
In the late 80s, before I was programming in C, I was programming in Applesoft BASIC and Logo. As a child I thought the turtle was great because it make programming simple. If I decide to teach my children Logo I will probably start here to get an actively developed Logo interpreter.
The key thing about LOGO is user-defined functions. It is very good at conveying that, as long as you emphasize it. Show interactively how to draw a square, then make a new word called square. Then show how you can draw patterns using square. Then make those patterns into words, and so on.
You could do worse in teaching programming than using a tool like Scratch. It's a drag and drop programming interface and can be used to teach basic concepts of programming with some fun visual results (as can be seen from the gallery on their website).
Rob
Logo gave me a very clear picture (no pun intended) on how recursive functions would work, and since I was doing assembly programming at the time, the need to return to the previous state when returning to a method became very clear with Logo.
Recursive implementations of things where also very easy to see the effect of.
I wrote script/code in a c-like dialect for a game called Doom2 before I knew what programming was, so when it came to seriously learning about concepts such as pointers, inheritance and polymorphism I found the basics a breeze because I could construct a mental model to not only help me understand, but also appreciate how cool things like pointers and arrays are.
A friend of mine is a good programming student, but he gets frustrated when he can't visualize an algorithm working, when I was starting to help other students I found they had the same problem, if they can't see something working it's harder to appreciate as a fledgling programmer, the same friend eloquently suggested I "Show 'em some crazy pimp shit and then show them how it's done". He's right, even if someone really wants to learn something they'll be able to draw on more mental energy if they think what they're learning lets them do awesome things.
My best bit of advice is this: AT THE START SPEND AS LITTLE TIME PROGRAMMING TO THE CONSOLE AS POSSIBLE
It makes you feel constrained and your efforts appear futile, only after you appreciate it as a front end should it be used for learning to program. I wouldn't use logo myself because I don't think it can teach concepts such as the aforementioned polymorphism or inheritance nearly as well as other methods, I know a friend of mine is teaching a teenager how to program using XNA in a wrapper, I think anything that can let you blit an image to the screen is fine. That way you can see why you'd want an abstract base class called EnemyEntity with behavior that's inherited by zombie and dog etc. It's not that the concepts are hard to understand, it's just that at first they're hard to appreciate.
I could go on but I think that puts across what I've learned by teaching others. I think using graphics in teaching programming allows students to gain the ability to build mental models of intangible concepts faster than any other.
XNA If you want to teach C# that's an amazing graphics library, just write a wrapper sprite class to hide as much complexity when first starting out and teaching concepts.
SDL A lower level library if you're going to start with c++
During one of my first-year computer science papers we used Java to create fractal patterns via a turtle object.
It was pretty fun to see visually whether or not we had correctly implemented the algorithm required to produce a certain pattern. However, so answer the main question, I wouldn't say that programming via a turtle is useful. I'd say the best way to teach someone to program is to get them to build their own app to do whatever they want it to do. This gives them creative control, plus if they get stuck they can learn how to resolve a problem.
I strongly suggest to start with a interpreted language like Logo (not compiled) because of the quality of the error messages. Reading error messages is very important in this process. Also, at the easy level, Logo allows you to run your instructions one by one in direct mode and carry them to your procedures when you get the expected results.
# Alex: MicroWorlds is a commercial version of Logo and it does exist in English, Spanish, Portuguese, Italian, Russian, etc. it's a big plus if you are not a native English-speaking person.
LOGO is not only Turtle-Graphics.
There are also other interesting concepts in it which come from LISP.
'Turtle' is just icing on the cake and the "imperative" side of Logo.
:)
I learned to program in BASIC by writing simple programs drawing faces (I mean circles and squares) on the screen. Somehow the whole turtle programming was never my thing, although a few of my friends learned that way. Later on I moved to Pascal, then to Delphi, Java and C++/C#.
In my opinion the trick is to "wow" your student and impress/empower with potential things that you can accomplish by writing your own programs. I would actually demonstrate some GUI programming or game programming. It's much easier to learn the basics by keeping the end goal in mind.
Recently I came across SmallBasic - a cool programming environment for kids designed to teach concepts. I would give that a try. It comes with a pretty complete paper describing how to use it.
When I got my first computer (VIC-20) and started programming it was very hard to explain to my parents what I was doing.
My mother tok a course in computing preparing for a project of computerizing the library she worked in. They had a couple of classes introducing them to programming. After learning LOGO she came home and said that she suddenly understood what I was into.
So LOGO with turtle graphics brought us closer together!
I did a "computing for kids" course in the late eighties, and there was an extensive section on turtle graphics using logo. In all honesty I was bored to tears, and learned virtually nothing from it.
I think "programming the turtle" might work better for someone who is artistically inclined, or hugely into geometry, but by and large, there are far more interesting problems to attack, even for kids.
Ah, the memories of good old Logo. I think I got more of a geometry lesson than a programming lesson out of it, e.g. figuring out how much to turn at various points to produce a particular shape, design or pattern. It may work if you plan on mixing geometry with the programming, but if the person doesn't have the basics of geometry, e.g. what is a square and how is it different from other 4-sided shapes, what is a triangle, etc.
I used logo and turtle at school too, a great introduction.
It looks like our kids will be getting a slightly updated interface with Microsoft Kodu. It looks very impressive. It's an icon based programming language made for creating games that runs on X-Box Live.
I'm currently learning python and using a little bit of turtle. In labs we haven't used it, but our homework does. It's nice to know it exists, and it's a good way to get certain commands and syntax in. Overall I don't feel it was completely necessary though.
When I was young, I found it very interesting. It was one of the first programming languages that I've learned, even though I've used it for about two days. It started my interest in programming.
Nowadays, I think the syntax is a bit unclear because most statements are abbreviations. Nowadays, computers are far more powerful thus the language could profit from clearer statement. Another factor is the native language of the person who is learning to use it. If English is not your native language then Logo becomes a bit more complex to understand. So if you're teaching Logo to children, make sure they're familiar with English terms first. (Quite easy if you're a native English-speaking person. More complex if you're originally Dutch, German, French, Portuguese. Even more complex if you're Russian or Chinese because you'd have to adjust to a different character set too.)
I have just begun teaching my 7-year-old how to program using Logo, and he is having a load of fun with it. The commands are easy enough for his limited reading ability and he just loves drawing cool pictures using the turtle graphics. I was amazed at how well he retained what he had learned using it, so I feel it was a good choice for his age.
For older kids (or adults) other languages might have more advantages as a beginner language though
Personal experience, YMMV...
My first encounter with a computer was turtle graphics in my early teens. I loved and was immediately hooked. (Perhaps because for the first time someone [something] did exactly what I told it to do?)
The visual and instant feedback made me want to do more and more. I really wanted to figure out how to replicate the pictures I saw in the book I was using. Without me even classifying it as "work", it slowly built up my early programming skills and my confidence I could learn on my own.
I credit it with sending me in the path I'm in today, a happy software developer who can't believe I get paid to do this work (I know, I know - all corporate snickering aside, I like my work).
As I said, YMMV.

Resources