[Info-vax] VSI: "Official 8.4-1H1 Launch"

Stephen Hoffman seaohveh at hoffmanlabs.invalid
Mon Jun 15 18:28:05 EDT 2015


On 2015-06-15 21:55:59 +0000, David Froble said:

> Well, coding is what we do, right?

Yes.  Preferably we're all making improvements that mean we're using 
less code, too.

> My only problems with item lists are first wrapping my mind around the 
> concept, and that's not too hard.  The worst problem was the declining 
> standards for documentation that accompanied VMS's adoption of C as a 
> System Programming language.
> 
> As for coding, I had little problem with item lists in Basic.  The 
> RECORD construct is rather flexible and powerful.

That's true.  But you're not using assembler here, probably because 
having fewer lines of code is easier to write and to troubleshoot and 
to maintain than a solution with more lines of code.

Though the code itself is easy, the C and BASIC sequences for a system 
service call are still much more code than is necessary.

For instance, the following returns a list (an array, technically) of 
the various host names associated with your current computer:

NSArray *hostNames = [[NSHost currentHost] names];

or to get a string containing the primary host name with the following:

NSString *hostName = [[NSHost currentHost] name];

Technically, that stuff can get even shorter using what's called dot 
notation.  The following is a full command-line program that prints out 
all of the local host names, and exits.

#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
    @autoreleasepool {
        NSLog(@"%@", NSHost.currentHost.names);
    }
}

This is a whole lot less code than what's available on OpenVMS to 
retrieve that same data, as an example.  Sure, this means we 
programmers then push this stuff down into a local subroutine or a 
local subroutine library, and pretty soon we have an extensive library 
of features and calls that we're maintaining.  (I've open-sourced some 
of that glue code, as have some other folks.  But I digress.)  Much 
like moving from Macro32 to BASIC, it'd be better if we were rid of our 
existing morass of glue code, as that'd lower the cost for new users, 
and even for us folks with existing libraries and tools.







-- 
Pure Personal Opinion | HoffmanLabs LLC




More information about the Info-vax mailing list