printing the source code

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

printing the source code

Postby Uri Blass » 16 Apr 2005, 19:13

I wonder how many programmers print their source code in order to read everything and think if they can improve things or to write comments
what to delete and what to add in order later to put it in the computer.

Uri
User avatar
Uri Blass
 
Posts: 727
Joined: 09 Oct 2004, 05:59
Location: Tel-Aviv

Re: printing the source code

Postby Volker Böhm » 16 Apr 2005, 20:14

Hi Uri,

I never print source code, I only work at the computer. But I think a lot before I go to the computer.

Greetings Volker
Volker B?hm, Spike Team
Volker Böhm
 
Posts: 66
Joined: 27 Sep 2004, 18:52
Location: Germany

Re: printing the source code

Postby Uri Blass » 16 Apr 2005, 20:49

Do you think what do you want to fix in the code?
There are cases that I do not see a good way to do it without looking at the code.

I can give an example.
I have a function to make moves and a special function to make null move.

I read in the past that Tom kerrigan(programmer of tscp) suggested not to have special function for null move and I am not sure if it is a good idea from speed but it seems that the code may be more simple if I do it.

Part of my makemove and donull is the same but part is not the same.

in makemove(u) I can add some if (u==0) or if (u!=0) in order to have one function and I am not sure if it is a good idea.

If I decide to delete donullmove then I need to look at the source code in order to design the new function of makemove and I think that printing the existing function can help me because looking at the source in the computer and thinking based on it does not seem to me the most convenient way.

Uri
User avatar
Uri Blass
 
Posts: 727
Joined: 09 Oct 2004, 05:59
Location: Tel-Aviv

Re: printing the source code

Postby Reinhard Scharnagl » 16 Apr 2005, 21:28

Hi Uri,

it could make sense to post sourcecode IN PARTS to ONE SPECIAL person. To post it completely and readable by everybody is strange to me.

To nullmoves: I experimented with it but have had none or no noticable success with it. I have no special function for nullmoves. There only is a special move encoding consisting of a zero value (no surprise) which will be interpreted as a nullmove when performing that move.

Regards, Reinhard.
Reinhard Scharnagl
 
Posts: 608
Joined: 01 Oct 2004, 08:36
Location: Klein-Gerau, Germany

Re: printing the source code

Postby Uri Blass » 16 Apr 2005, 22:27

Hi Reinhard,
1)There is a misunderstanding.

Printing the source code does not mean releasing it but printing it
in a paper instead of reading it from the computer.

I think that it may be more convenient to read it from a paper and think what to change.


2)I do not think to release the source code as it is.
I may release something later but if I do it then it is going to be something that has the following properties:

a)Code that is more clear than my code(not irrelevant comments that I did not delete)
b)Program that is significantly weaker than Movei of today without some original ideas that I use.

I believe that if I do it there is a practical chance to get productive comments to improve my code and also people who want to have a clone will have significantly weaker program and with all the free source code that is already there I do not see a significant demage because people who want to clone a program can already do it with Fruit and many other free source programs.
User avatar
Uri Blass
 
Posts: 727
Joined: 09 Oct 2004, 05:59
Location: Tel-Aviv

Re: printing the source code

Postby Anonymous » 17 Apr 2005, 17:15

Hi,

You can do it at least once to see how pretty the printed code looks like.

Ah, and when I did it I discovered quickly at least one bug and some small optimizations I couldn't see at the screen.

I haven't do it since a lot, as my code in general haven't really changed much since old versions. I never had the urgency of a significant rewrite.
Anonymous
 

Re: printing the source code

Postby Volker Böhm » 17 Apr 2005, 17:33

Hi Uri,

I have a special "DoNullmove" and "UndoNullmove". "Do Nullmove" is five lines, UndoNullmove is 2 lines of code. Don?t know why I should take much time to bother if DoMove(0) is better than DoNullmove. It wouldn?t make my code much easier to read or faster.

But you are right. When in "optimizing" mode I scan through the source code (on screen).

Greetings Volker
Volker B?hm, Spike Team
Volker Böhm
 
Posts: 66
Joined: 27 Sep 2004, 18:52
Location: Germany

Re: printing the source code

Postby Anonymous » 17 Apr 2005, 18:32

Uri Blass wrote:I wonder how many programmers print their source code ...


Years ago, when still matrix printers with endless paper were en vogue, I often printed source code. The endless paper seems much better for reading program code. In recent years, I have practically not printed any source code.

Regards,
Dieter
Anonymous
 

Re: printing the source code

Postby Tord Romstad » 17 Apr 2005, 23:59

It seems like I'm in the minority: I always print out my code when I want to study it. I hate reading big amounts of text on a computer screen, even on my very nice 20 inch LCD monitor. Whenever I want to have a close look at my source code, I print out all of it, and sit down with a cup of coffee in one hand and a pen in the other hand.

In an attempt to be a bit more environment-friendly, I usually print the code with reduced size; four pages on each sheet of paper. Afterwards I use the back sides of the sheets to do mathematics.

Tord
User avatar
Tord Romstad
 
Posts: 639
Joined: 09 Oct 2004, 12:49
Location: Oslo, Norway

Re: printing the source code

Postby Richard Pijl » 18 Apr 2005, 12:01

I'm printing source as well, when I want to take a really good look at it. Somehow I only feel comfortable when having a pen in my hand, and fingers at the interesting sections of the code.

This is not limited to code though. Whenever I have to read something seriously (of some serious size) I have to print it, get coffee, sit comfortable and make notes while reading.

But ... I recently discovered the folding capabilities in VC 2005 express (i.e. compressing a block of code on one line) and that may just help in doing more directly on the screen

Richard.
User avatar
Richard Pijl
 
Posts: 105
Joined: 26 Sep 2004, 21:09
Location: Minderhout, Belgium


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 33 guests