# Animations for answers: Would “source code” be a solution?

In many cases an animation would make an answer much clearer.

Here on Physics Meta there was already the question if it is possible to add animations to answers.

A comment suggests using animated GIF files. The (as of now) only answer is saying that the Stack Exchange team does not like adding additional JavaScript to the page (which would be required for animations not based on animated GIFs).

Unfortunately, animated GIF files do not allow user interaction (if this is useful) and longer animations would have a very large file size.

My question:

Would some kind of "source code" describing an animation be a solution?

Example:

The molecules touching the surface will pass though it with a certain probability. This probability is higher for the smaller molecules. For this reason the diffusion is faster.

The following animation, which can be viewed using the GNU Example App, shows this:

====GNUANIMATION====
====================

• WebP is apparently already almost universal. It supports animation. – Peter Mortensen Oct 4 '20 at 17:35
• @PeterMortensen I was already thinking about APNG. APNG seems to be supported by most browsers and consume less space than WebP. – Martin Rosenau Oct 4 '20 at 17:43
• APNG is a good alternative to GIF (for me its advantage is support for 24-bit colors), but it's still not interactive. – Ruslan Oct 4 '20 at 18:09
• In a few cases, a good animation might make an answer better. Sadly, I have few hopes that there will be a lot of good animations put forward. – Jon Custer Oct 5 '20 at 15:48

Animations using code are always potentially a security risk. I would imagine the development team at SE would be reluctant to open another potential attack vector set into their servers. This would be a code source and library set they do not directly control, so it is a problem. If you want to put it simply, the more more hooks you put on the wall, the more likely someone will hang something you don't want there. It's worth pointing out that the relatively simply image format standards and libraries do have to be regularly patched for security vulnerabilities. Flash animations largely fell out use because they were a constant source of such worries and Java Applets died for similar reasons. As a software developer in the past I like coding, but I am also very conscious of the security concerns source code of any kind raises. Sandboxes designed to contain these things are found to have leaks all the time, so be wary of this approach.

Animations (like images) do not parse nicely and efficiently into a search database. One of the reasons we actively discourage images of text and equations is that they cannot be searched for properly. There is also a tendency for people using images to rely on the image to tell people what the question is and omit even minimal text. Your own argument for using would suggest that people would do exactly that - post an animation and omit the vital text (and Mathjax equations).

I am particularly concerned about this last point. I am also of the opinion that e.g. two images before and after something, would be far more compact (in bandwidth terms) and just as clear (if not clearer) for explanation purposes.

Also note that if the poster needs to ask a question about some conceptual issue, it's just as likely there own confusion means they post an animation that does not clarify the issue at all. Making a post becomes as much a task focused on creating a graphic as it does about the underlying conceptual physics problem. That is a diversion from what the question asker needs to focus on.

Animations also take up space. While many people are used to and take for granted access to high speed broadband and wifi, this is not at all as widespread as it may seem to some people. Requiring (relatively) large animation files to be viewed to just read a question is going to present significant problems for many of our members. What is trivial for someone comfortable off living in a high density population center will be quite a different matter for people who regard high bandwidth telecomms as a luxury. Many people are also limited by bandwidth capping by ISPs). Animations also use up battery life on devices where that is an issue and, again, not everyone has the luxury of e.g. phones with large batteries.

So all in all I think using animations is a very bad idea.

On the other hand writing out the problem with text and mathematics may not be as flashy as an animation, but it will focus the mind of the person asking on the question they want to ask and the mathematics itself. From my own experience in university I would say that writing out my own notes was probably the number one way I learned things as I had to structure my ideas to write the notes. Just having to do this would often allow the concepts to "slot together" and give me the conceptual structure I needed.

So I think animation are not a constructive solution and as much as anything else are a diversion and resource hog.

That's my ten cents.

• To be clear, you are only talking about having the ability to directly put animations into answers, right? You aren't talking about having links to animations just like one would have links to other things in their answers? – BioPhysicist Oct 5 '20 at 10:52
• @BioPhysicist In general we discourage links to material that a question requires to make it's meaning clear. As the OP is suggest animations being used to clarify questions that would seem to make links to animations (which could go "dead" at any time) something we do not want. It also means a potential security risk to users is at the other end of a link. We do of course link to material like this now, but having a question rely on these links is the problem and the user still needs to put in enough text, equations and images (embedded) to let the question be standalone. – StephenG Oct 5 '20 at 18:05
• Right, I completely agree. I discuss this in my own answer. I don't see the issue if the answer is still a good answer without it though, just like how answers with links should still be good answers without the links. – BioPhysicist Oct 5 '20 at 18:36
• "Code" maybe is not the correct word. What I was actually thinking of was more some new image format - like an animated variant of SVG, maybe allowing a minimum of interaction. The word "code" referred to posting this image format as uuencode-like or base64-like form as long as "imgur" does not support that image format. – Martin Rosenau Oct 6 '20 at 6:46
• @MartinRosenau I suspect a new format would be even less likely to be adopted. You have significant initial development cost (time, resources, money) and no guarantee it would work out. You also have to commit to invest in maintenance on the code and you have to fix security bugs on any code you release. I would be surprised if there were not already animation formats ready to use (i.e. dedicated animation formats, not GIF or PNG). – StephenG Oct 6 '20 at 6:53

This seems fairly similar to answers that have links to other sites/resources. So I would just make sure you follow the guidelines for putting links in answers, but for the interactive animations.

Links to external resources are encouraged, but please add context around the link so your fellow users will have some idea what it is and why it’s there. Always quote the most relevant part of an important link, in case the external resource is unreachable or goes permanently offline.

Essentially, you still want your answer to be a complete answer without the animation. I would think, "If for some strange reason my animation breaks or becomes inaccessible, does this post still provide a sufficient and satisfying answer to the question?"

• You seem to have misspelled "When for some reason my animation breaks or becomes inaccessible...". – Emilio Pisanty Oct 5 '20 at 12:37
• @EmilioPisanty You're assuming code often doesn't do what you want it to do. Seems like an absurd assumption to me ;) – BioPhysicist Oct 5 '20 at 12:49
• @BioPhysicist I was a professional senior developer for many years and have been coding systems for what is now 40 years and my experience is that, at all levels of ability, professionals (me included) write code that quite often does not do what they want it to. It is, as they say, why pencils have erasers. :-) This is one reason why StackOverflow is so busy. – StephenG Oct 5 '20 at 18:43
• @StephenG Right, I was completely joking in my comment – BioPhysicist Oct 5 '20 at 19:08
• @BioPhysicist My mistake - may be time to investigate new glasses if I'm missing smileys. :-) – StephenG Oct 5 '20 at 19:09