I've been drilling into a lot of Matlab recently trying to interface with an in house algorithm engineer's work to modularize it for use in a test bench outside his suite of applications. I've come across several links from several different areas and concepts that connect to this undocumented MATLAB website.I've been hesitant to dive into any solutions proposed there since I've always been taught not to rely upon undocumented behavior, since well it may be deprecated and is generally subject to change. I suppose however for the sort of software that would be developed in MATLAB such implementation shake ups wouldn't bring too large of a house crumbling down to be refurbished, but I was curious is there something to the way Mathworks develops that they manage to allow so many hooks into their undocumented architectures and frameworks? What could be preventing them from formalizing these things.Just as a concrete example while researching UI layout techniques for programmatic GUI creation one of their articles made mention of this uiflowcontainer, which if you get the documentation on it you find it is undocumented.>> help uiflowcontainer  This function is undocumented and will change in a future releaseIn general I find it very curious and amusing that such a development tool has built such a following to its undocumented internals. Any thoughts on that reality? Is it foolish, crafty, or something in between?
Is there something peculiar to Matlab or Mathworks that supports so much undocumented code?
programming practices;documentation;matlab
TL;DRLeakage of implementation detail due to MATLAB .m files being shipped in source code form.Frequent changes of software requirements, features, and implementation detail.Complexity due to many different underlying dependencies, all of which suffer from the phenomenons listed here.Every complex software system (consisting of multiple architectures, layers, languages, and evolving a lot of generations over many decades) will have lots of implementation details.The reason that the undocumented functionality in MATLAB is discoverable is because:First, anything that Mathworks chooses to implement in its own MATLAB language will be shipped with the MATLAB application in source code form. This makes it possible for licensees to see its implementation detail. On the contrary, anything Mathworks chooses to implement in Java and C (MEX) will be shipped in compiled form. However, this doesn't invalidate the general engineering advice that one should depend on the documented API, not on implementation details that could change from versions to versions. Just because something is possible (visible to you) doesn't mean it's a good idea (to use it).Second, MATLAB prides itself on satisfying customer requests. Sometimes such requests require behavior changes. As a result, MATLAB has undergone many behavior changes.Sometimes, some other customers will ask for the old behavior back. For this reason, switches are provided to make all customers happy.Third, MATLAB uses a lot of existing technologies, such as the Java GUI. From versions to versions, the behavior of Java GUI also changes. Switches are needed to ensure compatibility with behavior changes inside Java GUI.