New: 77 pattern programs with tested code in C, C++, Java and Python Explore patterns

Editorial Policy

Last updated: 19 November 2026

Our goal is simple: every program on Pattern Programs should run the first time and every explanation should make sense to a beginner. This page explains how we work to make that true.

Who writes the content

Articles are written and checked by Ghanendra Yadav, who runs the site. Guest tutorials, when we publish them, show the contributor’s name and go through the same checks. Every article shows its author and the date it was last updated.

How a pattern article is made

  1. Pick the pattern, usually from reader requests, textbooks, exams and interview questions.
  2. Work out the logic: for each row, how many spaces and how many characters, written as formulas in i and n.
  3. Write the program in four languages with the same logic and the same default size (usually n = 5), so the versions can be compared line by line.
  4. Compile and run every version: C and C++ with Apple Clang 21, Java with OpenJDK 21 and Python with Python 3.15, using standard libraries only.
  5. Compare the outputs of all four languages character by character. A program is not published until all four match.
  6. Copy the real output into the article and draw the row-by-row diagram from it, so the picture always matches the code.
  7. Review the explanation for accuracy and plain language, then publish.

How we use AI tools

We use AI tools as assistants, mainly to help draft explanations and first versions of code. AI is never the final check: every program is compiled and run by us, outputs come from real runs, and the author reviews each article before it goes live. We do not publish automatically generated pages without review, and we do not create content just to rank in search engines.

Corrections and updates

  • Report a mistake through the contact form or a comment.
  • We re-run the code, fix verified errors, usually within 7 days, and update the article date.
  • If a correction changes the meaning of an article, such as a wrong output or formula, we add a short note to the article explaining what changed.
  • When new versions of the languages change behaviour, we re-test the affected programs.

Independence

We do not accept payment for articles, links or reviews. If advertising is shown, it is placed by an ad network and has no influence on what we write. Any future affiliate link or sponsorship will be clearly labelled.

Sources

Explanations are based on the official language documentation and standard textbook definitions. Where we quote or rely on another source, we link to it.

Contact

Questions about this policy or about an article: use the contact form.