• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Commenting Interactive Code

    March 7, 2012 Ted Holt

    The tips I regularly feature in this august publication deal with some aspect of source code syntax. Today I turn my attention to another part of the programming process. I want to talk about a work habit that you might find useful.

    I would say that everyone who writes any type of source code at all knows the importance of comments, but that would be incorrect. I have followed (and written) too much code that was inadequately commented. Effective comments in source code serve as a great boon to the humans who must read or modify source code. As Ashley Phix reminded all of you Aries last April, comments that tell why something is being done are more useful than those that tell what is being done.

    Today I want to point out that comments may also be useful in interactive settings. For example, suppose you are developing an SQL query. After several attempts, you may begin to confuse the various queries you’ve run, not sure which ones were successes and which ones were duds.

    You can help yourself by recording your thought process in comments as you work through your problem. Here’s an example from a green-screen SQL session. (I’ve replaced the bulk of the select statements with ellipses to make the example more succinct.)

    -- 3-7-2012, project 13774
    SQL statement empty or blank.
    -- method 1 -- use a common table expression
    SQL statement empty or blank.
    select . . .
    SELECT statement run complete.
    select . . . 
    SELECT statement run complete.
    select . . . 
    SELECT statement run complete.
    -- the last one works fine
    SQL statement empty or blank.
    -- method 2 - use a subquery
    SQL statement empty or blank.
    select . . .
    SELECT statement run complete.
    -- no good - can't select all the required fields
    

    If you have to leave a project and return to it later, the comments you make may decrease the time it takes you to get back up to speed.

    You can also write CL comments on a CL command line. The system will ignore them, but they’ll show up in the job log.

    I know of a shop that puts comments in CL commands in the Robot/SCHEDULE job scheduler. These comments include the project number, which gives the shop an audit trail in case questions arise, and document changes to the job scheduler for the benefit of IT audits. Unfortunately, the Change Job Schedule Entry (CHGJOBSCDE) command doesn’t allow comments in the CMD parameter.

    The Florida Orange Juice Growers Association claims that orange juice is not just for breakfast anymore. Maybe I should say that comments aren’t just for programs and scripts anymore.

    RELATED STORY

    Today’s Horoscope



                         Post this story to del.icio.us
                   Post this story to Digg
        Post this story to Slashdot

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    Fresche Solutions

    ON-DEMAND SESSION

    Protecting Your IBM i Systems from Ransomware and Other Cyber Threats

    Zero-day attacks and ransomware threats are on the rise and data that resides on IBM i is not immune. Now is the time to learn how to defend it.

    Join Marcel Sarrasin, CPO, Fresche and Pauline Brazil Ayala, VP of Operations, Trinity Guard as they introduce you to TGSuite, the next generation of IBM i security tools and dive into IFS and network security to help you learn how to configure the defenses on your system and guard your valuable data.

    In the session, Pauline and Marcel will discuss:

    • What a secure system looks like in 2022
    • Cybersecurity and auditing, data-level reporting and job activity monitoring
    • Advanced exit point security – knowing and managing who has access to your IBM i
    • Setting up alerts on critical security events as they happen
    • Managing all your LPARs from one centralized web console

    Watch Now!

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    BCD:  On-Demand Webinar with Bob Cozzi: 5 decision to make before a Web enablement project
    System i Developer:  Upgrade your skills at the RPG & DB2 Summit in Fort Worth, March 26-28
    COMMON:  Join us at the 2012 Conference & Expo, May 6 - 9 in Anaheim, CA

    IT Jungle Store Top Book Picks

    BACK IN STOCK: Easy Steps to Internet Programming for System i: List Price, $49.95

    The iSeries Express Web Implementer's Guide: List Price, $49.95
    The iSeries Pocket Database Guide: List Price, $59
    The iSeries Pocket SQL Guide: List Price, $59
    The iSeries Pocket WebFacing Primer: List Price, $39
    Migrating to WebSphere Express for iSeries: List Price, $49
    Getting Started with WebSphere Express for iSeries: List Price, $49
    The All-Everything Operating System: List Price, $35
    The Best Joomla! Tutorial Ever!: List Price, $19.95

    Reader Feedback On Thinking Strategically About IT As A Service IBM Does March Madness Rebate On Power 770s

    Leave a Reply Cancel reply

Volume 12, Number 5 -- March 7, 2012
THIS ISSUE SPONSORED BY:

WorksRight Software
Infor
Northeast User Groups Conference

Table of Contents

  • Commenting Interactive Code
  • Interpreted CL Members
  • Admin Alert: Getting Started With An i 6.1 Upgrade

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • Power10 Entry Machines: The Power S1024 And Power L1024
  • Thoroughly Modern: Latest IT Trends – Bring Security, Speed, And Consistency To IT With Automation
  • Big Blue Unveils New Scalable VTL For IBM i
  • As I See It: Thank God It’s Thursday
  • IBM i PTF Guide, Volume 24, Number 32
  • JD Edwards Customers Face Support Decisions
  • Security, Automation, and Cloud Top Midrange IT Priorities, Study Says
  • Cleo and SrinSoft in Integration-Modernization Link Up
  • Four Hundred Monitor, August 3
  • IBM i PTF Guide, Volume 24, Number 31

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2022 IT Jungle

loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.