[WEBINAR] Application Acceleration: Faster Performance for End Users

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.

Techopedia Deals

Connect with us

Techopedia on Linkedin
Techopedia on Linkedin
"Techopedia" on Twitter

Sign up for Techopedia's Free Newsletter!

Email Newsletter

Join thousands of others with our weekly newsletter

Free Whitepaper: The Path to Hybrid Cloud
Free Whitepaper: The Path to Hybrid Cloud:
The Path to Hybrid Cloud: Intelligent Bursting To Amazon Web Services & Microsoft Azure
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.