We are independent & ad-supported. We may earn a commission for purchases made through our links.
Advertiser Disclosure
Our website is an independent, advertising-supported platform. We provide our content free of charge to our readers, and to keep it that way, we rely on revenue generated through advertisements and affiliate partnerships. This means that when you click on certain links on our site and make a purchase, we may earn a commission. Learn more.
How We Make Money
We sustain our operations through affiliate commissions and advertising. If you click on an affiliate link and make a purchase, we may receive a commission from the merchant at no additional cost to you. We also display advertisements on our website, which help generate revenue to support our work and keep our content free for readers. Our editorial team operates independently of our advertising and affiliate partnerships to ensure that our content remains unbiased and focused on providing you with the best information and recommendations based on thorough research and honest evaluations. To remain transparent, we’ve provided a list of our current affiliate partners here.
Technology

Our Promise to you

Founded in 2002, our company has been a trusted resource for readers seeking informative and engaging content. Our dedication to quality remains unwavering—and will never change. We follow a strict editorial policy, ensuring that our content is authored by highly qualified professionals and edited by subject matter experts. This guarantees that everything we publish is objective, accurate, and trustworthy.

Over the years, we've refined our approach to cover a wide range of topics, providing readers with reliable and practical advice to enhance their knowledge and skills. That's why millions of readers turn to us each year. Join us in celebrating the joy of learning, guided by standards you can trust.

What is Literate Programming?

Malcolm Tatum
By
Updated: May 17, 2024
Views: 5,994
Share

Literate programming is a strategy that serves as an alternative to structured programming. The underlying idea behind this type of programming is to allow developers to focus more on logic and the flow of their thought processes when writing programs, rather than requiring that the programming be written in a way that is mandated by the computer where the software is intended for use. With this approach the programmer focuses more on the most logical way to write the programming so it achieves the desired result, then focuses on how to program the computer so that the software works properly.

Unlike structured programming, literate programming often makes use of common-day language combined with source code that is considered traditional. This approach makes it possible for the programmer to create macros that are descriptive and explanatory in nature, based on the though processes of the programmer. The end result is the creation of a language that effectively covers the underlying programming language with these explanatory phrases. With literate programming, the code documentation is considered equal to the code itself, rather than being subsidiary or auxiliary in nature.

Another aspect that helps to distinguish literate programming from structured programming is the way the elements of the programs interact with one another. In structured programming situations, the interaction is more vertical or hierarchical in design. With the literate approach to the programming task, the elements are thought in terms of an interwoven mosaic, in which the elements are more or less equal with one another.

Proponents of literate programming typically make the claim that this particular approach makes it necessary for programmers to articulate the thought processes that go into the program. This offers the advantage of being able to identify flaws in the logic of the programmer with more precision, and implement changes or modifications that allow the programming to operate with more precision and efficiency. In addition, the very nature of this approach helps to create a trail of documentation that makes it easier to reconstruct the logic applied to the task from beginning to end. In terms of adapting the code for specific applications by end users, this makes it easier to follow the stream of logic for the base program, and identify a point to branch off of in order to execute a specific task. From that point, the programmer can add or modify the code so that essential functions are not impaired, and the new function is easily integrated into the overall process.

Share
WiseGeek is dedicated to providing accurate and trustworthy information. We carefully select reputable sources and employ a rigorous fact-checking process to maintain the highest standards. To learn more about our commitment to accuracy, read our editorial process.
Malcolm Tatum
By Malcolm Tatum
Malcolm Tatum, a former teleconferencing industry professional, followed his passion for trivia, research, and writing to become a full-time freelance writer. He has contributed articles to a variety of print and online publications, including WiseGeek, and his work has also been featured in poetry collections, devotional anthologies, and newspapers. When not writing, Malcolm enjoys collecting vinyl records, following minor league baseball, and cycling.

Editors' Picks

Discussion Comments
By NathanG — On Jan 06, 2012

@Mammmood - I agree. It’s clear that source code is still included in the literate programming model, so what’s the point of literate programming?

You’re trying to abstract away the computer logic, all the while including the macros in your files. It doesn’t accomplish much in my opinion.

I believe that if you want to learn how to program without getting bogged down in one computer language’s syntax, then you should try instead to learn pseudo code.

Pseudo code is a natural language representation of the coding logic that you want to express. Since pseudo code is not tied to a particular language, you can learn it, then apply it across any programming language that you desire.

By Mammmood — On Jan 06, 2012

@everetra - I am a hardcore programmer myself and am familiar with tools programming environments include to make development tasks easier.

What you’ve described seems to be one such tool, but I don’t know that it’s exactly the same as literate programming. I think literate programming is a way of creating natural language expressions that convey what you want the computer to do inside of learning computer code syntax.

That’s neat in theory, I think, but at some point those natural language expressions need to be tied to a programming function or code somewhere. Somehow your programming compiler needs to understand what your terminology means.

At that point, in my opinion, it’s really not much different than standard coding; you’re going to have to get your feet wet with coding at some point.

By everetra — On Jan 05, 2012

I’ve never done any literate programming as such, but I have used tools that I think emulate the process.

In SQL Server you can use something called “packages” which are basically flowcharts that provide a high level view of a process you want performed.

The symbols in the flowcharts are not just pictures however. They are scripts. Think of them as macros. So what you do is build your flowchart to describe your “program” as it were, and then you can write scripts or use a wizard to generate scripts for you.

Then you “run” the flowchart and it steps through each phase of the process, running scripts along the way. I don’t know if this is exactly what literate programming is like, but it seems similar, because you are focusing more on the high level logical processes than you are the programming language as such.

Malcolm Tatum
Malcolm Tatum
Malcolm Tatum, a former teleconferencing industry professional, followed his passion for trivia, research, and writing...
Learn more
Share
https://www.wisegeek.net/what-is-literate-programming.htm
Copy this link
WiseGeek, in your inbox

Our latest articles, guides, and more, delivered daily.

WiseGeek, in your inbox

Our latest articles, guides, and more, delivered daily.