Re: [fpc-pascal] Questions on Documentation

2005-10-10 Thread Elio Cuevas Gómez
El Lun 10 Oct 2005 19:19, Bob Richards escribió:
>
> I miss the old DOS IDE of Borland-of-Old; FP is somewhat OK, and Lazarus is
> way too much for system programming. But that's no real problem, VI does me
> just fine!

Why don't you try FP? It's included in the FPC distribution IIRC. But i'd 
rather program in VI any day ;-).

>
> The biggest problem I have run into is the function/procedure
> documentation. While very complete, and clearly written, it is organized in
> a way making it difficult to find things. Similar functions and procedures
> are scattered among various Units, making things difficult to locate. What
> I need is a reference document, listing procedures and functions by
> category (or at the very least alphabetically as in the Turbo Pascal 5.0
> Reference guide). All disk-file routines for instance, listed, in one
> place.
>

Well, the functions are organized by unit. The IO functions are in the system 
unit i think. Misc functions are in the SysUtils unit, etc...

>
> Are there any printed manuals? Has someone written a good book which would
> be a good reference? Not knowing any OOP (nor having a desire to) would
> purchasing a book on Delphi help me in my FPC documentation quest? Any
> sugestions on which one?
>

Well, you could just print the PDF's. OOP is not required to program in FPC, 
but it sure helps. The FPC implementation of Delphi classes are very similar 
to... ehhhm, Delphi, so you could benefit from learning it.

> Best Regards
> Bob
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Questions on Documentation

2005-10-10 Thread Bob Richards
Hi All:

I am new to this list, but not new to pascal programming. I have been writing 
pascal code
since Turbo pascal Version 3.0.

I have installed Free Pascal Ver. 2.0.0, running it on a Linux WorkStation, and 
am writing
CGI apps which run on a Linux server. I love FPC! It keeps me honest, and my 
code "safe",
and easy to follow years later.

I miss the old DOS IDE of Borland-of-Old; FP is somewhat OK, and Lazarus is way 
too much
for system programming. But that's no real problem, VI does me just fine!

The biggest problem I have run into is the function/procedure documentation. 
While very
complete, and clearly written, it is organized in a way making it difficult to 
find
things. Similar functions and procedures are scattered among various Units, 
making things
difficult to locate. What I need is a reference document, listing procedures 
and functions
by category (or at the very least alphabetically as in the Turbo Pascal 5.0 
Reference
guide). All disk-file routines for instance, listed, in one place.

I was reviewing some code I wrote, and discovered that some functions I had 
written were
now part of an FPC Unit (more elegantly coded I might add) Is there such a
cross-reference document somewhere? If not, can one be generated using 'fpcdoc'?

Are there any printed manuals? Has someone written a good book which would be a 
good
reference? Not knowing any OOP (nor having a desire to) would purchasing a book 
on Delphi
help me in my FPC documentation quest? Any sugestions on which one?

Best Regards
Bob

-- 
PGP Encrypted E-Mail Preferred
Public Key at: http://www.tamara-b.org/~bob/pubkey.asc
.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPCUnit article/tutorial online.

2005-10-10 Thread L505

> I personally wouldn't recommend using FPCunit in all cases.
> The purpose of the article is to show that it is present in FPC for those who
> want to use such a technology.
>

Exactly, and I think this discussion has helped me see where I can start 
experimenting it
first, and what cases it would apply more greatly to.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPCUnit article/tutorial online.

2005-10-10 Thread L505
> debugger (I still don't know how to use it effectively with Free Pascal
> and in Lazarus I usually keep it disabled :) A failing test usually

Same here, I may be speaking from small project experience though, rather than 
huge/large
level project experience. I think I may use the debugger more often on large 
projects in the
future.

> But in my case, when I'm doing unit testing of non visual code in more
> complex frameworks and I find a class that is difficult to test in

Right, after reading some more about unit tests, I figure testing will be 
useful more for
stdout/piping/cgi/compiler/HaveToBeCorrect style applications moreso than in 
GUI style apps.
And I do build those type of apps.

> in my design, often the classes proved to be too tightly coupled or had
> a wrong interface. So, from my experience, writing tests has the side
> effect to improve the design of my code.

I've written about stuff  like this before too, such as "Problems with 
designing software
around forms" which many delphi programmers do. So the ideas behind unit tests 
would agree
with some of my thinking. I think many people tightly couple their applications 
around Form1
too much, mainly in larger applications. In smaller applications, making a 
form1 style
application is quick, convenient, and more beneficial than going from scratch 
with your own
thought out design.

> The Free Pascal Compiler is the best example of the success of testing,

A compiler of course needs to be tested...  :)  which i think is bit biased 
bringing it up..
but I see the purpose of tests more now that you mention the compiler. So 
biased examples
are okay, to bring about a point. I bring up biases all the time.

Compilers need to be tested vigorously for correctness - moreso than any other 
peice of
software.. since it creates the software, and that software better well be 
correct when fed
source code that is correct!

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPCUnit article/tutorial online.

2005-10-10 Thread Dean Zobec

L505 ha scritto:


Since I don't exactly know what test frameworks are, even after reading about 
them for the
past few years, I'm going to ask some risky questions. This is not a flame 
thrower attempt
at the test framework advocates, I'm just trying to understand what exactly 
they do, from a
"newbie to test frameworks" perspective.
 


I did not understand the full benefits of unit tests till I've tried them.
And it took a lot to get accustomed to them.


Do test frameworks
-cause you to spend lots of time writing test frameworks instead of program 
code?
 

The function of the xUnit testing framework is to let you write tests 
faster and with less effort. It's a matter of personal development 
habits and preferences of course, but the greatest benefit of unit 
testing I've experienced was the reduction of time spent with the 
debugger (I still don't know how to use it effectively with Free Pascal 
and in Lazarus I usually keep it disabled :) A failing test usually 
leads me directly to the problem. The safety net provided by the tests, 
written at the same time as I write the code gives me courage to do the 
refactoring that I find usefull when I review the code to improve the 
design,  or the changes that I need to apply when I do some profiling. 
It assures  me I've not introduced collateral damage.



-even apply to languages with compilers and strong typing?
 

I has nothing to do with strong typing IMHO, I love strong typing but it 
does not solve all my problems. I'm not a perfect programmer, I'm quite 
successful in making mistakes and I need to be sure that a piece of code 
does exactly what I thought it should do, without making assumptions and 
discover the problem later, when the code has been used in other higher 
level functions or frameworks



-cause you to write your programs to conform to the test framework, instead of 
the program
framework?
 

Not all kind of code can benefit from unit testing, it's no use in my 
opinion to try to test the GUI code, and it's difficult to test some 
parts of web or db applications.
But in my case, when I'm doing unit testing of non visual code in more 
complex frameworks and I find a class that is difficult to test in 
isolation, I've noticed that in most occasions this is due to some flaw 
in my design, often the classes proved to be too tightly coupled or had 
a wrong interface. So, from my experience, writing tests has the side 
effect to improve the design of my code.



-have any actual statistics of success?
 

The Free Pascal Compiler is the best example of the success of testing, 
have you seen how many test have our compiler gods put in place in their 
testing suite? It's not fpcunit but the effect is the same. It was the 
first think I've noticed when I checked out the code from cvs the first 
time. Then I've noticed that each time a bug was found it was pinned 
down in a test to prevent it to emerge again, and I've begin to learn 
some other good tricks from them.



-have popularity statistics that prove they are popular (in the Delphi 
community) as stated
in the article?
 

I'm quite sure that the folks at Borland don't do a lot of unit testing 
;) after all DUnit and NUnit are open source products :), but yes, in 
the open source Delphi community they are quite popular, see the Jedi 
JCL project that uses DUnit for example:

http://cvs.sourceforge.net/viewcvs.py/jcl/qa/automated/dunit/units/
The developers that took over the InstantObjects framework development 
are now successfully using FPCUnit to begin to understand the complex IO 
framework, pinpointing the code to be able to do some changes safely and 
maybe to pave the way for the  Lazarus port. (See 
http://cvs.sourceforge.net/viewcvs.py/instantobjects/Source/Tests/)


The Mono project is successfully using NUnit too.



-have any real world examples of how they helped personX fix problemY in 
significantly less
time?
 

It's not about fixing a problem in my experience. It's about maintaining 
the same level of productivity when the system grows. To be able to do 
fearless refactoring in the phase of  reviewing the code when 
discovering some "bad smells", to be able to improve the design.
I find it difficult to begin some large refactoring without a solid base 
of tests in place. When I publish some code I prefer to thoroughly test 
it before and when I submit a bug report I found practical to provide a 
failing test that isolates it. Unit Tests are not a panacea to all the 
problems, but they make my work easier.  It helped  me to drastically 
reduce the  time I've spent debugging.  It took some time and effort to 
learn to write good tests but for me it was a good investment.  By doing 
the tests as I write the code I've learned to spend less time in 
developing good tests (it's like mowing a lawn, when the grass is small 
it's easier). It keeps my productivity stable even when the code is 
getting complex and it even helps me to isolate a reported bug in my 
code. Now I'm re

Re: [fpc-pascal] FPCUnit article/tutorial online.

2005-10-10 Thread Florian Klaempfl
Michael Van Canneyt wrote:

> 
> 
> On Sun, 9 Oct 2005, Tony Pelton wrote:
> 
>> i started to write a rather lengthy reply to this note, and realized i
>> was starting to rant.
>>
>> so i'm gonna shorten my reply up quite a bit.
>>
>> i'm a java web app programmer by trade. i use Pascal for fun stuff.
>>
>> up until a couple of years ago, i went through a series of companies
>> where i couldn't escape the _nightmare_ of unit testing mantra, being
>> forced down the development teams throat ... _usually_ with a whole
>> helping of other ridicoulous development "paradigms" freshly read by
>> the manager right out of "CIO" magazine.
>>
> 
> Your story is an example of how a 'good' technology can be ruined by
> applying it too much or in an inappropriate way. Alas, this happens too
> often when people who actually don't have a clue start dicating the
> rules.
> 
> But that doesn't mean this technology is bad. FPC uses a testsuite
> (not based on FPCunit) to test the compiler. And luckily so, because
> this has helped the compiler team to eliminate bugs on many an occasion.

Without the regression tests of our testsuite, FPC would have much less quality
than it has now. Also code reviewing is something which helps a lot for complex
stuff.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPCUnit article/tutorial online.

2005-10-10 Thread Michael Van Canneyt



On Sun, 9 Oct 2005, L505 wrote:


Since I don't exactly know what test frameworks are, even after reading about 
them for the
past few years, I'm going to ask some risky questions. This is not a flame 
thrower attempt
at the test framework advocates, I'm just trying to understand what exactly 
they do, from a
"newbie to test frameworks" perspective.

Do test frameworks
-cause you to spend lots of time writing test frameworks instead of program 
code?


That depends entirely on you. You should not write test frameworks for
visual aspects of your application, it will take a lot of time. But any
nonvisual code can be tested with little code.


-even apply to languages with compilers and strong typing?


Yes, of course.


-cause you to write your programs to conform to the test framework, instead of 
the program
framework?


No.


-have any actual statistics of success?


Yes.


-have popularity statistics that prove they are popular (in the Delphi 
community) as stated
in the article?


I'm not sure what you mean by this question ?


-have any real world examples of how they helped personX fix problemY in 
significantly less
time?


I personally don't, but as far as I know, for instance InstantObjects
use unit testing and in particular FPCUnit extensively to test whether
their objects code functions correctly.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPCUnit article/tutorial online.

2005-10-10 Thread Michael Van Canneyt



On Sun, 9 Oct 2005, Tony Pelton wrote:


i started to write a rather lengthy reply to this note, and realized i
was starting to rant.

so i'm gonna shorten my reply up quite a bit.

i'm a java web app programmer by trade. i use Pascal for fun stuff.

up until a couple of years ago, i went through a series of companies
where i couldn't escape the _nightmare_ of unit testing mantra, being
forced down the development teams throat ... _usually_ with a whole
helping of other ridicoulous development "paradigms" freshly read by
the manager right out of "CIO" magazine.



Your story is an example of how a 'good' technology can be ruined by
applying it too much or in an inappropriate way. Alas, this happens too
often when people who actually don't have a clue start dicating the
rules.

But that doesn't mean this technology is bad. FPC uses a testsuite
(not based on FPCunit) to test the compiler. And luckily so, because
this has helped the compiler team to eliminate bugs on many an occasion.

As in all things: use the right tools for the right job, and with moderation.

I personally wouldn't recommend using FPCunit in all cases.
The purpose of the article is to show that it is present in FPC for those who
want to use such a technology.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal