惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
B
Blog RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
D
Darknet – Hacking Tools, Hacker News & Cyber Security
V2EX - 技术
V2EX - 技术
Security Archives - TechRepublic
Security Archives - TechRepublic
Cisco Talos Blog
Cisco Talos Blog
T
Tor Project blog
博客园 - 司徒正美
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
宝玉的分享
宝玉的分享
小众软件
小众软件
博客园_首页
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Project Zero
Project Zero
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Spread Privacy
Spread Privacy
I
InfoQ
博客园 - 叶小钗
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
罗磊的独立博客
M
MIT News - Artificial intelligence
爱范儿
爱范儿
The Cloudflare Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
Tenable Blog
S
Securelist
N
News and Events Feed by Topic
Simon Willison's Weblog
Simon Willison's Weblog
Webroot Blog
Webroot Blog
The Hacker News
The Hacker News
O
OpenAI News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Palo Alto Networks Blog
C
CERT Recently Published Vulnerability Notes
PCI Perspectives
PCI Perspectives
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Threat Research - Cisco Blogs
L
LINUX DO - 热门话题
I
Intezer
Scott Helme
Scott Helme
Recent Commits to openclaw:main
Recent Commits to openclaw:main
C
Cybersecurity and Infrastructure Security Agency CISA
Google Online Security Blog
Google Online Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
S
Security Affairs
AI
AI
AWS News Blog
AWS News Blog
Security Latest
Security Latest

IT Jungle

Big Blue Ships Bob 2.0 And Premium Package For IBM i - IT Jungle Your IBM i Jobs Don’t Live On An Island Anymore - IT Jungle FalconStor Creates Cloud Clean Room To Prove Backup Recoveries Work - IT Jungle Talking Git On IBM i With A Bunch Of IBM i Gits - IT Jungle IBM i PTF Guide, Volume 28, Number 22 - IT Jungle More Power Systems Price Hikes, This Time They Are "Directional" - IT Jungle AI Is Not Just For Developers, It Is For Everyone At Your Company - IT Jungle Guru: Finding Data In The Forest – Exploring Three-Part Naming In SQL - IT Jungle Former IBMer’s New Book Puts The Midrange In The Spotlight - IT Jungle Have You Tried To Buy A Server Lately? - IT Jungle GenAI Is The Death Of Deterministic Project Budgeting - IT Jungle PTC Adds Support For VS Code With Implementer 12.7 - IT Jungle Guru: Single Threading A Program Execution - IT Jungle As I See It: Push Back - IT Jungle IBM i PTF Guide, Volume 28, Number 21 - IT Jungle Progress And Frustration With IBM i Security, Fortra Finds - IT Jungle In The Trenches With: JAMS Software - IT Jungle Guru: Where’s The Table? - IT Jungle Lightedge To Start Selling IBM PowerVS to IBM i Customers - IT Jungle IBM i PTF Guide, Volume 28, Number 20 - IT Jungle Big Blue Unveils Bob Premium Pack For IBM i - IT Jungle Midrange Dynamics Sees Solid Git Adoption On IBM i - IT Jungle Guru: SQL Sequences In RPG Let Db2 Handle The Counting - IT Jungle From Green Screens To Smart Factories: Explaining DevOps To The Next Gen IBM i Developers - IT Jungle IBM i PTF Guide, Volume 28, Numbers 18 And 19 - IT Jungle Big Blue Is Still Talking About Future Power Processors, Which Is Good - IT Jungle Who To Consult With On Your Cloud Strategy, And Who To Manage It - IT Jungle Guru: DateTime Rules Of Thumb - IT Jungle i-Rays Performance Analyzer Now Ready for Prime Time, Omniology Says - IT Jungle CNX Adds AI To Valence Development Tool - IT Jungle Q&A With IBM’s New GM Of Power, Hillery Hunter - IT Jungle When IBM i Skills Become A Resilience Risk - IT Jungle Guru: Load A Varying-Dimension Array With One SQL Fetch - IT Jungle You Have To Speak IBM’s Language If You Want To Be Heard - IT Jungle Raz-Lee Revs iSecurity Suite With 2026 Updates - IT Jungle The Big Easy: Connecting The Dots On Big Blue’s AI Strategy For IBM i - IT Jungle From Migration To Maturity: The Cloud Reality For IBM i Shops - IT Jungle COMMON Dances To A Fresh New Tune In New Orleans - IT Jungle Eradani Touts Native Git Connection As AI Tools Spread - IT Jungle IBM i PTF Guide, Volume 28, Number 17 - IT Jungle Power Systems Still Waiting For The GenAI Bump - IT Jungle The IBM i and the Hybrid Cloud World: Things To Keep In Mind - IT Jungle CData Adds Db2 for i Support to CDC Tool - IT Jungle As I See It: The Cost of Having Ethics - IT Jungle Brace Yourself: Another Power Systems Price Hike Coming May 1 - IT Jungle Updates Announced for IBM i BRMS And SMTP Email Client - IT Jungle AI Will Be Front And Center At POWERUp 2026 Next Week - IT Jungle IBM i PTF Guide, Volume 28, Number 16 - IT Jungle Spring IBM i Tech Refreshes Will Come A Bit Later This Year - IT Jungle You Are Much More Than Power Systems, And So Are We - IT Jungle Startup Seeks The “Golden Path” for IBM i Modernization - IT Jungle What Can IBM Do To Make The Future Power S1112 Mini System Compelling? - IT Jungle IBM i PTF Guide, Volume 28, Number 15 - IT Jungle Bob 1.0 Users Bugged By Lack Of One Feature - IT Jungle Here Come The AI-Based Code Modernization Offerings - IT Jungle IBM Offers Trade-Ins On Storage To Grease The Upgrade Skids - IT Jungle IBM i PTF Guide, Volume 28, Number 14 - IT Jungle What IBM i Ideas Are Cooking In IBM’s Ideas Portal? - IT Jungle Early Bob Excels In Medhost IBM i Tryout - IT Jungle Counting The Cost Of AI Inference – And Projecting It Far Out - IT Jungle IBM i PTF Guide, Volume 28, Number 13 - IT Jungle The Next Generation Of IBM i Talent in GenAI Action - IT Jungle
Guru: Cohesion First – What A Procedure Should Be Responsible For - IT Jungle
Gregory Simmons · 2026-04-06 · via IT Jungle

April 6, 2026

One of the easiest mistakes to make in procedure-driven RPG is assuming that small procedures are automatically well-designed procedures. They are not. Size and cohesion are related, but they are not the same thing. A cohesive procedure has a single, clear responsibility. It exists to answer one business question or perform one business action. When a procedure tries to do more than that, it stops being a reusable building block and starts becoming a liability.

In procedural RPG, nothing enforces this discipline. There is no compiler warning when a procedure quietly takes on a second responsibility. There is no language feature that prevents a developer from adding just one more step because it happens to be convenient at the time. Over years of maintenance, those conveniences accumulate and cohesion erodes almost without notice.

If You Cannot Name It Clearly, It Is Doing Too Much

Naming is one of the most reliable cohesion tests available to an RPG developer. When a procedure name requires vague wording or starts to feel hand-wavy, that is often a sign that multiple responsibilities have been bundled together. Names like ProcessMushroomOrder or HandleMushroomInventory sound reasonable at first, but they conceal behavior rather than describe it.

Clear names force clear intent. A procedure named ValidateMushroomBatch sets an expectation. A procedure named CalculateMushroomYield tells the caller exactly what problem it solves. When naming becomes difficult, that is not a wording problem. It is a design problem.

Experienced RPG developers learn to treat naming friction as feedback rather than something to push through and ignore.

Business Actions Versus Technical Steps

Another common cohesion failure comes from mixing business logic with technical implementation details.

A procedure that determines whether a mushroom shipment meets quality standards should not also be opening files, managing commitment control, or writing audit records. Those tasks may occur as part of the same workflow, but they are not the same responsibility.

In practice, cohesive procedures tend to fall into two broad categories. Some express business intent and rules, such as determining whether a mushroom batch can be sold or calculating spoilage thresholds. Others handle technical concerns, such as reading inventory records or persisting inspection results. When those responsibilities are kept separate, procedural RPG code remains flexible and understandable. When they are mixed, every change becomes harder than it needs to be.

The Utility Procedure Trap

Utility procedures are often introduced with good intentions. A common date formatter. A reusable string cleanup routine. A helper that normalizes mushroom variety codes. Used carefully, these procedures can reduce duplication and improve consistency.

Problems arise when everything starts to look like a utility. Over time, many RPG systems accumulate service programs filled with loosely related procedures that exist simply because multiple programs needed them at some point. These service programs lack a unifying concept, and cohesion is lost at the module level even if individual procedures remain small.

Loosely purposed service programs also create fertile ground for cyclical dependencies. When a service program exists as a general collection of helpful procedures rather than a clearly defined capability, it inevitably begins to depend on other service programs that are just as loosely defined. Over time, those dependencies start to point in both directions. What begins as a convenient reuse decision, turn into service programs that present difficulties when compiling, tested, or reasoned about independently. Cyclical dependencies are not an accident. They are a structural signal that cohesion was lost earlier and never reclaimed.

A cohesive service program should represent a domain or capability, such as mushroom inventory management or quality inspection rules. When it becomes difficult to explain what a service program is responsible for in a single sentence, it has already grown beyond its useful boundaries.

Cohesion Is What Makes Reuse Safe

Low cohesion does not just make code harder to read. It makes reuse risky. When a procedure does more than its name or interface suggests, calling it in a new context becomes an act of faith. Developers begin to rely on side effects they do not fully understand, or they avoid reuse altogether and duplicate logic instead. Both outcomes slowly degrade the system.

Highly cohesive procedures behave predictably. A procedure that calculates mushroom shelf life should do exactly that and nothing more. That predictability is what allows procedure-driven RPG systems to scale over time without becoming fragile.

Cohesion Is a Daily Decision

Cohesion is not something that is designed once at the beginning of a project and then forgotten. It is a decision made every time a procedure is modified.

The moment a developer thinks, I will just add this here since I already have the mushroom data loaded, a design decision is being made. Sometimes that decision is justified. Often it is the first step toward a slow design failure that will not become obvious for years.

Procedure-driven RPG rewards developers who pause at that moment and ask a simple but uncomfortable question. Is this still the same responsibility? When the answer is no, the correct response is rarely the most convenient one. It is almost always the right one.

Until next time, happy coding.

Gregory Simmons is a Project Manager with PC Richard & Son. He started on the IBM i platform in 1994, graduated with a degree in Computer Information Systems in 1997 and has been working on the OS/400 and IBM i platform ever since. He has been a registered instructor with the IBM Academic Initiative since 2007, an IBM Champion and holds a COMMON Application Developer certification. When he’s not trying to figure out how to speed up legacy programs, he enjoys speaking at technical conferences, running, backpacking, hunting, and fishing.

RELATED STORIES

Guru: IBM i Job Log Detective Brings Structure To Job Log Analysis In VS Code

Guru: Managing The Lifecycle Of Your Service Programs – Updates Without Chaos

Guru: Are Binding Directories A Shortcut Or A Source Of Chaos?

Guru: Service Programs And Activation Groups – Design Decisions That Matter

Guru: Binder Source Is Your Service Program’s Owner’s Manual

Guru: Access Client Solutions 1.1.9.11 – Security First, With Continued Investment In SQL Tooling

Guru: Taming The CRTSRVPGM Command – Options That Can Save Your Sanity

Guru: CRTSRVPGM Parameters That Can Save or Sink You

Guru: A First Look at Bob, The IBM i Assistant That’s Closer Than You Think

Bob More Than Just A Code Assistant, IBM i Chief Architect Will Says

IBM Pulls The Curtain Back A Smidge On Project Bob

Big Blue Converges IBM i RPG And System Z COBOL Code Assistants Into “Project Bob”

Guru: When Attention Turns To You – Writing Your Own ATTN Program

Guru: WCA4i And Granite – Because You’ve Got Bigger Things To Build

Guru: When Procedure Driven RPG Really Works

Guru: Unlocking The Power Of %CONCAT And %CONCATARR In RPG

Guru: AI Pair Programming In RPG With Continue

Guru: AI Pair Programming In RPG With GitHub Copilot

Guru: RPG Receives Enumerator Operator

Guru: RPG Select Operation Gets Some Sweet Upgrades

Guru: Growing A More Productive Team With Procedure Driven RPG

Guru: With Procedure Driven RPG, Be Precise With Options(*Exact)

Guru: Testing URLs With HTTP_GET_VERBOSE

Guru: Fooling Around With SQL And RPG

Guru: Procedure Driven RPG And Adopting The Pillars Of Object-Oriented Programming

Guru: Getting Started With The Code 4 i Extension Within VS Code

Guru: Procedure Driven RPG Means Keeping Your Variables Local

Guru: Procedure Driven RPG With Linear-Main Programs

Guru: Speeding Up RPG By Reducing I/O Operations, Part 2

Guru: Speeding Up RPG By Reducing I/O Operations, Part 1

Guru: Watch Out For This Pitfall When Working With Integer Columns