{"id":696,"date":"2016-09-09T01:51:53","date_gmt":"2016-09-09T01:51:53","guid":{"rendered":"https:\/\/blogs.mathworks.com\/developer\/?p=696"},"modified":"2016-09-09T02:14:50","modified_gmt":"2016-09-09T02:14:50","slug":"throwback-thursday-matlab-central-15-year","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/developer\/2016\/09\/09\/throwback-thursday-matlab-central-15-year\/","title":{"rendered":"Throwback Thursday: Remembering the olden times"},"content":{"rendered":"<div class=\"content\"><!--introduction--><p>You may have <a href=\"https:\/\/blogs.mathworks.com\/loren\/2016\/09\/06\/fifteen-years-of-matlab-central-memories\/\">heard<\/a> <a href=\"https:\/\/blogs.mathworks.com\/cleve\/2016\/09\/05\/the-pentium-papers-my-first-matlab-central-contribution\/\">some<\/a> <a href=\"https:\/\/blogs.mathworks.com\/pick\/2016\/08\/19\/the-oldest-file\/\">buzz<\/a> <a href=\"https:\/\/blogs.mathworks.com\/community\/2016\/08\/24\/going-way-back-with-matlab-central\/\">lately<\/a> about how MATLAB Central is celebrating its <a href=\"https:\/\/en.wikipedia.org\/wiki\/Quincea%C3%B1era\">quincea&ntilde;era<\/a>. Indeed the event is worth a fiery fiesta, and you should definitely check out all of the <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/anniversary\/\/?s_tid=gn_mlc_anni_bg\">activities MATLAB Central is hosting to celebrate<\/a>. There are games, prizes, and all sorts of shenanigans to procrastinate with. You only get one 15 year birthday, and we are trying to make it a good time.<\/p><p>Just thinking about this milestone of the MATLAB web community takes me way back to the wee beginnings of this very blog. Just think of the history! Just two days after this blog started Tom Brady got accused of deflating footballs in the <b><i>#deflategate<\/i><\/b> debacle. Sheesh, can you believe that? That seems like it only happened last year. In fact, it's amazing I know, but this blog started before any of the following events:<\/p><p><b>We obtained <a href=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/a\/a7\/Pluto-01_Stern_03_Pluto_Color_TXT.jpg\">high resolution photos<\/a> from a close encounter with Pluto.<\/b><\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/developer\/files\/y2016_Pluto.jpg\" alt=\"\"> <\/p><p><i>Image credit: Wikipedia<\/i><\/p><p><b>The Golden State Warriors had their record breaking 73-win season.<\/b><\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/developer\/files\/y2016_Steph_Curry.jpg\" alt=\"\"> <\/p><p><i>Image credit: Wikipedia<\/i><\/p><p><b>The internet went cray cray twice over on the same day due to llama drama and a little blue and black dress (yes, I was always on team blue\/black!).<\/b><\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/developer\/files\/y2016_TheDress.png\" alt=\"\"> <\/p><p><i>Image credit: Wikipedia<\/i><\/p><p><b><a href=\"https:\/\/en.wikipedia.org\/wiki\/LIGO\">LIGO<\/a> detected gravitational waves.<\/b><\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/developer\/files\/y2016_LIGO.png\" alt=\"\"> <\/p><p><i>Image credit: Wikipedia<\/i><\/p><p><b>SpaceX had an <a href=\"https:\/\/www.youtube.com\/watch?v=RPGUQySBikQ\">amazing landing<\/a> of the Falcon 9 rocket.<\/b><\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/developer\/files\/y2016_Falcon_9.jpg\" alt=\"\"> <\/p><p><i>Image credit: Wikipedia<\/i><\/p><p><b>Reality Check<\/b><\/p><p>Can you believe it has been that long?<\/p><p>OK, so maybe Developer Zone hasn't really been around that long. In dog years, MATLAB Central is 95 years older than this here humble baby of a blog. Well, if I can't reminisce about the blog, perhaps I can reminisce about MATLAB! I certainly was a MATLAB user 15 years ago. In fact I was a MATLAB user 20 years ago as it was <a href=\"https:\/\/twitter.com\/ranfordb\/status\/765190532087877632\">the first programming language I learned<\/a> as a freshman upstart in mechanical engineering. So hey, 5 years into my illustrious MATLAB career and I was designing controllers and analyzing vibrations in graduate school. That's when MATLAB Central was born.<\/p><p>When MATLAB Central started the version of MATLAB was R12. Take a look at the documentation landing page, we had a brand spankin new feature called \"The MATLAB Desktop\".<\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/developer\/files\/y2016BeginHere.png\" alt=\"\"> <\/p><!--\/introduction--><p>Speakin of, let's take a look at the desktop:<\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/developer\/files\/y2016R12Desktop.png\" alt=\"\"> <\/p><p>Wow! Takes me right back to my school days.<\/p><p>Well, given I like to highlight production software design here and there's not too much to reminisce about the history of this still young blog, I thought it would be fun to follow up on <a href=\"https:\/\/blogs.mathworks.com\/developer\/2016\/08\/08\/han-solo-encapsulation\/\">the previous post<\/a> highlighting some of the syntactic sugar that the MATLAB object system provides and take a peak back at the object system of MATLAB past. It's actually a little recognized fact that MATLAB had an object system in those days. Many people only heard of object oriented programming in MATLAB when <a href=\"\">R2008a<\/a> was released and the first version of today's loved object system was introduced.<\/p><p>But no! We did, but perhaps with just <b><i>slightly<\/i><\/b> less syntactic sugar. How much less you ask? Well, let me show you. First, let's see a simple 3 deep hierarchy of classes in today's MATLAB<\/p><pre class=\"language-matlab\">\r\n<span class=\"keyword\">classdef<\/span> MATLABCentralItem\r\n    \r\n    <span class=\"keyword\">properties<\/span>\r\n        HomeURL = <span class=\"string\">'https:\/\/www.mathworks.com\/matlabcentral\/'<\/span>;\r\n    <span class=\"keyword\">end<\/span>\r\n    \r\n<span class=\"keyword\">end<\/span>\r\n\r\n\r\n\r\n<span class=\"keyword\">classdef<\/span> MATLABCentralBlog &lt; MATLABCentralItem\r\n    \r\n    <span class=\"keyword\">properties<\/span>\r\n        Topic = <span class=\"string\">'MATLAB'<\/span>;\r\n        Author = <span class=\"string\">'Cleve'<\/span>;\r\n    <span class=\"keyword\">end<\/span>\r\n    \r\n<span class=\"keyword\">end<\/span>\r\n\r\n\r\n\r\n<span class=\"keyword\">classdef<\/span> DeveloperZone &lt; MATLABCentralBlog\r\n    \r\n    <span class=\"keyword\">properties<\/span>\r\n        LastPost = <span class=\"string\">'Encapsulated Sugar'<\/span>;\r\n    <span class=\"keyword\">end<\/span>\r\n    \r\n<span class=\"keyword\">end<\/span>\r\n\r\n<\/pre><p>OK, nice. Nothing significant. Just a few files containing some classes with just a few properties. How did we implement this 15 years ago? First let me show you the folder structure:<\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/developer\/files\/y2016OldObjectFolder.png\" alt=\"\"> <\/p><p>Three classes? Three folders. You wanna set and get properties? You gotta implement the set and get methods. How were they implemented? First lets look at the base class:<\/p><p><b>MATLABCentralItem Constructor<\/b><\/p><pre class=\"language-matlab\">\r\n<span class=\"keyword\">function<\/span> item = MATLABCentralItem\r\n\r\nitem.HomeURL = <span class=\"string\">'https:\/\/www.mathworks.com\/matlabcentral\/'<\/span>;\r\nitem = class(item, <span class=\"string\">'MATLABCentralItem'<\/span>);\r\n\r\n\r\n<\/pre><p><b>MATLABCentralItem Getter<\/b><\/p><pre class=\"language-matlab\">\r\n<span class=\"keyword\">function<\/span> value = get(item, propName)\r\n\r\n<span class=\"keyword\">switch<\/span> propName\r\n    \r\n    <span class=\"keyword\">case<\/span> <span class=\"string\">'HomeURL'<\/span>\r\n        value = item.HomeURL;\r\n    <span class=\"keyword\">otherwise<\/span> \r\n        error(<span class=\"string\">'Unknown property \"%s\".'<\/span>, propName);\r\n<span class=\"keyword\">end<\/span>\r\n\r\n<\/pre><p><b>MATLABCentralItem Setter<\/b><\/p><pre class=\"language-matlab\">\r\n<span class=\"keyword\">function<\/span> item = set(item, varargin)\r\n\r\nproperty_argin = varargin;\r\n<span class=\"keyword\">while<\/span> length(property_argin) &gt;= 2\r\n    propName = property_argin{1};\r\n    value = property_argin{2};\r\n    property_argin = property_argin(3:end);\r\n    <span class=\"keyword\">switch<\/span> propName\r\n        <span class=\"keyword\">case<\/span> <span class=\"string\">'HomeURL'<\/span>\r\n            item.HomeURL = value;\r\n        <span class=\"keyword\">otherwise<\/span>\r\n            error(<span class=\"string\">'Unknown property \"%s\".'<\/span>, propName);\r\n    <span class=\"keyword\">end<\/span>\r\n<span class=\"keyword\">end<\/span>\r\n\r\n<\/pre><p>That's looking like a lot of boiler plate. Notice we actually have to implement all of the set\/get logic ourselves. How about the first subclass?<\/p><p><b>MATLABCentralBlog Constructor<\/b><\/p><pre class=\"language-matlab\">\r\n<span class=\"keyword\">function<\/span> blog = MATLABCentralBlog\r\n\r\nsuperclassObj = MATLABCentralItem;\r\nsuperclassObj = set(superclassObj,<span class=\"string\">'HomeURL'<\/span>, <span class=\"string\">'https:\/\/blogs.mathworks.com\/'<\/span>);\r\n\r\nblog.Topic = <span class=\"string\">'MATLAB'<\/span>;\r\nblog.Author = <span class=\"string\">'Cleve'<\/span>;\r\nblog = class(blog, <span class=\"string\">'MATLABCentralBlog'<\/span>, superclassObj);\r\n\r\n\r\n<\/pre><p><b>MATLABCentralBlog Getter<\/b><\/p><pre class=\"language-matlab\">\r\n<span class=\"keyword\">function<\/span> value = get(blog, propName)\r\n\r\n<span class=\"keyword\">switch<\/span> propName\r\n    <span class=\"keyword\">case<\/span> <span class=\"string\">'Topic'<\/span>\r\n        value = blog.Topic;\r\n    <span class=\"keyword\">case<\/span> <span class=\"string\">'Author'<\/span>\r\n        value = blog.Author;\r\n    <span class=\"keyword\">case<\/span> <span class=\"string\">'HomeURL'<\/span>\r\n        value = get(blog.MATLABCentralItem, <span class=\"string\">'HomeURL'<\/span>);\r\n    <span class=\"keyword\">otherwise<\/span> \r\n        error(<span class=\"string\">'Unknown property \"%s\".'<\/span>, propName);\r\n<span class=\"keyword\">end<\/span>\r\n\r\n<\/pre><p><b>MATLABCentralBlog Setter<\/b><\/p><pre class=\"language-matlab\">\r\n<span class=\"keyword\">function<\/span> blog = set(blog, varargin)\r\n\r\nproperty_argin = varargin;\r\n<span class=\"keyword\">while<\/span> length(property_argin) &gt;= 2\r\n    propName = property_argin{1};\r\n    value = property_argin{2};\r\n    property_argin = property_argin(3:end);\r\n    <span class=\"keyword\">switch<\/span> propName\r\n        <span class=\"keyword\">case<\/span> <span class=\"string\">'Topic'<\/span>\r\n            blog.Topic = value;\r\n        <span class=\"keyword\">case<\/span> <span class=\"string\">'Author'<\/span>\r\n            blog.Author = value;\r\n        <span class=\"keyword\">case<\/span> <span class=\"string\">'HomeURL'<\/span>\r\n            blog.MATLABCentralItem = set(blog.MATLABCentralItem, <span class=\"string\">'HomeURL'<\/span>, value);\r\n        <span class=\"keyword\">otherwise<\/span>\r\n            error(<span class=\"string\">'Unknown property \"%s\".'<\/span>, propName);\r\n    <span class=\"keyword\">end<\/span>\r\n<span class=\"keyword\">end<\/span>\r\n\r\n<\/pre><p>That's not looking better. We have to reimplement all of the base class property handling too! (Before you chime in, I know there are some ways to design a system around this, but I am having fun here).<\/p><p><b>DeveloperZone Constructor<\/b><\/p><pre class=\"language-matlab\">\r\n<span class=\"keyword\">function<\/span> dZone = DeveloperZone\r\n\r\nsuperclassObj = MATLABCentralBlog;\r\nsuperclassObj = set(superclassObj, <span class=\"string\">'HomeURL'<\/span>, <span class=\"string\">'https:\/\/blogs.mathworks.com\/developer\/'<\/span>);\r\nsuperclassObj = set(superclassObj, <span class=\"string\">'Topic'<\/span>, <span class=\"string\">'Production software with MATLAB'<\/span>);\r\nsuperclassObj = set(superclassObj, <span class=\"string\">'Author'<\/span>, <span class=\"string\">'Andy'<\/span>);\r\n\r\ndZone.LastPost = <span class=\"string\">'Encapsulated Sugar'<\/span>;\r\ndZone = class(dZone, <span class=\"string\">'DeveloperZone'<\/span>, superclassObj);\r\n\r\n\r\n<\/pre><p><b>DeveloperZone Getter<\/b><\/p><pre class=\"language-matlab\">\r\n<span class=\"keyword\">function<\/span> value = get(dZone, propName)\r\n\r\n<span class=\"keyword\">switch<\/span> propName\r\n    <span class=\"keyword\">case<\/span> <span class=\"string\">'LastPost'<\/span>\r\n        value = dZone.LastPost;\r\n    <span class=\"keyword\">case<\/span> <span class=\"string\">'Topic'<\/span>\r\n        value = get(dZone.MATLABCentralBlog, <span class=\"string\">'Topic'<\/span>);\r\n    <span class=\"keyword\">case<\/span> <span class=\"string\">'Author'<\/span>\r\n        value = get(dZone.MATLABCentralBlog, <span class=\"string\">'Author'<\/span>);\r\n    <span class=\"keyword\">case<\/span> <span class=\"string\">'HomeURL'<\/span>\r\n        value = get(dZone.MATLABCentralBlog, <span class=\"string\">'HomeURL'<\/span>);\r\n    <span class=\"keyword\">otherwise<\/span> \r\n        error(<span class=\"string\">'Unknown property \"%s\".'<\/span>, propName);\r\n<span class=\"keyword\">end<\/span>\r\n\r\n<\/pre><p><b>DeveloperZone Setter<\/b><\/p><pre class=\"language-matlab\">\r\n<span class=\"keyword\">function<\/span> dZone = set(dZone, varargin)\r\n\r\nproperty_argin = varargin;\r\n<span class=\"keyword\">while<\/span> length(property_argin) &gt;= 2\r\n    propName = property_argin{1};\r\n    value = property_argin{2};\r\n    property_argin = property_argin(3:end);\r\n    <span class=\"keyword\">switch<\/span> propName\r\n        <span class=\"keyword\">case<\/span> <span class=\"string\">'LastPost'<\/span>\r\n            dZone.LastPost = value;\r\n        <span class=\"keyword\">case<\/span> <span class=\"string\">'Topic'<\/span>\r\n            dZone.MATLABCentralBlog = set(dZone.MATLABCentralBlog, <span class=\"string\">'Topic'<\/span>, value);\r\n        <span class=\"keyword\">case<\/span> <span class=\"string\">'Author'<\/span>\r\n            dZone.MATLABCentralBlog = set(dZone.MATLABCentralBlog, <span class=\"string\">'Author'<\/span>, value);\r\n        <span class=\"keyword\">case<\/span> <span class=\"string\">'HomeURL'<\/span>\r\n            dZone.MATLABCentralBlog = set(dZone.MATLABCentralBlog, <span class=\"string\">'HomeURL'<\/span>, value);\r\n        <span class=\"keyword\">otherwise<\/span>\r\n            error(<span class=\"string\">'Unknown property \"%s\".'<\/span>, propName);\r\n    <span class=\"keyword\">end<\/span>\r\n<span class=\"keyword\">end<\/span>\r\n\r\n<\/pre><p>Whew! My left hand is tired from all that copy and paste. Interestingly, when I was putting together that example I had a bug in the setters where I used <tt>length(property_argin) &gt; 2<\/tt> instead of <tt>length(property_argin) &gt;= 2<\/tt> and none of the set operations were working as a result. I am so glad all of these mechanics are just handled correctly by today's system.<\/p><p>While it is fun to look back and chuckle at our funny clothes and hairstyles (and syntaxes) from long ago, I am actually quite proud of MATLAB when looking back it this. The fact is even though this is much easier nowadays it was a big deal at that time to be able to create objects in the powerful technical computing environment of yesteryear that was MATLAB R12.  That said, boy is it a breath of fresh air to see all of the progress we have made since then.<\/p><p>Does it work?<\/p><pre class=\"codeinput\">d = DeveloperZone\r\nauthor = get(d,<span class=\"string\">'Author'<\/span>)\r\ntopic = get(d,<span class=\"string\">'Topic'<\/span>)\r\nurl = get(d,<span class=\"string\">'HomeURL'<\/span>)\r\nlastPost = get(d,<span class=\"string\">'LastPost'<\/span>)\r\n<\/pre><pre class=\"codeoutput\">\r\nd = \r\n\r\n\tDeveloperZone object: 1-by-1\r\n\r\n\r\nauthor =\r\n\r\nAndy\r\n\r\n\r\ntopic =\r\n\r\nProduction software with MATLAB\r\n\r\n\r\nurl =\r\n\r\nhttps:\/\/blogs.mathworks.com\/developer\/\r\n\r\n\r\nlastPost =\r\n\r\nEncapsulated Sugar\r\n\r\n<\/pre><p>How about setting properties?<\/p><pre class=\"codeinput\">d = set(d,<span class=\"string\">'LastPost'<\/span>,<span class=\"string\">'Throwback Thursday'<\/span>)\r\nlastPost = get(d,<span class=\"string\">'LastPost'<\/span>)\r\n<\/pre><pre class=\"codeoutput\">\r\nd = \r\n\r\n\tDeveloperZone object: 1-by-1\r\n\r\n\r\nlastPost =\r\n\r\nThrowback Thursday\r\n\r\n<\/pre><p>What's my name? Of course it works. Do I recommend that you use it for today's code? No. No, I do not.<\/p><p>Did you ever use the older style of object oriented programming? Any stories to tell? Chime in below.<\/p><p><i>Also, don't forget to head on over to <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/anniversary\/\/?s_tid=gn_mlc_anni_bg\">the celebration<\/a>, MATLAB Central will be sad if you don't show up to the party.<\/i><\/p><script language=\"JavaScript\"> <!-- \r\n    function grabCode_ce1beff81962461e9b5ec84c9f45ae6e() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='ce1beff81962461e9b5ec84c9f45ae6e ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' ce1beff81962461e9b5ec84c9f45ae6e';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        copyright = 'Copyright 2016 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add copyright line at the bottom if specified.\r\n        if (copyright.length > 0) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n\r\n        d.title = title + ' (MATLAB code)';\r\n        d.close();\r\n    }   \r\n     --> <\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_ce1beff81962461e9b5ec84c9f45ae6e()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n      the MATLAB code <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; R2016a<br><\/p><\/div><!--\r\nce1beff81962461e9b5ec84c9f45ae6e ##### SOURCE BEGIN #####\r\n%%\r\n% You may have\r\n% <https:\/\/blogs.mathworks.com\/loren\/2016\/09\/06\/fifteen-years-of-matlab-central-memories\/\r\n% heard>\r\n% <https:\/\/blogs.mathworks.com\/cleve\/2016\/09\/05\/the-pentium-papers-my-first-matlab-central-contribution\/\r\n% some> <https:\/\/blogs.mathworks.com\/pick\/2016\/08\/19\/the-oldest-file\/ buzz>\r\n% <https:\/\/blogs.mathworks.com\/community\/2016\/08\/24\/going-way-back-with-matlab-central\/\r\n% lately> about how MATLAB Central is celebrating its\r\n% <https:\/\/en.wikipedia.org\/wiki\/Quincea%C3%B1era quincea\u00c3\u00b1era>. Indeed the\r\n% event is worth a fiery fiesta, and you should definitely check out all of\r\n% the\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/anniversary\/\/?s_tid=gn_mlc_anni_bg\r\n% activities MATLAB Central is hosting to celebrate>. There are games,\r\n% prizes, and all sorts of shenanigans to procrastinate with. You only get\r\n% one 15 year birthday, and we are trying to make it a good time.\r\n%\r\n% Just thinking about this milestone of the MATLAB web\r\n% community takes me way back to the wee beginnings of this very blog.\r\n% Just think of the history! Just two days after this blog started Tom\r\n% Brady got accused of deflating footballs in the *_#deflategate_* debacle.\r\n% Sheesh, can you believe that? That seems like it only happened last year.\r\n% In fact, it's amazing I know, but this blog started before any of the\r\n% following events:\r\n% \r\n% *We obtained\r\n% <https:\/\/upload.wikimedia.org\/wikipedia\/commons\/a\/a7\/Pluto-01_Stern_03_Pluto_Color_TXT.jpg high resolution photos> from a close encounter with Pluto.*\r\n%\r\n% <<y2016_Pluto.jpg>>\r\n%\r\n% _Image credit: Wikipedia_\r\n%\r\n% *The Golden State Warriors had their record breaking 73-win season.* \r\n% \r\n% <<y2016_Steph_Curry.jpg>>\r\n%\r\n% _Image credit: Wikipedia_\r\n%\r\n% *The internet went cray cray twice over on the same day due to llama\r\n% drama and a little blue and black dress (yes, I was always on team blue\/black!).*\r\n% \r\n% <<y2016_TheDress.png>>\r\n%\r\n% _Image credit: Wikipedia_\r\n%\r\n% *<https:\/\/en.wikipedia.org\/wiki\/LIGO LIGO> detected gravitational waves.*\r\n%\r\n% <<y2016_LIGO.png>>\r\n%\r\n% _Image credit: Wikipedia_\r\n%\r\n% *SpaceX had an <https:\/\/www.youtube.com\/watch?v=RPGUQySBikQ amazing\r\n% landing> of the Falcon 9 rocket.*\r\n%\r\n% <<y2016_Falcon_9.jpg>>\r\n%\r\n% _Image credit: Wikipedia_\r\n% \r\n% *Reality Check*\r\n%\r\n% Can you believe it has been that long?\r\n%\r\n% OK, so maybe Developer Zone hasn't really been around that long. In dog\r\n% years, MATLAB Central is 95 years older than this here humble baby of a\r\n% blog. Well, if I can't reminisce about the blog, perhaps I can reminisce\r\n% about MATLAB! I certainly was a MATLAB user 15 years ago. In fact I was a\r\n% MATLAB user 20 years ago as it was\r\n% <https:\/\/twitter.com\/ranfordb\/status\/765190532087877632 the first\r\n% programming language I learned> as a freshman upstart in mechanical\r\n% engineering. So hey, 5 years into my illustrious MATLAB career and I was\r\n% designing controllers and analyzing vibrations in graduate school. That's\r\n% when MATLAB Central was born.\r\n%\r\n% When MATLAB Central started the version of MATLAB was R12. Take a look at\r\n% the documentation landing page, we had a brand spankin new feature called\r\n% \"The MATLAB Desktop\".\r\n%\r\n% <<y2016BeginHere.png>>\r\n% \r\n%% \r\n% Speakin of, let's take a look at the desktop:\r\n%\r\n% <<y2016R12Desktop.png>>\r\n%\r\n% Wow! Takes me right back to my school days.\r\n%\r\n% Well, given I like to highlight production software design here and\r\n% there's not too much to reminisce about the history of this still young\r\n% blog, I thought it would be fun to follow up on\r\n% <https:\/\/blogs.mathworks.com\/developer\/2016\/08\/08\/han-solo-encapsulation\/\r\n% the previous post> highlighting some of the syntactic sugar that the\r\n% MATLAB object system provides and take a peak back at the object system\r\n% of MATLAB past. It's actually a little recognized fact that MATLAB had an\r\n% object system in those days. Many people only heard of object oriented\r\n% programming in MATLAB when\r\n% < R2008a>\r\n% was released and the first version of today's loved object system was\r\n% introduced. \r\n%\r\n% But no! We did, but perhaps with just *_slightly_* less syntactic sugar.\r\n% How much less you ask? Well, let me show you. First, let's see a simple 3\r\n% deep hierarchy of classes in today's MATLAB\r\n%\r\n%%\r\n% <include>new_classes\/MATLABCentralItem.m<\/include>\r\n%\r\n%%\r\n% <include>new_classes\/MATLABCentralBlog.m<\/include>\r\n%\r\n%%\r\n% <include>new_classes\/DeveloperZone.m<\/include>\r\n%\r\n% OK, nice. Nothing significant. Just a few files containing some classes\r\n% with just a few properties. How did we implement this 15 years ago? First\r\n% let me show you the folder structure:\r\n%\r\n% <<y2016OldObjectFolder.png>>\r\n%\r\n% Three classes? Three folders. You wanna set and get properties? You\r\n% gotta implement the set and get methods. How were they implemented? First\r\n% lets look at the base class:\r\n%\r\n% *MATLABCentralItem Constructor*\r\n%\r\n% <include>old_classes\/@MATLABCentralItem\/MATLABCentralItem.m<\/include>\r\n%\r\n% *MATLABCentralItem Getter*\r\n%\r\n% <include>old_classes\/@MATLABCentralItem\/get.m<\/include>\r\n%\r\n% *MATLABCentralItem Setter*\r\n%\r\n% <include>old_classes\/@MATLABCentralItem\/set.m<\/include>\r\n%\r\n% That's looking like a lot of boiler plate. Notice we actually have to\r\n% implement all of the set\/get logic ourselves. How about the first\r\n% subclass?\r\n%\r\n% *MATLABCentralBlog Constructor*\r\n%\r\n% <include>old_classes\/@MATLABCentralBlog\/MATLABCentralBlog.m<\/include>\r\n%\r\n% *MATLABCentralBlog Getter*\r\n%\r\n% <include>old_classes\/@MATLABCentralBlog\/get.m<\/include>\r\n%\r\n% *MATLABCentralBlog Setter*\r\n%\r\n% <include>old_classes\/@MATLABCentralBlog\/set.m<\/include>\r\n%\r\n% That's not looking better. We have to reimplement all of the base class\r\n% property handling too! (Before you chime in, I know there are some ways\r\n% to design a system around this, but I am having fun here).\r\n%\r\n% *DeveloperZone Constructor*\r\n%\r\n% <include>old_classes\/@DeveloperZone\/DeveloperZone.m<\/include>\r\n%\r\n% *DeveloperZone Getter*\r\n%\r\n% <include>old_classes\/@DeveloperZone\/get.m<\/include>\r\n%\r\n% *DeveloperZone Setter*\r\n%\r\n% <include>old_classes\/@DeveloperZone\/set.m<\/include>\r\n%\r\n% Whew! My left hand is tired from all that copy and paste. Interestingly,\r\n% when I was putting together that example I had a bug in the setters where\r\n% I used |length(property_argin) > 2| instead of |length(property_argin) >=\r\n% 2| and none of the set operations were working as a result. I am so glad\r\n% all of these mechanics are just handled correctly by today's system. \r\n%\r\n% While it is fun to look back and chuckle at our funny clothes and\r\n% hairstyles (and syntaxes) from long ago, I am actually quite proud of\r\n% MATLAB when looking back it this. The fact is even though this is much\r\n% easier nowadays it was a big deal at that time to be able to create\r\n% objects in the powerful technical computing environment of yesteryear\r\n% that was MATLAB R12.  That said, boy is it a breath of fresh air to see\r\n% all of the progress we have made since then.\r\n%\r\n% Does it work?\r\nd = DeveloperZone\r\nauthor = get(d,'Author')\r\ntopic = get(d,'Topic')\r\nurl = get(d,'HomeURL')\r\nlastPost = get(d,'LastPost')\r\n%%\r\n% How about setting properties? \r\nd = set(d,'LastPost','Throwback Thursday')\r\nlastPost = get(d,'LastPost')\r\n\r\n%%\r\n% What's my name? Of course it works. Do I recommend that you use it for\r\n% today's code? No. No, I do not.\r\n%\r\n% Did you ever use the older style of object oriented programming? Any\r\n% stories to tell? Chime in below.\r\n%\r\n% _Also, don't forget to head on over to\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/anniversary\/\/?s_tid=gn_mlc_anni_bg\r\n% the celebration>, MATLAB Central will be sad if you don't show up to the\r\n% party._\r\n\r\n##### SOURCE END ##### ce1beff81962461e9b5ec84c9f45ae6e\r\n-->","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/developer\/files\/y2016OldObjectFolder.png\" onError=\"this.style.display ='none';\" \/><\/div><!--introduction--><p>You may have <a href=\"https:\/\/blogs.mathworks.com\/loren\/2016\/09\/06\/fifteen-years-of-matlab-central-memories\/\">heard<\/a> <a href=\"https:\/\/blogs.mathworks.com\/cleve\/2016\/09\/05\/the-pentium-papers-my-first-matlab-central-contribution\/\">some<\/a> <a href=\"https:\/\/blogs.mathworks.com\/pick\/2016\/08\/19\/the-oldest-file\/\">buzz<\/a> <a href=\"https:\/\/blogs.mathworks.com\/community\/2016\/08\/24\/going-way-back-with-matlab-central\/\">lately<\/a> about how MATLAB Central is celebrating its <a href=\"https:\/\/en.wikipedia.org\/wiki\/Quincea%C3%B1era\">quincea&ntilde;era<\/a>. Indeed the event is worth a fiery fiesta, and you should definitely check out all of the <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/anniversary\/\/?s_tid=gn_mlc_anni_bg\">activities MATLAB Central is hosting to celebrate<\/a>. There are games, prizes, and all sorts of shenanigans to procrastinate with. You only get one 15 year birthday, and we are trying to make it a good time.... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/developer\/2016\/09\/09\/throwback-thursday-matlab-central-15-year\/\">read more >><\/a><\/p>","protected":false},"author":90,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/developer\/wp-json\/wp\/v2\/posts\/696"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/developer\/wp-json\/wp\/v2\/users\/90"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/developer\/wp-json\/wp\/v2\/comments?post=696"}],"version-history":[{"count":23,"href":"https:\/\/blogs.mathworks.com\/developer\/wp-json\/wp\/v2\/posts\/696\/revisions"}],"predecessor-version":[{"id":736,"href":"https:\/\/blogs.mathworks.com\/developer\/wp-json\/wp\/v2\/posts\/696\/revisions\/736"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/developer\/wp-json\/wp\/v2\/media?parent=696"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/developer\/wp-json\/wp\/v2\/categories?post=696"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/developer\/wp-json\/wp\/v2\/tags?post=696"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}