Clarion Templates still producing less buggy code than AI Code Assistants!

AI assistants help developers produce code that’s insecure • The Register

Some interesting comments in the article and comments which are factually correct.

Garbage in, garbage out; the models were trained on public code bases, including all the abandoned experimental projects that were barely running at best, not debugged and sanitized.

“I hope this gets deployed. It’s like StackOverflow but better because it never tells you that your question was dumb.” ®

I thought this was an interesting comment because on the surface it sounds plausible…

If a developer uses generated code without dissecting it first, he or she is an idiot.

A competent developer will spend as long (if not longer) checking generated code as it would take to write it in the first place so I really don’t see the point. By all means use generated code for testbeds to help understand new methods but never in production code.

What alot of people dont understand about the clarion templates is its been written by a competent programmer in the first place negating the argument, and it also fails to recognise the benefit of having a structured framework which the Clarion templates also create.

And its alot harder to deploy a clarion code template in/on the wrong embed point in another clarion template when using #Where, further aiding the productivity whilst reducing the incidence of any serious bugs.

So after all these years, the Templates are still holding their own and beating AI code Assistants…

Cue some pessimistic posts… :grinning:

The shipping ABC templates have not had a thorough updating/review since introduced in…

I’ve been using the ABC templates since C5 or C5.5, so I’ve been reviewing them and updating them with my own templates since May 1998, but the ABC templates were introduced in C4 (Dec 1997).

I think Topspeed and SV have also introduced updates to the ABC templates as well, just look at the Edit In Place templates, there are two versions of that, the latter having increased functionality…

But maybe I should ask you, how exactly would you define “thorough”?

The templates get updates. There was a big update after C7 because of the compiler changes. I’ve also noted various fixes and enhancements over the years. As a framework the classes have stood the test of time. The templates are the glue to put it together.

Many environments generate - once. A big thing that Clarion has that no (few?) other environments have is the regenerate and code injection ability. As a result Clarions templates get bug fixes and enhancements just like regular code.

First thought, SQL focus, Tps becomes Legacy2.

Agree completely, but my guess is that even the great minds of old would do many things differently given an SQL focus and demands of today without needing to consider existing code. Would enjoy reading a good discussion about it.

SQL wasnt really mainstream back then, for a start you coudnt really get your hands on a free version of SQL server to develop with could you? At best I think there was a developers edition of Pervasive BTrieve but that still cost money to buy.

Of course, but IT didnt evolve by starting with how it is today. IT has evolved at considerable pace, partly because engineering technology has reached a point where we can shrink stuff, we can now even get a 1TB microsd card and I remember when a 20MB hard disk was bigger than that as I’m sure some people are alive today who remember a mainframe with less power than a smart phone took up an entire room.

So yes you are right but you are ignoring the evolution of IT including software which has forced us down paths whether we like it or not.

My reply was to your prompt for pessimistic posts, not a critique of IT evolution and how the templates have held up. In other words, pessimism for continued reliance on aging templates (plus ABC classes) and no sign of a legitimate strategy along with the financial and intellectual resources necessary for a thorough overhaul.

Last time I looked evolution didnt have a strategy either.

What makes you say this?

Lacking a statement from Z to the contrary, it seems reasonable to summarize as “No sign.”

So you want vapourware then which is one of criticisms of the IT industry and many other industry’s including politics?

And on the point of vapourware what sort of vapourware are you after exactly in order to fit this lack of strategy, financial and intellectual resources?

Apologies, but I haven’t a clue what prompts this statement. Your original post, asked for pessimism regarding the templates. I stated mine along with an interest in hearing ideas of what a thorough rewrite MIGHT bring. As far as we know, this is not an effort SV has begun and it certainly would require commitment, intellect, & finances. Sorry, that’s all I intended, nothing more, nothing less.

I was referring to the industry as a whole, which is notorious for vapourware which is perhaps why its best to just deliver stuff and not get peoples hopes up. I dont think SV have made many promises other than a trial version of sorts, but we know from the last podcast on youtube that there is a lot of coding to do with anything.

It’s worth pointing out that the clarion “code generator” doesn’t generate code. It’s a compiler. It takes input (app and dict files) and compiles them to Inc and Clw files (and indeed any text file.)

The code (app and dict) is written, and debugged, by humans. The compiler code (Tpl and Tpw) is written and debugged by humans. The quality of the code depends on the skillet of the developer.

To compare this process with AI Generated code is to compare Oranges to a bicycle. They are very different animals. AI generated code is seeing the light of day for the first time. Whereas templates benefit from the library effect - libraries are more reliable, because they are already used all over the place.

Of course all the human code can, and does, have bugs. But because this code has been reused so many times, by so many people, in so many situations, that those bugs are not evident most of the time.

Is it a compiler?

The template code will use clarion commands in Template code expressions and I dont see it creating an exe or dll.

Different animals, but both still produce/generate code as the end result and currently the Clarion templates are still producing the most reliable code.

Lets face it, what does the AI “learn” from? Code written by humans as its input and some of it happens to be not that good.

Exactly, the templates are our inputs, and its currently still the most reliable, bug free or bug lite way to generate code, because its a write once used many times situation.

Its like, I dont know why more people dont create their own templates as a 3rd party product because then they can the benefit from the code being tested in anger in more situations especially as Fuzzer’s are still not that common place or not picking up all situations.

I think that is taking a fairly broad definition of the word “compiler”.

Most people think of a compiler as software that converts from a high-level language to lower-level assembly language.

The term “transpiler” is generally used for conversion from one high level language to another. Examples in our domain would be Andrew Barnham’s Clarion2Java source converter or when SV did Clarion.NET the Clarion# code was converted to C#.

So the term “transpiler” doesn’t really fit here either.

I think given the code generator takes the specifications (the dictionary, templates and app file) and spits out clw and inc files (source code) the term “code generation” seems accurate and appropriate.

Sure it is not the same as “AI code generation” but it is still code generation. I guess you could claim it is more like a sophisticated “mail merge” program. Very sophisticated.

I’m just reading the Clarion2Java UserGuide.pdf section 3.3.3 states

Clarion2java works by transforming clarion source code into java source code.
Clarion2java then relies on maven to invisibly transform that code into java byte code.

So yeah its a transpiler to use its abbreviated name or a source to source compiler to use the wikipedia term.

another example in the Clarion world would be the legacy to ABC converter.

I like that we’re being precise about language here, because the comparison here is between two things that nominally have the same name, but are actually very different. Using the same name for them is confusing the issue.

So the clarion “generator” is a program. It takes input, process that input, and produces explicit, reproducible output. Bruce Barrington called it a “generator” because it “generates CLW’s” - but in truth it generates nothing. CLW’s are merely the output of the program. Using the word generator in this context is like say Excel “generates” XML when you save a spreadsheet. Yes, it creates XML, but purely as deterministic output.

By contrast AI Code assistants are generating new code. Code “they” write. Code they “learned” to write. Right now they fall into the camp of “just like humans, computers write buggy code”.

The original title of this thread could just as easily be written as “Clarion Templates still producing less buggy code than programmers writing hand code”. Which is simply a side effect of reusable code - code that is reused over and over again tends to be less buggy than code written once, and used once.

But if we’re going to be semantically accurate we should likely stop calling the clarion “generator” a generator. (We won’t, which is ok, it’s enough to understand that it’s not comparable to AI Code Generators.)

Most people have figured out that making 3rd party products is hard work, for little money. So rather than write another string library, try and sell it, and spend hundreds of hours to maintain it, they can simply get StringTheory for very little money, and no time invested. All the benefits, none of the work.

Creating your own templates is something more people should do, but unless those templates are widely used there’s no quality advantage to be gained. Templates are just code, and are as prone to bugs as any other code.

A template chain is a program, extension/code templates are libraries, the AppGen is an RTL, the output is a bunch of weird inconsistent looking code that compiles, despite all of the odds.