Home Up F/C Conversion Interface Design Offensive Programming Zero Defects? Code Maintainability Encapsulation Comp. Aided Disaster The Silver Bullet Clarion for Dummies DevCon 97 EuroDevcon 97

DevCon 97

Intro - Evolutionary of revolutionary

B2 available, on disks,

good news

Hello an good morning. I’m sure you’re all pleased to see that the long awaited C4 B2 has appeared at DevCon, we have all worked long and hard and I am pleased to say that I believe C4 is one of the most impressive products we have ever shipped. B2 is a long way in advance of B1, both technologically and with regard porting and ease of use.

bad news

The bad news is that we all the frenetic programming activity I have not been able to prepare a presentation. So those of you expecting Clarion 2000 a programming oddity, Clarion Trek - The degeneration or Clarion 4 - Look no pain are going to be disappointed.

Nature of talk

What I can offer you though is an under the hood look at the core technologies that make C4 revolutionary. But first let me tackle the question that seems to have confused some people, including marketing, is Clarion 4 evolutionary or revolutionary?.

And the answer is very simple. Yes. It all depends how you look at it.

But just what is a revolution. Well Professor Wheeler of Cambridge University (the man credited with the invention of the subroutine) says that to make a difference you need an order of magnitude. If something is tens times bigger, or smaller, or faster it makes a fundamental difference to the way you can work.

If you choose to use C4 with the 2.003 templates then the product is evolutionary. The file drivers are faster. Generator is faster to run and faster to use. Screener handles defaults better. The language is more complete. You can see your dictionary whilst in appgen. BUILDs needn’t lock the system. You have flat buttons and animated GIFs. The dictionary has like capabiity and date inheritance. We’ve wiped a whole raft of bugs, and being new code probably put a few in.

Port of an application

The revolution happens when you switch to the ABC templates.

So just how hard is that? Well general theory states that porting a procedural APP in C to OOPy C++ takes about as long as the original app took to write. Our aim when designing C4 was to reduce that time by 90%. So an app that took a year to write should take a month to port. And generally B1 shows exactly that kind of footprint. So it is revolutionary. The exciting thing is that with B2 we may just have revolted all over again.

I want to port the school app for you, this was written by Richard Taylor and took him around 40hrs……, now lets port it. Using P Wheelers measure ….the app was then ported life in <10 minutes (with narration)

OOP Code Structure

2.003 Structure

Ok, I hope I have proved that the ABC templates are revolutionary, know let us look at why. But first I want to remind you the way you use appgen.

Look at functionality and plug&play configurable modules. Then you press the gen button and what do you get?

Miles of code - Update people

A plate of spaghetti. And not a small plate of spaghetti but mounds and mounds of it. Let us look at UpdatePeople. This is actually a fairly simple procedure, but it has 2100 lines of code. Now let us imagine you were tracing through the code, suppose you wanted to track down why browses load 3 times rather than once. I’m told this code is readable. So let us assume you can read at 10 lines a minute, 2100 lines of code that’s 3½ hours just to read the code. And the real killer is that if you change a template prompt (say change the type of a locator) then vast chunks of those 2100 lines change, and you get to read them again.

Divided into sections

Attempts have been made to divide the code into sections, but only kinda. Let us go through and see.

Shared data

And when you do finally work out what each section is doing you will find they are fighting each other! Imagine playing a game where you write down on line of a story, fold over the piece of paper and hand it to the next person. Who writes down a line, folds the paper over and hands it back. And so on. The stories at the end tend to be a real hoot. As does the code generated using the same mechanism.

Each template writer is writing his part of a story with other people inserting lines along the way. And consider the maintenance issues. You now have to change you story to be politically correct but without changing the meaning of the whole story, which you have never seen.

This is why the CW templates stagnated, it is almost impossible to change them without giving a bug to somebody.

Core wars

Inability of 3rd parties to provide solutions that last from release to release, or that get on with each other.

What we needed was a way to allow everyone to do their job in isolation without stamping on other people. It is much the problem that computer people had 15 years ago, how to build an expandible computer. And the solution is the same, you introduce an interface.

Encapsulated

Divided into lumps

The alternative? Update people

250 lines, in itself almost o.o.m

Each lump responsible for functionality

ThisWindow is ‘running’ procedure

BRW1 is browse 1 etc

Similar idea to routines, but an interface

SELF v’s BRW3

Restricted

Space

Ability to call into interface

Documented

How easy it is to use. Well, we believe it can be very easy to use for a number of reasons. One is the interface is documented, twice. I’ll come on to why in a moment.

Naming conventions, we have very carefully tried to make our names as meaningless as possible

This is why there’s two sets of docs. The official DAB approved variety that don’t tell you anything, and the ‘implementation’ section that give you all the low-down on what really makes things tick.

Now this may all seem silly and childish. Gavin and I were once discussing some part of the CWIC base class interface and Ilka was almost crying with laughter at Gavin hammering the table and saying ‘I’m not letting you know that’.

But it all serves a very important purpose. It is almost a military tactic, what you don’t know you can’t screw up and you won’t be relying on things that change.

(Interfaces are covered in greater depth in Clarion for Schizophrenics)

Now Bruce and I literally spent weeks agonising over these words and we’ve developed a set of rules that enable you to tell an object what to do, without knowing how it does it. Lets go through the browse again and you’ll see what I mean.

Real life example

SelectState

1100 vs 40

Efficiency and code reuse

Because this is well specified an encapsulated, you only need one of them!

Auto-oop, the virtual function.

BrowsePeople

Living dictionary

Dictionary is a key feature of CW

Now moved into code

Centralization. Client server without the server.

Facts

Maillist

220K code, 23K Lines of code

66.5K code, 4.85K Lines of code

School

250K code, 27K lines of code

81K, 7.2K

The Christian Counter

Top Christian Web Sites The Fundamental Top 500