[Coco] Code Packing

John Donaldson johnadonaldson at sbcglobal.net
Tue Nov 13 12:51:47 EST 2012


This is C# code. What I was showing was that in the old days we used to pack 
multi-commands into one, so that we could maximize memory. So I was surprised to 
find someone had packed multi-commands into one command when today memory is not 
a problem.

JohnD




________________________________
From: Steven Hirsch <snhirsch at gmail.com>
To: CoCoList for Color Computer Enthusiasts <coco at maltedmedia.com>
Sent: Tue, November 13, 2012 7:24:05 AM
Subject: Re: [Coco] Code Packing

On Mon, 12 Nov 2012, John Donaldson wrote:

> Subject is a Class and Associates is a Model. The "a" becomes a "var" thus can
> be a string, int, boolean, etc.

I'm still not sure what point you were trying to make, but no biggee.

And, "model"?  Not familiar with that term.  Is that code in Java?

I spend my days in the engineering design automation world where 
"easy" things are Perl or Tcl and "hard" things are written in C++.

> ________________________________
> From: Steven Hirsch <snhirsch at gmail.com>
> To: CoCoList for Color Computer Enthusiasts <coco at maltedmedia.com>
> Sent: Sat, November 10, 2012 8:34:22 AM
> Subject: Re: [Coco] Code Packing
>
> On Fri, 9 Nov 2012, John Donaldson wrote:
>
>> Remember back when we would pack multi-commands into one line of code or when
>> doing string processing combine commands into one command just to save enough
>> memory to make your program load. Well I am here to tell you that code 
packing
>> is still alive and well. With memory not an issue anymore, I can not
> understand
>> why anyone would want to do code packing anymore. Here is a routine I found 
in
>> the program that I am working on at work.
>>
>> Subject.Associates.ForEach( a =>
>> {
>>         var ad = assocs[a.SubjectId];
>>         a.FirstName = ad.Firstname;
>>         a.LastName = ad.LastName;
>> });
>
> Maybe I'm missing the point, but there's no type specified for "a".  If it's 
>not
> the same type as "ad" I wouldn't expect to be able to make a full-structure
> assignment.  Even if it is the same type, I've seen languages that did not
> support structure assignment under any circumstances.


-- 


--
Coco mailing list
Coco at maltedmedia.com
http://five.pairlist.net/mailman/listinfo/coco



More information about the Coco mailing list