PDA

View Full Version : Learning programming



tallica
September 5th, 2006, 18:30
I want to learn basic programming but i dont know what i should start with. I was thinking about doing visual basic but just want to know what you guys would suggest for a programming noob. Any links to sites where i can learn some basic programming would be much apreciated :)

Nafogel
September 5th, 2006, 18:36
I'm in the same boat as you man, I learned to program in TI-Basic on my calc when I was bored in math class, But I wanna learn something a little more complicated, and google just aint helping me right now. Any links would be very useful...

yaustar
September 5th, 2006, 19:49
Standard Reply Below.

Beginning
If you are just starting out with C++, then completely forget about programming for the PSP for the moment. It will only add an extra layer of complexity that will stop you from learning the language and the main concepts of programming.

Learn the fundamentals first, these include:
- Variables
- Conditional Statements
- Loops
- Functions
- Return values
- Parameter passing

Gamedev have a C++ workshop that has been going for a while now that you still might be able to catch up. 'Thinking like a Computer scientist' is also considered a good free ebook but nothing will substitute a good 'real' book on paper. At this point, you be mostly working with text in a 'console' (ie command prompt).

Targets: simple applications such as a Line based text editor that reads and writes to a file, Tic Tac Toe, a Text Adventure (with a command parser), Hangman, etc.

Workshop: http://www.gamedev.net/community/for...sp?forum_id=76
Thinking like a computer Scientist (C++ version): http://www.andamooka.org/reader.pl?section=thinkcpp
C Plus Plus Site: http://www.cplusplus.com/doc/tutorial/
Beginning C++ Game Programming: http://www.amazon.co.uk/gp/product/1592002056/026-1649123-1896422?v=glance&n=266239&v=glance

Middle
After this you can move onto more language specific areas such as the macros, pointers, references, const, header/source organisation. Also you can start looking at graphical libraries such as SDL and OpenGL, both of which are cross platform and work on the PSP. This means that you can work on the PC and with some minor changes to the code, recompile and it should work on the PSP as well.

Targets: Graphical games such as Tetris, Breakout, snake, Mario clone, a small FPS level.

Thinking In C++ Vol 1: http://www.mindview.net/Books/TICPP/...ngInCPP2e.html
SDL tutorials: http://lazyfooproductions.com/SDL_tutorials/index.php
OpenGL tutorials: http://nehe.gamedev.net/

Advanced
Finally, you can jump into Object Orientation programming and the finer areas of the language (although you can do this at any point really). Thinking in C++ Vol 2 is probably the best free ebook in this area. There are also a selection of PDFs on the five principles of OOP.

Targets: Anything you want, think big and go for it.

Thinking in C++ Vol 2: http://www.mindview.net/Books/TICPP/...ngInCPP2e.html
Five Principles in OOP:
http://www.objectmentor.com/resources/articles/srp
http://www.objectmentor.com/resources/articles/lsp.pdf
http://www.objectmentor.com/resources/articles/isp.pdf
http://www.objectmentor.com/resources/articles/dip.pdf
http://www.objectmentor.com/resources/articles/ocp.pdf

Working on games? At the bottom line, there is little difference in approach to designing a Word Processor and a Game. They both require careful thought and preparation before starting otherwise you end up with very hacky and messy code base which will hinder your project's progress. At present, some of the Lua projects going on here (no offence to anyone, I know you guys are still learning) are falling in that trap, I myself have done so several times in the past as well. However, there several areas that will help you greatly in designing and building a game. One of them is Finite State Machines (FSM). This has been used for the game's structure, AI, item behaviour etc. The other skill is Abstraction which you will pick up with experience. It is basically taking an object and form it in code, from 'base' componments. Eg:

What is a bullet? It has an position in space (X, Y ,Z value), graphical representation and a velocity.

Some other bits and pieces of information
Keep up your math skills at a good level, especially areas such as Trigonometry, Algebra and Vector math. They are invaluable in programming especially game programmming. Later on, you will need to have some knowledge of matrix math when dealing with 3D scenes.

Here are some FAQs for the C++ language, Matrix math and vectors although you wont need them for a while yet:

C++ FAQ lite: http://www.parashift.com/c++-faq-lite/
Matrix Math FAQ: http://www.gamedev.net/reference/art...rticle1691.asp
Vector Math FAQ: http://www.j3d.org/matrix_faq/vectfaq_latest.html

This link is especially important for learning how to organize your files correctly in C/C++
http://www.gamedev.net/reference/articles/article1798.asp

Wiki for Games Development in general
http://gpwiki.org/

Doing a platform/jump and run game? Take a look at jnrdev
http://jnrdev.72dpiarmy.com/

Want to write a Game Engine? I recommend at least reading through these articles first and if you can, the book Game Coding Complete
http://www.gamedev.net/reference/programming/features/enginuity1/
http://www.gamedev.net/reference/programming/features/enginuity2/
http://www.gamedev.net/reference/programming/features/enginuity3/
http://www.gamedev.net/reference/programming/features/enginuity4/
http://www.gamedev.net/reference/programming/features/enginuity5/

Learn the Standard Template Library (STL) or/and Boost. They have a number of template classes that are extremely useful such as vectors, lists and smart pointers. Abuse them.

Books
Here are a list of good books to read although they will be at an advance level so keep the list as future reference:
- Code Complete: http://www.amazon.co.uk/gp/product/0735619670/026-1649123-1896422?v=glance&n=266239&s=gateway&v=glance
- Rapid Development: http://www.amazon.co.uk/gp/product/0072850604/026-1649123-1896422?v=glance&n=266239&s=gateway&v=glance
- Pragmatic Programmer: http://www.amazon.co.uk/gp/product/020161622X/026-1649123-1896422?v=glance&n=266239&s=gateway&v=glance
- Game Coding Complete (Fantastic book, MUST READ): http://www.amazon.co.uk/gp/product/1932111913/026-1649123-1896422?v=glance&n=266239&s=books&v=glance
- Effective C++: http://www.amazon.co.uk/gp/product/0321334876/026-1649123-1896422?v=glance&n=266239&s=books&v=glance
- Design Patterns: Elements Of Reusable Object Orientated Software: http://www.amazon.co.uk/gp/product/0201633612/026-1649123-1896422?v=glance&n=266239&s=books&v=glance

There is a ton more information that I can pass on but I think this should keep you going for a while and you will pick up the rest as you go along.

Inigo Montoya
September 5th, 2006, 21:28
What if I wanted to develop in a non-mainstream language such as Forth? Every article on Forth I've read says it's so easy to port that not only can idiots do it, they do do it. But I can't seem to do it. Do you know anything that could help?

yaustar
September 5th, 2006, 22:17
Currently there is nothing on the PSP that will run any Forth program Compiled or Interpreted.

http://forthfreak.net/index.cgi?ForthSystems

From what I have just quickly read, the language itself is non platform specific but it needs the/a interpreter needs to be ported or a cross compiler built. Unfortunately, neither of those exist.

The closest you can get to this is Lua with LuaPlayer.

Inigo Montoya
September 6th, 2006, 19:05
Thanks, Is there an assembler for the PSP?

bronxbomber92
September 7th, 2006, 01:31
Could learn lua if you wanr an easy way out... And if you want to compile code in c/c++ you need cyqwin and have the psp toolchain installed. Goto psp-programming.com for tutorials on how todo this.

yaustar
September 7th, 2006, 14:50
Thanks, Is there an assembler for the PSP?
Assembler as in ASM assembler? If so, then yes. If you were talking about about Forth then:

Currently there is nothing on the PSP that will run any Forth program Compiled or Interpreted.

Inigo Montoya
September 7th, 2006, 15:13
I was thinking ASM assembler.

yaustar
September 7th, 2006, 15:29
Then yes, there is one. Not my area though so I dont where to point you for that.

bronxbomber92
September 7th, 2006, 23:19
I know psp-programming.com/dev-forum has a ASM forum. You may want to look in to that.