IDE help

Discussion of chess software programming and technical issues.

Moderator: Ras

Dave_N
Posts: 153
Joined: Fri Sep 30, 2011 7:48 am

Re: IDE help

Post by Dave_N »

The advantages might be compile time and portability.
kbhearn
Posts: 411
Joined: Thu Dec 30, 2010 4:48 am

Re: IDE help

Post by kbhearn »

Just organisation really - but it is handy organisation, easier to find the portions of the code you're looking for, easier to extract what's necessary to reuse code in another project (just copy over the .c and .h that contain the pieces you want).
Aleks Peshkov
Posts: 977
Joined: Sun Nov 19, 2006 9:16 pm
Location: Russia
Full name: Aleks Peshkov

Re: IDE help

Post by Aleks Peshkov »

Some simple chess programs are written as single file. It is possible to split chess source code into several files later, when you will feel the need for it.
lucasart
Posts: 3243
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: IDE help

Post by lucasart »

Robert wrote:Thanks Kevin

Now i really understands the use of .h and #include stuff to the code be accepted to the compiler.

Last question: I am just curious if there are any advantage(speed or size) of use multi sources instead of one big C.

I expect a big no answer. :wink:

This is just a question of organization, right?

To moderators: Feel free to move this thread to General Topics if there are to much programmers bored with this discussion. :oops:
A big yes answer you mean ? Unless the reason is that you don't understand how to use multiple source files, the benefit of having multiple sources are obvious. It's as if you said that it's better to write all your program in the main function and put lots of goto there. Of course it's possible... Ugly as hell, but possible. The advantage is dependability. For the same reason that you have independant functions doing separate things that can be reused and tested independantly, you have multiple source files
lucasart
Posts: 3243
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: IDE help

Post by lucasart »

Robert wrote: To moderators: Feel free to move this thread to General Topics if there are to much programmers bored with this discussion. :oops:
On the contrary, your question is very relevant to the programming forum. In the general forum, your thread is likely to get polluted by people who don't know anything about programming. Feel free to ask, I'm sure everyone here is happy to help you with programming questions.

If you want to learn and understand in depth the C language, I *strongly* recommend you read this. It's a very good book to learn C, written by none other than the inventors of the C language, and praised by many of the C gurus as the best book on C

Code: Select all

cg.inf.unideb.hu/eng/rtornai/Kernighan_Ritchie_Language_C.pdf
If you read each chapter carefully, and take some time to do the exercises, you'll be a skilled C programmer by the end of it.