Forum > Designer

"TestAll" and other removed example projects

(1/6) > >>

JuhaManninen:
This is a followup to a thread in Lazarus mailing list : Lazarus IDE 'testall' program
I do it in forum because David Bannon prefers it and I hope he will participate. He did the big revamp for the Examples window in the IDE and reorganized the example projects. I am happy this happened. The window was no good and the projects have accumulated during decades.
I am mostly a middleman here. The following is based on David's personal reply to me :

---
TestAll is mentioned in https://gitlab.com/dbannon/lazarus/-/issues/4
"TestAll - no OI and seems more a test app than a demonstration"

In https://forum.lazarus.freepascal.org/index.php/topic,57680.msg434184.html#msg43418  David raised two issues about including examples that were not really appropriate -

1. Ones that created components directly and did not use the Object Inspector
2. Ones that appeared more like test apps rather than a demonstration of how to do something specific for a user.

Several comments further down indicated that while including a few non-OI projects would help demonstrate the possibility, it was not really the purpose of this project to push such techniques.

Neither position was challenged. So, I assume, still without looking in the actual code, that TestAll was deemed unsuitable to include in the new Examples.

It may still be there as a "test" but not as an "example".

Obviously, its easily restored, just needs a metadata file made and to be merged back into main. The way the system works is any dir containing a project can be added to the example tree, easily found with a file browser but the new Examples Window will only play with it if it has a metadata file.
David would prefer Tests be filed under a Tests directory but sometimes the distinction between Tests and Examples is somewhat blurred.
---

Thaddy:
Tests as in unit tests are not very helpful as examples, they should merely test for correctness.
Examples provide - ideally close to - real world code in the sense that they should provide applicability.

The confusion arrives when 'tests' are not written in an appropriate manner, such that they are not actually tests.
Such tests should be removed or replaced with proper tests or moved to examples when applicable.

I think David is on the right track.

Things like TestAll can better be removed completely. It adds nothing. Tests should be specific, not generalized and testall is probably a misnomer.

dbannon:

Thanks Juha, Thaddy.

Yes, I can confirm that main does not have TestAll any more. It was one of those projects that was "loose" in a directory with many others, did not, to me look like a very useful Example and was, of course even named a "test".

It either predated the Object Inspector or its author, probably sensibly considering what it does, decided to just create and initialize in code. Certainly a viable way to work, I have done so myself (ie Open and Save dialogs) but it is not, in my humble opinion, generally a good Example.

Along with 8 other projects ( https://gitlab.com/dbannon/lazarus/-/issues/4 ) I thought it out of scope but easily brought back if someone wants it. From what I could see, it could do with a bit of work first ...

If it is brought back to life, it should be a Test, not an Example. If so, just how useful a test is it ?

Davo

Aruna:
Hello Juha, Thaddy and David,

'I' sent that initial email because at that time I was not aware of David's repository. Upon further investigation of David's repo under examples, I found the folder structure below.

-Beginner
-Components
-DBase
-Techniques

If I had known David was already restructuring and working on this I would not have sent out that initial email. There is no reason now to bring 'testall' back to life and it is there in branch fixes_2_2 for anyone who may want to go through the code and learn. So as far as I am concerned things are all good. I do have something else to ask all of you to give some thought to though.

When it comes to 'examples' what is to stop us from having another folder that says 'Dynamic' or 'Programmatically Created no OI' you get the idea? Some of the code in the 'testall' though definitely not welcoming for newbies does demonstrate useful techniques for more advanced users.

I am a great believer in the freedom to choose and this is one of the primary reasons I fell in love with Linux. All I am saying is what would be wrong with giving the end user browsing the code diverse options? Let them decide which way they want to go. By all means, use the IDE but also let them realize they have the freedom to do things without the OI and create everything dynamically through code. I like to think of doing this as giving the end user a complete set of available options they can use, we are not pushing anything :-)

If I was to start putting examples together for each component that effectively demonstrates how to access and use a given component's properties would that be a useful addition or not needed?

Aruna ( who is humbled on a daily basis in recent times and starting to appreciate and respect the vast amounts of lived experience, expertise and diverse communities that have contributed to Lazarus+FPC )

dbannon:

--- Quote from: Aruna on November 28, 2022, 04:06:04 am ---If I had known David was already restructuring and working on this I would not have sent out that initial email.

--- End quote ---
Well, that would have been a shame, we want and welcome all constructive input !


--- Quote from: Aruna on November 28, 2022, 04:06:04 am ---When it comes to 'examples' what is to stop us from having another folder that says 'Dynamic' or 'Programmatically Created no OI' you get the idea? Some of the code in the 'testall' though definitely not welcoming for newbies does demonstrate useful techniques for more advanced users.

--- End quote ---
There are a couple of examples still in there that do demonstrate how to make a GUI without the object Inspector, search for 'Object' and you find there is a keyword, "No Object Inspector". Its just TestAll was not one of the best Examples of that genre. Maybe "dynamic creation" is another good keyword ?  Hmm.... Dynamic Component ? Not sure ....

Can we have extra Categories ? Absolutely !  The Example Window will accept any new category you define (and thats just a case of using it as Category in a Metadata file. This rewite was really about identifying suitable Beginner projects, there were complaints that a beginner was opening the first example they found and, on average, most Examples are not beginner fodder !

The other categories exist just to make it a touch easier for people browsing.


--- Quote from: Aruna on November 28, 2022, 04:06:04 am ---If I was to start putting examples together for each component that effectively demonstrates how to access and use a given component's properties would that be a useful addition or not needed?

--- End quote ---
Not my call Aruna but my guess is if the quality is there, they would be very welcome.

I suggest you start slow, get one together, make a metadata file and try a pull request. Its a bit sad we don't see Juha quite as much here as we used to, he is very welcoming to new comers.

Davo

Navigation

[0] Message Index

[#] Next page

Go to full version