Code Commenting:- Day -01

Background

I have heard developers say I do not like to write documentation.

The documentation is in the code itself.

 

Scenario:- File Deletion

Let us review a code I am looking at this Sunday morning.

 

Original Code

Image

Image – Container

 

Image – Container

Outline

  1. Container
    • Foreach Loop Delete
      • Script Task
      • DeleteOldFiles
  2. Collection
    • Directory
      • @[User::ArchiveFile]
    • Files
      • *.txt
    • Retrieve File Name
      • Name and extension ( no )
      • Fully qualified ( yes )
      • Name only ( no )
    • Transverse subfolders
      • No

 

Revised Code

Image

Image – Container

Image – Container

Image – File System Task Editor

 

Outline

  1. Container
    • Foreach Loop Delete
      • Script Task
      • DeleteOldFiles
  2. Collection
    • Directory
      • Original
        • @[User::ArchiveFile]
      • Revised
        • @[User::ArchiveFolder]
    • Files
      • *.txt
    • Retrieve File Name
      • Name and extension ( no )
      • Fully qualified ( yes )
      • Name only ( no )
    • Transverse subfolders
      • No

 

Summary

A code block that visuals

is a bit hard to quickly read through.

If you can label it a bit, it might be a bit easier to take a quick pass through.

 

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s