MEDITECH DR, NPR, MEDITECH Reporting, MEDITECH Reports, MEDITECH DR Reports, MEDITECH BI, MEDITECH Data Repository
I'm your host, John Sharpe, a MEDITECH Report Writing Consultant living in Spokane, WA. Read more ...
Expand your network by connecting on these social media sites:
Sign up for the MEDITECH Reports Blog; details to attend MEDITECH workshops are sent out 1 week in advance to all MEDITECH Report blog subscribers.These MEDITECH Workshops are sponsored by Donna Carroll at the MEDITECH Community Bulletin
Ascii Table: For NPR Report Writer Loop Builder: For NPR Macros Key Codes: For CDS Attributes List Builder: For NPR Macros MT Report Names: For NPR Reports MT Structure Viewer: For Physicals Strings: Format & Sort
Current Articles | RSS Feed
Today's topic is related to a recent post titled Meaningful Arrays The Easy Way which focused on improving the readability of NPR code. Reading Steve Litt's article Code Readability Throughout The Ages I had to reflect on what I've been learning in the past few weeks. I've been learning that Client Server really lends itself to code readability because you can assign values to subroutines:@ACCOUNTS.PER.USER+1^@ACCOUNTS.PER.USERACCOUNT.PER.USER/ACCOUNTS[@USER]USERIF{/USER;"SOME.OTHER.VALUE"} While MAGIC doesn't allow us to assign to subroutines, we still benefit from the use of subroutines in our efforts to improve the readability of the code.IF{@TXN.IS.CHARGE @GET.CHARGE.SECTION;" "}^/MV.TXT,@WRITE.TO.MVTXN.IS.CHARGE@BAR.PROC.type[@item.procedure]="CHG"WRITE.TO.MV/MV.TXT^/R.MV[/MV.NAME,/LINE,@FIELD],""^/MV.TXTFIELD/FN+1^/FNWithout using a single comment, the intent of the code is clear. The next programmer will be able to read and follow along with ease. Properly named subroutines are not only more readable, they're also re-usable resulting in less code. Less code ... fewer bugs. Fewer bugs ... happier customers.
Want an alert when the next post is published? Click the phone and Subscribe to the MEDITECH Reports Blog!
Allowed tags: <a> link, <b> bold, <i> italics