In a paragraph how would you sum up Templates to someone?

My interpretation is its like procedure overloading like you see in Classes or Templates.

ie
MyProc (cstring voila)
MyProc (string voila)
MyProc (long voila)
MyProc (short voila)

So where it (automatic type conversion) tripped me up, was in a filter and Alexey suggested I used
condition = 0 * 1 but I was probably using the wrong data type anyway, a decimal instead of a long or something like that for a RecordID.

The do explain it though in the help doc, its titled
Simple Assignment Data Type Conversion

Some people use Clarion in hand-code projects as well. Obviously classes can be composed into other classes as well, so that’s also “hand-code” of a sort.

correct - which is why unit tests are so useful. They help ensure the code reliability. Unit testing templates is hard, unit testing template-generated code is also hard. Whereas unit testing class methods is easier.

I think this is perhaps core to us talking past each other here. Your understanding above is incorrect, and it’s critical because Virtual methods are pretty much the only reason to use classes. (Well, ok, there are others, but Virtual Methods is like 90% of it.)

It’s a tad difficult to explain in a simple forum post - it’s one of those “light bulb” things where it makes perfect sense once you get it, but it takes forever to “get” it - and it’s really hard to help someone get it. I’ve done a couple webinars on it, but I recommend coming to a OpenClarion Wednesday webinar and I can walk through it with you.

I’m not saying you’ll change your approach, but I think you might discover that classes offer another level of usefulness. Like I said above, templates are great, classes are great, but using them together is
magic.

,Parent is useful, but it’s not the same as derived classes. They are both useful in quite different ways.

Agreed. Templates take reusable code to the next level. I’m not saying they’re bad. And you can do a lot with them. I’m just saying that doing Templates and Classes together is more than templates. That doesn’t make templates bad.

I agree. For “developers” (and I use that term non-pejoratively) Clarion lets you pick from a menu of choices and that happens very quickly. And if the menu item you want is not there, then it can be added.

1 Like

Thats what I like about language, some words convey an idea that is unquantifiable.

So lets start with the first question, what is your definition of an implicit embed point?

Its not going to be 100% identical because #Procedure is not a class, but some of the OOP properties seen in classes has been translated to the #Procedure.

You were calling them glue or special sauce, earlier.

When you are inside the class, and you make a call to a method, you get two implicit embed points there, because the derived class (as generated by the template) allows you to embed code before, and after, the parent call. So effectively you are embedding in the called method, right before, and right after the code in the method.

As an example, take the ABC TakeEvent method. As you’d expect the WindowManager class takes events and “does things with them”. But you can embed before the parent call, and after the parent call to either suppress, or supplement the event handling code.

This approach works fine in template land (the template generates the derived method with just a parent call as a “possible code”) but it also works in hand-code land - a derived class gets the ability to embed at the start of the method, at the end of the method, or replace the method completely.

Exactly. If the generic, reusable code is in a class, then the template becomes a user-interface to using that class. So you get all the benefits of OOP code (faster compiles, smaller Exe’s etc), but with the high-productivity of a template interface.

Of course all the code that’s in the class could be inside the template, and the template author can add lots and lots of embed points, but it’s fundamentally easier to create reusable code as a class / template pair rather than having everything in the template. And the end result is smaller, and compiles faster, because you’re not regenerating reusable code in every procedure.

I believe that an important part of communicating a technical concept (such as brewing, Clarion templates, astrophysics, or diesel engine mechanics) to an audience with an unknown background requires that you avoid jargon, buzzwords, assumptions that people “know what I’m talking about” (eg: “SARMs”), while also not assuming they have specific skills (eg: C++) related to the subject matter, even if they have general knowledge, such as “I code in (whatever language)”. It feels like this text is moving that direction.

Phrases like “crown jewels” and “keys to the kingdom” beg for additional explanation, eg: why are these things categorized as such?

It’s really too bad there isn’t a publicly available clarion wiki that isn’t entangled in a non-standard UI and formatting tool. This thread, once curated / edited / whatever, would make a nice entry about templates.

Well I’ll check this out once I’ve finished my class writing template and look for it.

I know that method,Virtual enables some toing and froing with a parent class but I didnt know the appgen creates embeds automatically so I’ll check that out.

The use of the word SARM’s was deliberate, its something most people wont have heard of and might well have gone and looked it up, but the “on steriods” is a phrase more commonly used.

Generally I agree, the language used needs to be stripped back to a level which is understood by a wide audience, but that audience will still be in the IT domain, and most people will be familiar with the concept of Crown Jewels thanks to Disney & other storey tellers, Royal Families and history in general so will probably understand the concept of value and importance when something is expressed as important like Crown Jewels.

I dont understand what you mean with this, are you suggesting Wikipedia isnt standard or something else?

by “Appgen” I mean templates. It’s done in the ABC templates, and for non ABC templates we use a bit of shared template code (Cape01.TPW, Cape02.TPW) which is freely available. It’s like the ABC stuff, but a touch more flexible, and works on non-ABC classes.

Given the lack of resources from SV and small chance for payback to a 3rd party vendor, it seems unlikely that the basic shipping classes & templates will ever be revised/replaced. Nevertheless, I have to believe that a new, creative approach could reinvigorate a whole community of ideas & possibilities.

Its market forces, half the problem is listening to the naysayers, I look back at some of the app’s I’ve done in the past and I should not have shelved them after listening to the naysayers but I think some people have different agenda’s, like customers not wanting to be abandoned or perceived lowered level of service ie not getting Dev Support if other products got successful. I think some of them could have been quite lucrative with hindsight.

One thing I’ve learnt there are plenty of external factors to contend with like Search Engines, social media and these are beyond out control, but I know from experience there have been some who have been planning ahead and there is always more than one way to skin a cat. :wink:

Perhaps all true. Nevertheless, we are not addressing templates/classes for the few.
Most of ABC is over 25 years old (CW 2.0 released June 1996). Dct based templates, tps files, and the desktop are all faded in the rear view mirror. The Clarion potential, however, is being taken to the SV deathbed, even with all the fantastic assisted living the community at large has provided in these twilight years.

And look at how the Internet has taken off and exposed people to much more knowledge.

Yet programming hasnt changed that much from what I have seen over the last 30 odd years, I remember when that NoSql started to appear, it got its fanbase but now some of that fanbase is falling out of love with it.

NoSQL Databases are the Problem, Not the Solution | Mind Matters
I think this sums it up well.

In short, most of what has transpired in the NoSQL movement is simply a forgetting of the reasons that we switched to relational databases to begin with.

If History doesnt repeat, it certainly rhymes and I think Clarion has a place at producing code efficiently, better than most of the stuff I’ve seen and tried, but learning the templates is a jump which everyone should make imo, certainly with hindsight, but who can predict that lightbulb moment?

I wonder how long it will be before CoPilot gives us buggy code, seems its not all that its cracked up to be and a more diverse template market could probably give CoPilot a run for its money in some arena’s.
GitHub Copilot · Your AI pair programmer

GitHub’s Copilot may steer you into dangerous waters about 40% of the time – study • The Register

Is GitHub’s Copilot Coding Autocomplete Tool Effective? (dice.com)

[2108.09293] Asleep at the Keyboard? Assessing the Security of GitHub Copilot’s Code Contributions (arxiv.org)

The same risk CoPilot exposes users to also exists in any code that is essentially cut and pasted, but at least with the Clarion Templates, its tried and tested in an “open source” like way, ie everyone can see the source and comment on it, but it costs money to enter the game unlike FOSS where any good hacker could con their hack into a repo. :crazy_face:
php.internals: Changes to Git commit workflow

Just lamenting that there isn’t a standard, well-known to the community, public repository for this sort of info - whether it’s Wikipedia or ClarionHub, or something else. Sorry - that really didnt add anything to the discussion:/

I understand the concept, but I find the actual crown jewels to be worthless. Maybe they have some historical value, but otherwise - who cares? I realize that’s a distinctly non-Brit perspective:)

I find the “keys to the kingdom” comparison equally meaningless.

To me, the WHY is what’s important. Why is this feature or that feature considered the “crown jewels” or the “keys to the kingdom”? Does that mean that (like the crown jewels) these features are worthless except for their historical value? I doubt that was the intention :slight_smile:

Not trying to be difficult here. I see comparisons to terms that dont convey a reasonably specific value or meaning, rather than some specifics that indicate why a particular feature is hugely valuable. This would seem important, particularly when trying to sell the idea to someone who isnt a Clarion insider.

It is a fairly universal concept though, which I think plenty of people will understand, however I couldnt use something like “Templates are like the Fort Knox of the Toolset” because a) there isnt any gold left in Fort Knox and b) most people dont know what Fort Knox is, ergo, Fort Knox hasnt conveyed the concept of value or importance.

I cant use Religions because that causes too many disagreements, so what else would you suggest I use to convey the concept of importance and value? :wink:

The other problem I didnt want to get too buried in is detail, Templates, a word many are familiar with will generate an idea or concept in the mind without getting into the details of what is a template. It could be briefly described as a cookie cutter but in the programming sense most people will assume there is more to it. Its got to be enough to whet the appetite but not too detailed to bore the pants of the reader, it is after all the opening paragraph.

There isnt really anything else I could use, I cant use a comparison to a rival product, thats shooting oneself in the foot, and pretty much anything else is going to be branded in some way which then causes all sorts of legal issues with copyright and things like that.

I know you like your Cadbury’s Milk Chocolate, but other’s prefer Hershey’s, so you see I couldnt really use anything else.

One thought I had was to put the Templates into a GitHub repository and have an open source type effort to improve them.

I see this mainly for the Legacy Templates in which I have a lot of code. I also see Legacy as changed less, simpler and self contained. To do this for ABC would often require joint modificatons of the ABC classes which complicates things. Now that AnyScreen is in the picture this seems less likely as AS does require some template mods.

Examples:
The way Legacy generates code for Browse Column Colors is verbose and poor. I would change the code to “Calculate the Color” and store it in a variable, then do one assignment. An embed between those 2 would allow overriding the template color logic. Many times it would be easier to enter the logic as code in the Embed rather than via Template data entry.

Often run into small bugs that are easy to fix: The View Form template did not handle TEXT CHECK OPTION or SPIN. The Process and Report templates should look at the Driver of the Primary file and decide if it supports Records() else use Bytes() for the Progress bar.

What I wrote about here (editing the templates) Use Update Form to confirm Delete instead of Message - #3 by anon23294430

is something that I do.

Standardising the controls so things like all buttons are 12 or 14px high instead of a mish mash would be a start, some have icon’s some dont, justification is another.

I dont know what SV would say about having the templates in a Github repo, would these be on public display or something, I’ve not used Github so dont know how it work?

But like you say, there are area’s of improvement which could be made.
Accessing Exported Classes from a DLL is another area I would look at from a security perspective because its not like the Classes cant be used to bypass any security built into an app or be used to get into a database. Demystifying Shims - or - Using the App Compat Toolkit to make your old stuff work with your new stuff - Microsoft Tech Community

At least any potential hacker would have had to reverse engineer the dll (made easy with GitHub - NationalSecurityAgency/ghidra: Ghidra is a software reverse engineering (SRE) framework) to get at the code and thus into any database, and hackers love databases or exposing people very much like a media exclusive.

Security is something which needs to be taken seriously imo.

How to see if your data is being sold on the ‘dark web’ (telegraph.co.uk)

State of Cybersecurity Industry Exposure at Dark Web | ImmuniWeb Security Blog

“97% of the leading cybersecurity companies have had their data exposed on the Dark Web in 2020, with over 160,000 high or critical incidents that may jeopardize their clients.
This is a copyrighted material. Any usage must mention ImmuniWeb with a backlink:
© 2022 ImmuniWeb”

Dark Web Price Index 2021 - Dark Web Prices of Personal Data (privacyaffairs.com)

That’s exactly the challenge:)

Even Google doesnt know! :rofl:

https://bfy.tw/T379

Might be helpful for Legacy, but does little for Clarion looking forward.

Most relevant to the thread topic is for templates to enable easy implementation of classes.
However, a rethinking of the critical base classes first seems necessary to allow and easily take advantage of what is current. SV has been riding the intellect of the Topspeed Chapman/DAB era for a LONG time. I wonder what those folks might come up if given the task today? On the other hand, I have to believe there are like minded, younger folks around too. Unfortunately, there is little evidence to suggest that SV will be leading the search to find them, let alone providing outcome guidance.

This is very straight-forward to do today using the freely available cape01.tpw and cape02.tpw.
I’ve used them a few times in webinars now - enough to see how to use them - which isn’t hard. Documentation for use is inside cape01.tpw, and the Reflection Class product (free) makes a good example of using them.