[WEBINAR] Better to Ask Permission? Best Practices for Privacy and Security

Write-Only Code

Definition - What does Write-Only Code mean?

Write-only code is a code that is difficult to read and interpret, and is therefore only understood by the code's author. Write-only code may be either poorly structured, or just a complicated written code.

Programming languages, like FORTRAN, APL, and C are fairly complex. When coding conventions are not followed, the code written in these languages becomes write-only code. Consequently, these languages are sometimes known as write-only languages.

Techopedia explains Write-Only Code

Coding conventions should be applied to prevent write only code generation, including:

  • Avoid single-letter variable names: Single letter variables, like a and b, do not define the purpose from the variable, computation, or result. Thus, only the author may interpret code containing single-letter variable names. More meaningful variable name selections are recommended.
  • Use meaningful phrases to define functions: A function printed on a screen may be named Display() or PrintScreen(). However, a name like RoutineX48() does not make sense. Thus, illogical naming practices should be avoided.
  • Variable Reuse: One of the most important defined language properties is the variable scope. Variables with identical names may exist outside relative scopes. Use variables with the same name to denote similar functions or computations. Ensure that the reused variable's scope definition does not interfere with the previous declaration.
  • Underscore: In many programming languages, a developer is not able to use space between different words when forming a variable. Underscore should be used to separate words, or each word's first letter should be capitalized to avoid write-only code.
Share this:

Connect with us

Email Newsletter

Join thousands of others with our weekly newsletter

The 4th Era of IT Infrastructure: Superconverged Systems
The 4th Era of IT Infrastructure: Superconverged Systems:
Learn the benefits and limitations of the 3 generations of IT infrastructure – siloed, converged and hyperconverged – and discover how the 4th...
Approaches and Benefits of Network Virtualization
Approaches and Benefits of Network Virtualization:
Businesses today aspire to achieve a software-defined datacenter (SDDC) to enhance business agility and reduce operational complexity. However, the...
Free E-Book: Public Cloud Guide
Free E-Book: Public Cloud Guide:
This white paper is for leaders of Operations, Engineering, or Infrastructure teams who are creating or executing an IT roadmap.
Free Tool: Virtual Health Monitor
Free Tool: Virtual Health Monitor:
Virtual Health Monitor is a free virtualization monitoring and reporting tool for VMware, Hyper-V, RHEV, and XenServer environments.
Free 30 Day Trial – Turbonomic
Free 30 Day Trial – Turbonomic:
Turbonomic delivers an autonomic platform where virtual and cloud environments self-manage in real-time to assure application performance.