{"action":"created","issue":{"url":"https://api.github.com/repos/vistadataproject/VDM/issues/54","repository_url":"https://api.github.com/repos/vistadataproject/VDM","labels_url":"https://api.github.com/repos/vistadataproject/VDM/issues/54/labels{/name}","comments_url":"https://api.github.com/repos/vistadataproject/VDM/issues/54/comments","events_url":"https://api.github.com/repos/vistadataproject/VDM/issues/54/events","html_url":"https://github.com/vistadataproject/VDM/issues/54","id":141480808,"number":54,"title":"Restate code bloat in VISTA (ed)","user":{"login":"conorcaregraf","id":1831390,"avatar_url":"https://avatars.githubusercontent.com/u/1831390?v=3","gravatar_id":"","url":"https://api.github.com/users/conorcaregraf","html_url":"https://github.com/conorcaregraf","followers_url":"https://api.github.com/users/conorcaregraf/followers","following_url":"https://api.github.com/users/conorcaregraf/following{/other_user}","gists_url":"https://api.github.com/users/conorcaregraf/gists{/gist_id}","starred_url":"https://api.github.com/users/conorcaregraf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/conorcaregraf/subscriptions","organizations_url":"https://api.github.com/users/conorcaregraf/orgs","repos_url":"https://api.github.com/users/conorcaregraf/repos","events_url":"https://api.github.com/users/conorcaregraf/events{/privacy}","received_events_url":"https://api.github.com/users/conorcaregraf/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/vistadataproject/VDM/labels/PrelimTechReport","name":"PrelimTechReport","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-17T04:54:22Z","updated_at":"2016-03-30T03:53:33Z","closed_at":null,"body":"From Ed ...\r\n\r\n```text\r\nRe-usability is good.\r\n\r\nThat's what the theory preaches, and we all seem to agree with it.\r\n\r\nHowever, a programmer can only re-use things of which he/she knows that they exist.\r\n\r\nOf course, when there are only a couple of dozen functions and subroutines, (or, in a more modern world: objects and methods), re-usability is easily accomplished. When there are too many (CHCS has >53,500 routines, containing a total of 289,294 entry points, and OpenVistA has >35,500 routines, containing a total of 284,571 entry points), then it becomes onerous to seek for candidates that could be re-used.\r\n\r\nIn fact, looking in both these systems, there are dozens of subroutines and functions that duplicate functionality. There are many routines that contain their own copy of the subroutine that writes a text like \"Press to continue: \" and then waits for the end-user to press that key. While there is a \"library subroutine\" for that function, which all applications are supposed to use, the code is still replicated (sometimes with slight typographical variations) in hundreds of places. I (Ed) have been around long enough to remember the days when computers were much slower than today, and there was a serious expense in calling a library function, so programmers were strongly motivated to replicate little subroutines like this \"in order to improve performance\". However, those days started to fade in the late 1980s when virtual memory became generally available and ended when memory became affordable enough to throw any and all excuse for this kind of programming by the wayside. (Interestingly, a lot of code for CHCS and VistA was written AFTER this time...)\r\n\r\nThe main benefit of re-using code is that code is \"in one place and one place only\", so that a maintenance programmer would only have to update one piece of code and be able to know that all code that \"inherits\" that change will be fixed in one fell swoop.\r\n\r\nWhat I see in both CHCS and VistA is a different kind of re-using code. There are hundreds of (sub)routines that started out as copies of existing code that were subsequently modified to suit a slightly different purpose. So, rather than add code like if (used for this purpose) do \"this special thing\" to the original code, a clone of the original code was created that did (or omitted) the special activity. As a result, maintenance programmers will see no benefit at all of this kind of \"re-use\", because they still have to make the same modifications in multiple places...\r\n```"},"comment":{"url":"https://api.github.com/repos/vistadataproject/VDM/issues/comments/203235026","html_url":"https://github.com/vistadataproject/VDM/issues/54#issuecomment-203235026","issue_url":"https://api.github.com/repos/vistadataproject/VDM/issues/54","id":203235026,"user":{"login":"hschema","id":1943236,"avatar_url":"https://avatars.githubusercontent.com/u/1943236?v=3","gravatar_id":"","url":"https://api.github.com/users/hschema","html_url":"https://github.com/hschema","followers_url":"https://api.github.com/users/hschema/followers","following_url":"https://api.github.com/users/hschema/following{/other_user}","gists_url":"https://api.github.com/users/hschema/gists{/gist_id}","starred_url":"https://api.github.com/users/hschema/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hschema/subscriptions","organizations_url":"https://api.github.com/users/hschema/orgs","repos_url":"https://api.github.com/users/hschema/repos","events_url":"https://api.github.com/users/hschema/events{/privacy}","received_events_url":"https://api.github.com/users/hschema/received_events","type":"User","site_admin":false},"created_at":"2016-03-30T03:53:33Z","updated_at":"2016-03-30T03:53:33Z","body":"Can this code duplication be diff / merged to some master routines by any audomated means?  Or would it have to be tediously refactored, routine-by-routine, by hand?\r\n"}}