| Hi Hannah, we're here!
My main nit on this set is the layout of command procedures.
That's my programming background and the desire for readability and
maintainability of code.
I see so many Digital-supplied command procedures that look absolutely
awful - those used by VMS in startup and elsewhere. Sorry for those
toes I'm reading on but I do feel we should set a good standard in ALL
the code we supply to our customers. Having said that the ones in this
set are easy on the eye and easily read!
Take page 2 as an example:
$ DEFINE/USER_MODE SYS$INPUT SYS$COMMAND
I would lay out thus:
$ DEFINE -
/USER_MODE -
SYS$INPUT -
SYS$COMMAND
certainly I keep one qualifier to a line. This is along the same lines
as a programming call to a procedure/function/subroutine - one argument
per source line.
Now, I'm not sure what performance implications there are for this
style of layout. There's a lot spoken and mumbled about where commment
characters should go and what blank lines and white space does for
DCL's performance. Almost cetainly these examples would start to span
two or more pages which causes irritation.
Good to see commands and qualifiers spelled out in full.
Page 3 - could we have at least one space between the "$" and the
command? User-defined symbols - could they be uppercase and
lowercase? E.g. ANS -> Ans to distinguish them from commands.
Page 4 - space again between $ and command
Page 12 - ditto
Page 17 - Guess I'm just a wet blanket when it comes to these
things but this exercise suggests that one might
leave ones terminal unattended, logged in.
Might this be dressed up as an alarm clock facility:
$ SPAWN /NOWAIT /INPUT=NL: @Alarm_clock
so the user is left at the terminal?
Still get to use the WAIT command and also provides
a reasonable use of SPAWN too.
Alternatively use CONTROL-Y handlers etc to delete
the process when someone tries to interfere - Yuk! Rather too
advanced as well.
Page 18 - I know SET TERMINAL /WIDTH=80 has the desired effect
of clearing the display but it also sets the 132 wide
screen I had before back to 80! OK its a nit!
Page 31 - Yes, modularity IS wonderful!
Generally:
Layout, upper v. lowercase symbols are my main concerns. No, concerns
is a bit strong. It's the way I would have written the code. I wonder
how LSE would have us lay out command procedures?
One thing that might be done - I was going to suggest occasionally but
that might look inconsistent - was to use local symbols for strings
like WRITE SYS$OUTPUT and Blank_line for WRITE SYS$OUTPUT ""
Hope I haven't been too hard on this section ;-)
-- Keith
|
| Hi Hannah,
My comments:
Lab. Ex. Terminal I/O
=====================
1) Try to put a few spaces between the dollarsign and the DCL-commmand, maybe
at least 7.
Start the command procedure with the label BEGIN and end with the label END.
avoid the usage of single quotes in a string.
Place blanklines to create blocks.
e.g.
$! ----------------------------------------------------------
$! NAME : WELKOM.COM
$! AUTHOR : E. JANSSEN
$! DATE-WRITTEN : 09-APR-1990
$! REASON : WELCOME on the system, for the user
$! ----------------------------------------------------------
$!
$ BEGIN:
$ ON CONTROL_Y THEN GOTO END
$ WS := WRITE SYS$OUTPUT
$ ESC[00,08] = 27
$ SAVE_MESSAGE = F$ENVIRONMENT("MESSAGE")
$ SET MESSAGE/NOFACILITY/NOSEVERITY/NOIDENTIFICATION/NOTEXT
$!
$! Call in the system time
$!
$ TIME = F$CVTIME("",,"TIME")
$!
$ IF (TIME .LTS. "12:00:00.00")
$ THEN
$ WS ESC,"[2J ''ESC'[1;1H"
$ WS ESC,"#3 Good morning ",F$GETJPI("","USERNAME")
$ WS ESC,"#4 Good morning ",F$GETJPI("","USERNAME")
$ WS " "
$ WS ESC,"#3 Welcome on ",F$GETSYI("NODENAME")
$ WS ESC,"#4 Welcome on ",F$GETSYI("NODENAME")
$ ELSE
$ WS ESC,"[2J ''ESC'[1;1H "
$ WS ESC,"#3 Good afternoon ",F$GETJPI("","USERNAME")
$ WS ESC,"#4 Good afternoon ",F$GETJPI("","USERNAME")
$ WS " "
$ WS ESC,"#3 Welcome on ",F$GETSYI("NODENAME")
$ WS ESC,"#4 Welcome on ",F$GETSYI("NODENAME")
$ ENDIF
$!
$! End procedure
$!
$ END:
$ SET MESSAGE 'SAVE_MESSAGE'
$ EXIT
Lab. Ex. Passing parameters to comm. proc's
===========================================
1) The solution on page 3 consists no spaces between the dollarsign and the
DCL-command. I miss the exit command.
Lab. Ex. Logical names
======================
1) Put $ DEASSIGN/ALL and $ DEASSIGN/PROCESS MYDIR on apart line e.g.
$ DEASSIGN/ALL
or
$ DEASSIGN/PROCESS MYDIR
Lab. Ex. Global symbols
=======================
1) I recommand to put the exercise on page 11 into the login.com, so the
student can user the symbols during the rest of the course.
2) Is the logical sys$login already clear for every student.
Lab. Ex. Debug a comm. proc.
============================
1) Place spaces after the dollarsign.
2) Change on page 12 the words "$DIRECTORY listing" into "directory listing".
3) Display the results of the run of the procedure
4) I miss the commands which has to be given for debugging the procedure
Lab. Ex. If-Then
================
1) I recommand to use the if-then-else statement as shown below:
$ IF expression
$ THEN command
$ ELSE command
$ ENDIF
2) Please spaces between $ and commands.
3) Place exercises into this chapter where the students can create command
procedures by their self. The problems with if-then-else statement will come
into existance automatically.
Lab. Ex. Terminal I/O Revisited
===============================
1) Don't give too much hints in the exercises. The student is permitted to
develop his own solution, otherwise you create a monkey.
Remove the hints on page 17:
This exercise uses terminal input etc. etc.
You is permitted to forbid to use lexicals.
2) Change the layout of the command procedure on page 18.
3) Change on page 18 BACKSOON=BACKSOON - 1 into BACKSOON = BACKSOON - 1
4) What is the reason of always using INQUIRE instead of READ/PROMPT
READ/PROMPT gives an oppertunity to handle a CTRL-Z.
5) Explain on page 18 what the usage of TYPE/PAGE NL:
6) Place single quotes outside strings.
7) Replace TYPE SYS$INPUT by WRITE SYS$OUTPUT ""
Lab. Ex. Command proc's
=======================
1) Change the layout of the command procedures with respect to spaces after the
dollarsign, blanklines, begin and end labels, single quotes in strings,
if-then-else
2) Where can I find the directory V5comproc$lex.
3) The hint (page 23) about reading the next two manuals is not necessary and is going to
far: Guide to Using VMS Command Procedures, Changing with F$VERIFY lexical
function
F$VERIFY comm. description in the VMS DCL dictionary.
The theory about procedure_verification and image_verification is too thin.
Besides the explanation in the manauls is also not very clear. So expand the
theory in the student book or skip it. By the way I think it going too far
for an adv. appl user.
Include the not modified command procedure into the text.
Lab. Ex. Errors and CTRL-Y
==========================
1) Where can I find the directory V5comproc$lex.
2) Change the layout of the command procedures with respect to spaces after the
dollarsign, blanklines, begin and end labels, single quotes in strings,
if-then-else
3) Put the = and == precisily underneath, this advances the readability of the
procedure.
4) Try to use meaningfull symbol name, e.g. PUR_ORDER instead of PO etc.
Lab. Ex. loopy logicals and subroutines
=======================================
1) Nor I could find TRANSLATE.COM.
2) What do you mean with the words "instead of using recursion".
3) The layout of the file ITERATIVE_TRANS.COM looks much better. Maybe it's
possible to place more spaces behind the dollarsign, put singel quotes
outside a string.
4) This solution (ITERATIVE_TRANS.COM) is not easy to understand, so give more
explanation at the solution.
5) Modify the layout of the file SUBROUTINE_CHOICE.COM.
6) It's not nice to jump out of a subroutine. See the subroutine TRANSLATE in
the file ITERATIVE_TRANS.COM.
7) Give also the solution for using the CALL-command.
Ed Janssen.
|