Lots of Public and Private variables - no penalties on modern PC. 
Author Message
 Lots of Public and Private variables - no penalties on modern PC.

We have converted a nice DOS application to clipper for windows application.

It consisted of 2 files of 10000 lines and some smaler .prg filies.
clipper 5.2e was used.  Many of the functions was very large.

I was told that the programs was made by a single person in a
an almost unbelivable short time - to meet some time limit.

What limited the length of the program files was "as long as
clipper debuger will show source code" .
It had only a lot of public and private variables - no other variable
types.

Snap showed that some variables was never used.

In DOS it was linked in protected mode with exospace
and in fivewin it was insisted
that only MS LINK 5.31 from 1992 should be used.

Now - this program performed as well as my own programs (with static
and local variabels linked with blinker and with no public or private
variables),
both in DOS and in Windows with fivewin.

Linktime with this old Link was acceptable so was Exospace.

Although I am the proud owner of mrDebug I dont know either
why this should not work so well or why it actualy worked very well.

Is the conclusion that in Clipper 5.2e in DOS and in Clipper 5.2e
+ fivewin in Windows you may have as many
public and private variables as you
desire - and have very large functions and programs - without any penalties ?
(On a modern PC)

Was it only in Clipper 5.20 and old PC's that static and local variables
was so much better ?

Here was a LOT of such variables and excelent performance both in
speed and apperance. Both on local modern PC and on a large net
consisting only of modern PC's.

I know all the arguments for using not to many static and prefearing
locals - but not why PUBLIC and PRIVATE if Clipper 5.2e works just
like they did IN SUMMER 87 (or better).  
Is it the speed of the modern PC and the 64 Mb memory
that achives this
result ?

Cheers
Knut

Believer of: "Dont change code that works well." and
"make code that writes code" rather than just to code"

Remember BASIC is one of the forfathers of Clipper (even if we
dont like to be told so) and only public variables was used in
young Bill's BASIC.

:x



Sat, 09 Dec 2000 03:00:00 GMT  
 Lots of Public and Private variables - no penalties on modern PC.

Knut,

FiveWin routes all Clipper memory management requests to Windows API memory
management equivalent functions.

Windows memory management is excellent, so Clipper clearly benefits from
this.

regards,

Antonio Linares
www.fivetech.com



Sat, 09 Dec 2000 03:00:00 GMT  
 Lots of Public and Private variables - no penalties on modern PC.

On Tue, 23 Jun 1998 18:57:19 +0200, "Antonio Linares"

Quote:
>Windows memory management is excellent,

Some end users running MS Office may dispute this :)

Don

"I never forget anything I remember"



Sat, 09 Dec 2000 03:00:00 GMT  
 Lots of Public and Private variables - no penalties on modern PC.


Quote:
> Is the conclusion that in Clipper 5.2e in DOS and in Clipper 5.2e +
> fivewin in Windows you may have as many public and private variables as
> you desire - and have very large functions and programs - without any
> penalties ?  (On a modern PC)

Wrong, and it has got nothing to do with the type of PC. From the Norton
Guide:

     The maximum number of public and private variables and arrays that can
     simultaneously exist in a single program is 2048.

Quote:
> Was it only in Clipper 5.20 and old PC's that static and local variables
> was so much better ?

While there is a performance gain to be had with Static/Local variables,
this isn't and never was (IMHO) the main reason for using them. I think the
main reason for using Static/Local variables over Public/Private can be
written out in one word, "maintainability".

Quote:
> Believer of: "Dont change code that works well."

This is an old and well known rule when dealing with old Clipper code, and
to be honest it has little to do with "works well" and a lot to do with
"works". Given a set of working sources that use Public/Private, unless it
is vital, the worst thing you can do is to start re-coding for
Static/Local. In general, code that uses Public/Private makes too many
assumptions about its environment, you muck with it at your own peril (yes,
that *is* the voice of experience).

Quote:
> Remember BASIC is one of the forfathers of Clipper (even if we dont like
> to be told so) and only public variables was used in young Bill's BASIC.

If you think that BASIC is "Bill's" I can see why you'd think Clipper 5.x
(the language) is a direct descendant of it. The Clipper I use today (and
have done for, oh, what, at least 5 or 6 years) owes more to Pascal, C and
Smalltalk than it does to BASIC.

--
Take a look in Hagbard's World: |     w3ng - The WWW Norton Guide reader.
http://www.acemake.com/hagbard/ |  ng2html - The NG to HTML converter.
http://www.hagbard.demon.co.uk/ |       eg - Norton Guide reader for Linux.
Free software, including........|   dgscan - DGROUP scanner for Clipper.



Sat, 09 Dec 2000 03:00:00 GMT  
 Lots of Public and Private variables - no penalties on modern PC.

Quote:

>Believer of: "Dont change code that works well." and
>"make code that writes code" rather than just to code"

So you would rather spend time writing a code-generator to generate a
required application, than actually writing the required application in a
given application programming language?    Hmmm, timescales might be
interesting!

Bri.
--

              http://www.crox.demon.co.uk/cellar/

Wow a full 50,000 records ... that's not a database, thats a card index!!



Sat, 09 Dec 2000 03:00:00 GMT  
 Lots of Public and Private variables - no penalties on modern PC.

Quote:

>Remember BASIC is one of the forfathers of Clipper (even if we
>dont like to be told so) and only public variables was used in
>young Bill's BASIC.

Since when has Clipper been a descendant of BASIC ??

Brian 'no Goto' Dukes!
--

              http://www.crox.demon.co.uk/cellar/

Wow a full 50,000 records ... that's not a database, thats a card index!!



Sat, 09 Dec 2000 03:00:00 GMT  
 Lots of Public and Private variables - no penalties on modern PC.


(Dave Pearson) wrote ( heavily edited ) :

Quote:
>The maximum number of public and private variables and arrays that can
>simultaneously exist in a single program is 2048.

Just to refresh my mind and am really courious.
2048 is more than enough for public variables if one could handle it
properly. If I am not wrong, an array can hold 4096 vars, right ?

Supposed that the 2048 maximum limit is used and each represent a
single dimension 4096-elements array. That gives us 8,388,608 public
vars then :(. I have never encountered with this junk but if I am
allowed to ask a clarification, will this configuration work ? ( IMHO,
theoritically, yes ). It might be beyond average station memory limit
but if we can pay for more mem chips which is now not too expensive ?
Can that "giant" publics swapped to EMS/XMS ? If no, what the reason
behind ?
I have so far implemented the above-said configuration but only to 1 (
yes one ) public var constituting a 4000-elements single dimension
array without any problem. Note, this "4000" far exceeds the 2048
limit as per text book. So ...

Andi Jahja



Sun, 10 Dec 2000 03:00:00 GMT  
 Lots of Public and Private variables - no penalties on modern PC.


Quote:
>>"make code that writes code" rather than just to code"
> So you would rather spend time writing a code-generator to generate a
> required application, than actually writing the required application in a
> given application programming language?    Hmmm, timescales might be
> interesting!

Some of the work of our firm is in robot technology.
The robots beeing  finit-state machines
that acts different on the same event according to their state.
From their own data
their state and incoming message with parameters or the upcoming event
they make
decissions, and acts accordingly.
Several specialised such robots do jobs in the
telecomunication field.  It is a way to construct real time programs.
The robots or should I only say "robots" speak with each other
through messeages - one is the leader.
An other of our achtivities is to make software tools for the engineers
that make these robots.

Now - we just was in final face og an other  activity in
the unix (SCO) world and learned how utilities
as SED,GREP and AWK could take one text change it -
send it to an other utility which
change it and so forth.
The Clipper preprossessor is next to none in helping doing such jobs.

I was doing  some large jobs to take some programs in one system to run
in an enchanted mode
on an other system.
It was no end to it - a lot of our programs had to be converted.

Phil at that time ended all his helpful answers with a sentence like this:
"I'll rather make code that makes code then making code myself" -
seeing this several
times a day - I started thinking:
What am I actualy doing with my editor ? - is it possible
that AWK  could do part of this ? - after that -
could a finite state machine using a template
(in UI an old clipper third party we sometimes adopt to do things .. etc).  

In the end - I put code from the one system into a line of programs
that worked on it
and in the end "just for fun" - new code was written on the screen,
as well as to disk.

I only had to start a bat file and that file started the one
program afther the other into the line of
converters.

Seeing this code running automaticly on the screen on one PC-
while I myself was working  on an other Pc with
flagship on an other type of application  - sure gave me pleasure.

That I had to change the code considerably - and manualy afterwords -
thats an other story.
I changed the tools as I got more expirience.

The job manualy to convert sevaral hundred thosasnd lines of codes -
while the sun is
shining and spring at that time arrived in Norway made me feel like a slave.
12 hours day being the usual except for Sunday.
You have to try it to understand - doing more or less the same thing
over and over again with no end in sight.

I would have thought that doing such jobs would have been the trend
in computing in
1998 - and not that all we are conserned with is to adopt our old
programs to new
Modes and looks all the time.  Not that I complain.

At the moment I again works with intranet and internet -
and discover that I have forgotten
all the little I knew about it.

I feel very little - trying to understand how to test
capasety of fivewin web and an
advantage type of web.

Will the customers be able to test this - How many calls in
bussy hour ?

What does it mean that we are using port 80 - how do we restrict our
intranet solution to be inhouse ?

obviously no. It should be some number with points in it.

In the fivewin case - we my do a better job in html files
by using clipper within html - how do we sell this to the customer?  

If asked about security - what shall we answer ?

May i be liable to a lowsuit if my web is misused by some
people entring customers web ?

The fiveweb clients - how do I use
them ?

The most fundamental question:
how do I call my fivewin web from my  netscape browser on my own Pc ?

What is the address of my fivewin web ?
Fivewin are developed very quickly these days - Documentation now cover all I
used to need - But in the intranet - internet case - I am on my own.

I dont even know enough to put forward the right questions at the moment.

I dont know anything any more - feeling low - I am reading and trying.

Our firm have more books on this subject then I will ever need to read -
but which book should I start with ?

If you ask me in a 14 days time - I might say it was fun -

Only a little thiny cheer
from
Knut - the stupid one.



Sun, 10 Dec 2000 03:00:00 GMT  
 
 [ 35 post ]  Go to page: [1] [2] [3]

 Relevant Pages 

1. Cache miss penalty in modern CPU's

2. Public\private memory variables

3. mixed PUBLIC and PRIVATE variables in NAMELIST (Compaq compilers)

4. public variable of a private type?

5. modern fp language for pc (query)

6. VERY lowlevel questions about modern PC hardware

7. time penalty with "trace variable"?

8. Private/public toggle bug

9. Are there any differences between public and private methods in VisualAge for smalltalk

10. API vs Internal vs Public vs Private in Envy/QA

11. mark as private / public

12. Public vs. Private Inheritance

 

 
Powered by phpBB® Forum Software