How to create a Minimal, Reproducible Example … for VistA

39 views
Skip to first unread message

David Whitten

unread,
Jun 14, 2024, 2:03:00 PMJun 14
to Hard Hats Mailing List
I was reading (reproduced below my signature)
https://stackoverflow.com/help/minimal-reproducible-example

How would we modify this to capture enough information for a VistA example ?

Dave Whitten

How to create a Minimal, Reproducible Example

When asking a debugging question, people will be better able to provide help if you provide code as textin your question that prospective answerers can easily understand and use to reproduce the problem.

This is variously referred to as creating a "minimal, reproducible example" (MRE), a "minimal, complete and verifiable example" (MCVE), a "minimal, workable example" (MWE), or a "reprex". Regardless of how it's communicated to you, it boils down to ensuring you have included code in your question that follows the following guidelines:

Your code examples should be…

  • Minimal: Use as little code as possible that still produces the same problem
  • Complete: Provide all parts someone else needs to reproduce your problem in the question itself
  • Reproducible: Test the code you're about to provide to make sure it reproduces the problem

The rest of this help article provides guidance on these aspects of writing a minimal, reproducible example.

For more information on how to debug your program so that you can create a minimal example, Eric Lippert has written a fantastic blog post on the subject: How to debug small programs.

Minimal

The more code there is to go through, the less likely people can find your problem. Streamline your example in one of two ways:

  1. Restart from scratch. Create a new program, adding in only what is needed to see the problem. Use simple, descriptive names for functions and variables – don’t copy the names you’re using in your existing code.
  2. Divide and conquer. If you’re not sure what the source of the problem is, start removing code a bit at a time until the problem disappears – then add the last part back.

…but still readable

Don't sacrifice clarity for brevity when creating a minimal example. Use consistent naming and indentation, and include code comments if needed. Use your code editor’s shortcut for formatting code. Also, use spaces instead of tabs, as tabs usually are not correctly formatted on Stack Overflow, particularly for indenting.

Complete

Make sure all information necessary to reproduce the problem is included as text in the question itself:

  • DO NOT use images of code. Copy the actual text from your code editor, paste it into the question, then format it as code.

  • Use individual code blocks for each file or snippet you include. Provide a description for the purpose of each block.

  • If the problem requires some server-side code as well as some XML-based configuration, include code for both. If a web page problem requires HTML, some styles, and some JavaScript, include code for all three. The problem might not be in the code that you think it is in.

  • If you are using HTML, CSS, and/or JavaScript, you can use Stack Snippets to include runnablesnippet instead of just a static code block.

Reproducible

To help you solve your problem, others will need to verify that it exists:

  • Describe the problem. "It doesn't work" isn't descriptive enough to help people understand your problem. Instead, tell other readers what the expected behavior should be. Tell other readers what the exact wording of the error message is, and which line of code is producing it. Use a brief but descriptive summary of your problem as the title of your question.

  • Eliminate any issues that aren't relevant to the problem. If your question isn’t about a compiler error, ensure that there are no compile-time errors. Use a program such as JSLint to validate interpreted languages. Validate any HTML or XML.

  • Double-check that your example reproduces the problem! If you inadvertently fixed the problem while composing the example but didn't test it again, you'd want to know that before asking someone else to help.

It might help to shut the system down and restart it, or transport the example to a fresh environment to confirm it really does provide an example of the problem.

Nancy Anthracite

unread,
Jun 14, 2024, 2:50:55 PMJun 14
to Hard Hats Mailing List, hard...@googlegroups.com, David Whitten
What sort of example are you wanting to make?

--
Nancy Anthracite

On Friday, June 14, 2024 2:02:52 PM EDT David Whitten wrote:
> I was reading (reproduced below my signature)
> https://stackoverflow.com/help/minimal-reproducible-example
>
> How would we modify this to capture enough information for a VistA example ?
>
> Dave Whitten
> 713-870-3834
>
> How to create a Minimal, Reproducible Example
>
> When asking a debugging question, people will be better able to provide
> help if you provide code as text <https://meta.stackoverflow.com/q/285551>*in
> your question* that prospective answerers can easily understand and use to
> reproduce the problem.
>
> This is variously referred to as creating a "minimal, reproducible example"
> (MRE), a "minimal, complete and verifiable example" (MCVE), a "minimal,
> workable example" (MWE), or a "reprex"
> <https://reprex.tidyverse.org/articles/learn-reprex.html>. Regardless of
> how it's communicated to you, it boils down to ensuring you have included
> code in your question that follows the following guidelines:
>
> Your code examples should be…
>
> - Minimal: Use as little code as possible that still produces the same
> problem
> - Complete: Provide all parts someone else needs to reproduce your
> problem in the question itself
> - Reproducible: Test the code you're about to provide to make sure it
> reproduces the problem
>
> The rest of this help article provides guidance on these aspects of writing
> a minimal, reproducible example.
>
> For more information on how to debug your program so that you can create a
> minimal example, Eric Lippert
> <https://stackoverflow.com/users/88656/eric-lippert> has written a
> fantastic blog post on the subject: How to debug small programs
> <https://ericlippert.com/2014/03/05/how-to-debug-small-programs/>.
> Minimal
>
> The more code there is to go through, the less likely people can find your
> problem. Streamline your example in one of two ways:
>
> 1. *Restart from scratch.* Create a new program, adding in only what is
> needed to see the problem. Use simple, descriptive names for functions
and
> variables – don’t copy the names you’re using in your existing code.
> 2. *Divide and conquer.* If you’re not sure what the source of the
> problem is, start removing code a bit at a time until the problem
> disappears – then add the last part back.
>
> …but still readable
>
> Don't sacrifice clarity for brevity when creating a minimal example. Use
> consistent naming and indentation, and include code comments if needed. Use
> your code editor’s shortcut for formatting code. Also, use *spaces instead
> of tabs*, as tabs usually are not correctly formatted on Stack Overflow,
> particularly for indenting.
> Complete
>
> Make sure all information necessary to reproduce the problem is included as
> text *in the question itself:*
>
> -
>
> *DO NOT* use images of code <https://meta.stackoverflow.com/q/285551>.
> Copy the actual text from your code editor, paste it into the question,
> then format it as code <https://stackoverflow.com/editing-help#code>.
> -
>
> Use individual *code blocks
> <https://stackoverflow.com/editing-help#code>* for each file or snippet
> you include. Provide a description for the purpose of each block.
> -
>
> If the problem requires some server-side code as well as some XML-based
> configuration, *include code for both*. If a web page problem requires
> HTML, some styles, and some JavaScript, *include code for all three*.
> The problem might not be in the code that you think it is in.
> -
>
> If you are using HTML, CSS, and/or JavaScript, you can use *Stack
> Snippets
> <https://meta.stackoverflow.com/questions/358992/ive-been-told-to-create-a-runnable-example-with-stack-snippets-how-do-i-do>*
> to
> include runnablesnippet instead of just a static code block.
>
> Reproducible
>
> To help you solve your problem, others will need to verify that it exists:
>
> -
>
> *Describe the problem.* "It doesn't work" isn't descriptive enough to
> help people understand your problem. Instead, tell other readers what the
> expected behavior should be. Tell other readers what the exact wording of
> the error message is, and which line of code is producing it. Use a brief
> but descriptive summary of your problem as the title of your question.
> -
>
> *Eliminate any issues that aren't relevant to the problem.* If your
> question isn’t about a compiler error, ensure that there are no
> compile-time errors. Use a program such as JSLint
> <https://www.jslint.com/> to validate interpreted languages. Validate
> <https://validator.w3.org/> any HTML or XML.
> -
>
> *Double-check that your example reproduces the problem!* If you

Benjamin Irwin

unread,
Jun 14, 2024, 3:03:41 PMJun 14
to Hardhats
I think he might be talking about my recent post about my FileMan only with Print.

David Whitten

unread,
Jun 14, 2024, 6:37:38 PMJun 14
to hard...@googlegroups.com
I did think of that, but I was mostly thinking about a page for
http://www.vistapedia.net/

Dave Whitten
713-870-3834
> --
> --
> http://groups.google.com/group/Hardhats
> To unsubscribe, send email to Hardhats+u...@googlegroups.com
>
> ---
> You received this message because you are subscribed to the Google Groups "Hardhats" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to hardhats+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/hardhats/e420034c-5ae4-4386-8f91-bf6bf9f733ccn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages