<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Matthew Fisher on Medium]]></title>
        <description><![CDATA[Stories by Matthew Fisher on Medium]]></description>
        <link>https://medium.com/@matthewericfisher?source=rss-b0b5aa0ba470------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*TaEotHlSCzEWYJPqZywqjA.png</url>
            <title>Stories by Matthew Fisher on Medium</title>
            <link>https://medium.com/@matthewericfisher?source=rss-b0b5aa0ba470------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 11:41:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@matthewericfisher/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Memory leaks in C/C++]]></title>
            <link>https://medium.com/@matthewericfisher/memory-leaks-in-c-c-82782f32983e?source=rss-b0b5aa0ba470------2</link>
            <guid isPermaLink="false">https://medium.com/p/82782f32983e</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[c]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Matthew Fisher]]></dc:creator>
            <pubDate>Tue, 02 Aug 2016 15:03:13 GMT</pubDate>
            <atom:updated>2016-08-02T15:03:13.348Z</atom:updated>
            <content:encoded><![CDATA[<p>C and C++ have a serious flaw in heap management. The whole concept of programmer driven, globally managed heap is broken. The design of malloc libraries have lead to countless hours of debugging and billions of dollars of loses. Random heap corruption is the worst issue but Memory Leaks are a major irritant as well.</p><p>Before digging in, lets define the parts. The heap is a large block of memory that may be used dynamically during a process lifetime. Allocations in the heap are variable sized and may be non-sequential. Unlike the stack, the heap may become fragmented as interior blocks are deallocated.</p><p>In C, blocks in the heap are allocated with the malloc library. The ‘new’ in C++ function is typically a wrapper on malloc with some additional code to call the constructor. The allocation strategy is actually fine. The compiler handles the details so it is hard to screw up a call to malloc/new.</p><p>A memory leak occurs when the last pointer to a block in the heap is lost before free or delete is called. Overtime, a leak will cause a program to run out of memory and/or start page swapping. Leaks can be very hard to find as there is no immediate consequence.</p><p>A big problem is ownership. When a block is allocated, the programmer must understand the deallocation strategy. This maxim must be true every time. Memory Leaks are generally created when this rule is broken. If ownership is unclear then the block will be leaked or worst deallocated twice.</p><p><strong>Understanding pointer ownership is the key to avoiding memory leaks. </strong>There are several cases for ownership, lets review them.</p><p>‘In function’ ownership is the simplest. The programmer just needs to call the delete at the end of the function/method.</p><p>int foo()</p><p>{</p><p>Object* obj = new Object();</p><p>// other stuff …</p><p>delete obj;</p><p>}</p><p>Loop ownership gets a bit more complicated. In the fragment below a leak will occur when an error is encountered.</p><p>int foo()</p><p>{</p><p>Object * obj = NULL;</p><p>while (true)</p><p>{</p><p>obj = new Object;</p><p>…</p><p>if(error)</p><p>break;</p><p>delete obj;</p><p>}</p><p>Return value ownership can be more complicated. The value can be returned via parameter or return value.</p><p>Object * foo(Object* &amp; returnObj)</p><p>{</p><p>Object* obj = new Object();</p><p>returnObj = new Object();</p><p>return obj;</p><p>}</p><p>void main()</p><p>…</p><p>Object * otherObj = NULL;</p><p>Object* localObj = foo(otherObj);</p><p>…</p><p>return; // both objects leaked</p><p>In both of these cases, the ‘main’ function must deallocate the objects at some point. This case is probably the most common cause of leaks. Oftentimes the function is in a library and the programmer doesn’t clearly understand the ownership situation.</p><p>A smaller but common case is a complex ctor/dtor combination.</p><p>class Object</p><p>{</p><p>public:</p><p>Object() { subObject = new SubObject; }</p><p>~Object() { };</p><p>private:</p><p>SubObject* subObject;</p><p>};</p><p>In this case, subObject will leak every time the destructor is called for an Object instance. The error is obvious in this case but real world examples can be confounding in complexity.</p><p>Another common case for memory leaks is multiple execution paths. In complex code, the deallocation of a block may be inadvertently skipped. Error handling is often involved in this case. If the error is very uncommon then only a small leak will result. A high volume system can exhaust or overtax memory resources in just a few minutes however in a repetitive error case.</p><p>For complex code that has poor Cohesion, leaks via multiple execution paths can be a major problem to find and fix. Error cases must be carefully evaluated to avoid this situation. The various ‘smart’ classes can help but are no silver bullet.</p><p>In complex programs finding memory leaks via code inspection is basically hopeless. An automated tool like Dynamic Memory Solutions Leak Check is a must. The tool should be used in Unit Test cases and on full end to end testing. This step is not taken usually and leaks show up in production environments.</p><p>There is a computer science concept called a Memory Pool. In a Memory Pool, allocation is done as a heap but deallocation is done all at once.</p><p>Structuring your C++ classes to allocate from a Memory Pool can be a great way to avoid leaks. This idea works if a bunch of object are created, used and then can be destroyed as a group. The key is that a pointer in Memory Pool is always maintained until the objects are destroyed.</p><p>For C, it is even easier since no dtors need be called. In this case, the programmer can allocate from the pool but does not call a deallocate routine. Once the pool is ready to be discarded, a single call free’s all the blocks at once.</p><p>The simplest strategy to avoid leaks is to not directly use the heap. The are a variety of strategies in modern C++, using the STL and templates, that minimize heap usage. These ideas are worth exploring in detail but are not a complete solution.</p><p>Memory Leaks in C/C++ are a real irritant. Use the techniques described here and your team can mitigate the problem.</p><p><strong>If you found this article helpful then please hit the heart button below to promote it.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82782f32983e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Effective Software Engineering]]></title>
            <link>https://medium.com/@matthewericfisher/effective-software-engineering-4dd1e311a361?source=rss-b0b5aa0ba470------2</link>
            <guid isPermaLink="false">https://medium.com/p/4dd1e311a361</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Matthew Fisher]]></dc:creator>
            <pubDate>Mon, 01 Aug 2016 03:53:31 GMT</pubDate>
            <atom:updated>2016-08-01T23:47:47.543Z</atom:updated>
            <content:encoded><![CDATA[<p>When I first started my career, I had a degree in Computer Science from the school of Engineering thus I was an Engineer. In fact, I was a Programmer. There are some key differences between Programmers, Computer Scientists and Software Engineers.</p><p>Programmers can master a programming language. With the advent of scripting languages e..g Java Script, PHP, just about anybody can be a programmer. For small projects, a group of programmers can be effective. For example, I love how the AppStore has enabled programmers to bring goods to the marketplace without having to worry about engineering. The Apple Engineers built a framework that allow Programmers to ignore a huge amount of details. Very cool. Programming is a necessary but insufficient skill for a Software Engineer.</p><p>A Computer Scientist seeks new knowledge. This area has been in a drought in my opinion. While there have been some advances on the edges in the last twenty years e.g. Watson, nothing fundamental has been invented to help the Software Engineer. I’m talking about something transformational like LED televisions compared to CRT. Being a Computer Scientist is also a necessary but insufficient skill for a Software Engineer.</p><p>A Software Engineer takes a variety of skill sets like programming, project management, architecture, computer science, testing, etc and combines them to Create. This combination of skills is the hallmark of Engineering in general and Software Engineering in particular.</p><p>My rant about the industry is that we have way too many Programmers and Computer Scientists. The Programmers are just too small scale to contribute greatly. The Computer Scientsts are so busy thinking about <a href="http://matthewericfisher.tumblr.com/post/4063835687/doing-it-right">Doing It Right</a> that they don’t contribute greatly either. The Software Engineer uses a practical attitude that balances the demands of each project.</p><p>I call this balancing act Effective Software Engineering. I’ll be expound on the various facets but here are some bits:</p><ul><li>Mastery of Programming</li><li>Strong Computer Science ability</li><li>Blending skills to achieve success</li><li>Understanding that time and budget constraints exists on every project</li><li>Planning for the future even when under pressure</li><li>Grasping Business goals and constraints</li><li>Leadership ability</li></ul><p>IMO, Software Developers and other IT personnel should strives to be Effective Software Engineers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4dd1e311a361" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Facebook Bots for fun and profit]]></title>
            <link>https://medium.com/@matthewericfisher/facebook-bots-for-fun-and-profit-490245c3797c?source=rss-b0b5aa0ba470------2</link>
            <guid isPermaLink="false">https://medium.com/p/490245c3797c</guid>
            <category><![CDATA[resume-writing]]></category>
            <category><![CDATA[bots]]></category>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[facebook]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Matthew Fisher]]></dc:creator>
            <pubDate>Thu, 28 Jul 2016 13:27:23 GMT</pubDate>
            <atom:updated>2016-07-31T20:36:04.477Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*2Y2YT3tLjpDVPrZQj9OlCA.jpeg" /></figure><p>Facebook now allows bots to talk to users. The bots are fun to interact with and not too hard to setup. After using a few good ones, you will want your own bot for fun and profit!</p><p>The ‘bot’ is a computer program running in the background that can respond to messages on the Facebook Messenger platform. The bot can be for personal or business use. I’ve used several of them recently and I’m confident that everyone will want their own bot assistant. I see the rise of the bots as the next evolution of the website, app or Facebook page. The bot is a new way to communicate with the people that you care about.</p><p>The bot excels in a ‘structured’ conversation. A structured conversation is one where the computer leads the user by giving options at every point. The user can mostly click there way through rather than typing. Bots can respond to typed keywords and general text as well but that gets more complicated. I’ll focus on building a simple structured conversation bot for this article.</p><p>Esther Crawford gave a great introduction and example of her resume in this <a href="https://medium.com/the-mission/how-i-turned-my-resume-into-a-bot-and-how-you-can-too-f03847352baa#.7hfz2lxt5">article</a>.</p><h4>Exploring</h4><p>Esther’s article motivated me to try creating a bot of my own. I twiddled with Smooch and cross platform messaging but eventually decided to focus on Facebook as a primary platform.</p><p>It turns out that writing a FB robot is quite simple for an experienced programmer and certainly within reach of the hobbyist. Facebook has a good example and decent documentation. Along with a Heroku account, it took me about an hour to setup a basic simple bot.</p><p>I’ve refined the basic example into a simple bot that anyone can setup and run. The robot is running <a href="https://m.me/dynamicmemorysolutions">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UhsDJNgK0EHyYs1dpk707A.jpeg" /></figure><p>The bot gives information about Facebook bot basics and my consulting company. Just for fun, it also tells jokes. The Facebook bot framework is very configurable so your bot can be completely different from mine with no programming changes.</p><p>Facebook allows a variety of widgets in the Messenger windows including buttons, post backs, images, audio, video, text, and a pop up menu. One bot will similar to another but the content is completely up to you.</p><p>Customizing a bot will take some programming effort. The joke functionality of DMS Software bot is an example of a custom interaction. There is some (simple) JavaScript that drives the joke functionality that will not be available generally.</p><h4>We can help</h4><p>If you are excited about creating a custom bot to market yourself or your business, send me a message via my <a href="https://m.me/dynamicmemorysolutions">Bot</a> or see the DMS Software <a href="http://www.dynamic-memory.com/">website</a> DMS Software</p><h4>Creating your own Facebook Bot!</h4><p>If you want to make your own bot, the simplest strategy will be to create a Github account and ‘fork’ my example. Once you have the source follow the detailed instructions in the README.md.</p><p>There are some technical details but it is not too bad so dig in even if you are not a professional developer. Getting your bot up and running is just a matter of establishing a Heroku account and adding your credentials from Facebook. Once your bot up and going, you can edit the text, add your own images, change the flow around, etc. No programming is required.</p><p><a href="https://github.com/matthewericfisher/fb-robot">matthewericfisher/fb-robot</a></p><h4>Talk to the world</h4><p>The bot is the next wave in communication. Soon the bots will be an indispensable part of our daily interaction for both personal and business use. With something like 900 million people on Facebook, your bot can talk to the world!</p><p>If you have questions or technical problems, comment on this article or send me a message on my <a href="https://m.me/dynamicmemorysolutions">Bot</a>.</p><p><strong>Please promote this article by hitting the heart button below or better yet leave a comment.</strong></p><p>Enjoy your bot journey!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=490245c3797c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Software Engineering — Process]]></title>
            <link>https://medium.com/@matthewericfisher/software-engineering-process-913847bcc7ea?source=rss-b0b5aa0ba470------2</link>
            <guid isPermaLink="false">https://medium.com/p/913847bcc7ea</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Matthew Fisher]]></dc:creator>
            <pubDate>Mon, 29 Feb 2016 14:56:19 GMT</pubDate>
            <atom:updated>2016-02-29T14:56:19.368Z</atom:updated>
            <cc:license>http://creativecommons.org/publicdomain/zero/1.0/</cc:license>
            <content:encoded><![CDATA[<p>I’m passionate about Software Engineering. As I’ve grown in my career, I’ve come to see that Software Engineering is quite different from Programming. Actual Programming is only one part of a well engineered product.</p><p>I’ve come to a paradigm of ‘Effective Software Engineering’ in an effort to express my view on creating successful industrial software. Effective Software Engineers understand many parts of Software Engineering not just Programming.</p><p>The steps in a properly engineered software project are truly astonishing. It really is no surprise that steps are skips and projects fail. Here is a list of major steps that I have been involved in:</p><ol><li>Idea. Someone must think of a product. Some ideas are small i.e. a new iPhone App while some are quite big i.e. put a man on Mars. Almost all product ideas will involve software in some way.</li><li>Product Management. Not to be confused with the Project Management. A Product Manager decides what direction to take a software project. The evolution of Windows is a good example of Product Management. Decisions made here make the difference between success and failure for products with a long life.</li><li>Project Management. Someone has to keep things on schedule, this is the Project Manager. For profit driven businesses, Project Management is absolutely critical. Project Managers think about time, dates and resources.</li><li>Contract details. Software Engineers don’t want to think about business details but it really matters. Contracts often specify broad requirements but also payments and penalties. Focusing on the bits that make the most money is actually a pretty good idea. Avoiding giant penalties in the form of SLAs and delivery milestones is vital for success.</li><li>Requirements. What should the software do? This is a much harder question than one might expect. Perhaps you’ve had the ‘RFP’ experience where a client sends a huge document full of requirements. I’ve worked on RFPs that were more than 1000 pages.</li><li>Analysis. This is the phase between Requirements and Design. It usually involves refining requirements, discussing gaps in existing software, kicking around Design ideas. Some other items that come up are Use Cases, Business Modeling, consideration of 3rd party products.</li><li>Architecture. Architecture means a variety of things in software engineering. In general, it is the overarching organization of the software. Some Architecture questions might be C++ vs Java? Linux vs Solaris? Rewrite or Reuse? <br>Architects can also be the person that tie the business to the software. For example, an Architect works with the Product Manager to think about features that meet the business needs of a changing marketplace. The Architect may also be broadly in charge of the traditional SDLC pieces. Effective Software Engineers are often Architects.</li><li>Design. Turning Requirements and Analysis into a software based solution is Design. This step is often smeared with Programming. A good design will have a dramatic impact on software costs and success.</li><li>Human factors. Really part of design but generally so bad that it deserves its own step. Clunky but functional software often fails.</li><li>Physical dependencies. Another part of Design and Architecture that is often overlooked. How the disks, network, CPUs, threads, etc are organized can dramatically impact the functionality of a large software system.</li><li>Programming. Finally we get to Programming. This step is the big focus for Developers but actually has less impact on success than several others steps. One of my rants is the excessive focus on programming by Developers. In this step, we create the software but in some sense it is an afterthought to Architecture and Design. If Architecture and Design are good then poor Programming will not cause a project to fail. Conversely, poor Architecture and Design cannot be corrected by outstanding Programming. Effective Software Engineers are outstanding Programmers but also much more. I’ll write another article on this issue.</li><li>Testing. Testing is vital, difficult and often skipped. Poorly testing software is invariably broken in a variety of ways. Effective Software Engineers understand the value of testing and make sure it happens regardless of schedule pressure. I’ll write more on this important topic</li><li>Performance and Scalability. Anyone can program a slow, batch system. It takes an Effective Software Engineer to create a real time, high performance, low latency, highly scalable system. I have a Design Pattern on this topic that I’ll write about.</li><li>Configuration Management. The software needs to be built, packaged and delivered properly. On the surface, this appears easy but it actually quite tricky to get right on large projects. Given a system with 500 Developers, multiple internal and 3rd party components, multiple active releases and geographic distribution, CM gets confusing to say the least.</li><li>Implementation. As an example, a complicated software system that must be deployed at several Data Centers. What hardware should it run on? How is the software configured? What about 3rd party licenses? What is the power and cooling situation in the Data Center? Is physical space available? What will the Network topology look like? How much disk space is required.</li><li>Disaster Recovery. More and more software systems are expected to be up 24x7. What happens if a tsunami wipes out the local power plant and power goes off at the Data Center for months. On a much smaller scale, what happens if an application crashes? DR is getting more and more focus.</li><li>Deployment. Pulling some software off the Internet to your Mac and hitting install is easy enough. What if the software is part of a robot system that is being deployed on Mars. In-field software upgrades are required. If the software Deployment fails then a billion dollars is history.</li><li>Operations. Running software can be very expensive and complex. There are huge rewards for making software easy to Operate. This might include things like Alarms, Robustness, useful GUIs, user manuals. Actual Operations includes 24x7 staffing, in-service upgrades, performance monitoring, fault monitoring, maintenance windows, client communications and customer service.</li><li>Maintenance. Software is always broken or incomplete. Start back at the top :)</li><li>End of Life. Eventually no one will use the software. Software can have a surprising long life cycle however. I suspect that there is some 1960’s software running on a mainframe somewhere. Unix itself was developed in that 1970’s so in some sense Linux is ancient software.</li></ol><p>Books have been written on each of these steps. No person can be an expert in the full Software Engineering Process. The Effective Software Engineer is familiar with all of pieces however and works to ensure success at every point.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=913847bcc7ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>