Page 1 of 1

printing the source code

PostPosted: 16 Apr 2005, 19:13
by Uri Blass
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

Re: printing the source code

PostPosted: 16 Apr 2005, 20:14
by Volker Böhm
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

Re: printing the source code

PostPosted: 16 Apr 2005, 20:49
by Uri Blass
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

Re: printing the source code

PostPosted: 16 Apr 2005, 21:28
by Reinhard Scharnagl
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.

Re: printing the source code

PostPosted: 16 Apr 2005, 22:27
by Uri Blass
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.

Re: printing the source code

PostPosted: 17 Apr 2005, 17:15
by Anonymous
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.

Re: printing the source code

PostPosted: 17 Apr 2005, 17:33
by Volker Böhm
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

Re: printing the source code

PostPosted: 17 Apr 2005, 18:32
by Anonymous
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

Re: printing the source code

PostPosted: 17 Apr 2005, 23:59
by Tord Romstad
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

Re: printing the source code

PostPosted: 18 Apr 2005, 12:01
by Richard Pijl
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.