{"id":15905,"date":"2024-12-07T09:39:17","date_gmt":"2024-12-07T08:39:17","guid":{"rendered":"https:\/\/www.q-software-solutions.de\/blog\/?p=15905"},"modified":"2024-12-07T09:39:19","modified_gmt":"2024-12-07T08:39:19","slug":"does-anyone-make-it-differently","status":"publish","type":"post","link":"https:\/\/www.q-software-solutions.de\/blog\/2024\/12\/does-anyone-make-it-differently\/","title":{"rendered":"Does anyone make it differently"},"content":{"rendered":"\n<p>My programming runs along these steps<br>1) try to understand (if in doubt write some code to tests)<br>2) make it work<br>3) restructure it<br>4) make it prettier<br><br>I try to get  a handle to the problem. What do I have, what do I know, what do I have to learn to understand.  After that  I try to make something work which solves at least some kind of problem with the project. I&#8217;m not doing TDD in general. So sometimes I write a text beforehand and sometimes a test after the implementation. So I&#8217;m not writing test to fail always. <br>What I always do (but in the rare cases). I run the code a) through the compiler (if available) and b) run it in the debugger to check.<br><br>Most times I use object-oriented languages and object-based languages (in my case WLanguage and VBA) But I also have Java, C# installed and yes, I download libraries which I often find there to test things. Currently, it&#8217;s Xrechnung\/Zugferd and for that, you can find: <br><br><a href=\"https:\/\/www.mustangproject.org\/?lang=de\">https:\/\/www.mustangproject.org\/?lang=de<\/a>, <a href=\"https:\/\/www.e-rechnung-bund.de\/standard-xrechnung-3-0-1\/\">https:\/\/www.e-rechnung-bund.de\/standard-xrechnung-3-0-1\/<\/a><br>What I think I have learned, going to the Java\/C# track means loading tons of libraries. And I guess it is good working, but it&#8217;s terrible much and getting it needs time and if you believe it or not, there are better solutions for part of it in WLanguage e.g check XML handling: Just  take a look here: <a href=\"https:\/\/doc.windev.com\/en-US\/?3081018\">https:\/\/doc.windev.com\/en-US\/?3081018<\/a><br><br>I don&#8217;t know if there is Software which works similar in Java or C#. But of course I may be wrong, just let me know if you know better. <br><br>Then to 2) the first implementation usually means hardly much structurung just writ it down. Yes, I&#8217;m using some Objects for it and of course I use methods\/functions\/procedures,  Data Structures and Classes\/objects. But it migh look like in a test like this:<br><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">obj is dynamic CUBL_Invoice<br>\tobj = new CUBL_Invoice(101268)<br>\t<br>\t<br>\t<br>\t<br>\tds is Data Source = QRY_Verkauf<br>\t\/\/ obj.addInvoiceCommonDataHeader()<br>\t<br>\t<br>\tinv  is dynamic xmlNode &lt;description=\"UBL-Invoice-2_1.Invoice\"> = obj.xmlDoc.Invoice<br>\t<br>\t<br>\tTestCheckEqual(inv.IssueDate, \"20241014\")<br>\tTestCheckEqual(inv.InvoiceTypeCode, 380)<br>\tTestCheckEqual(inv.DocumentCurrencyCode, \"EUR\")<br>\t<br>\tobj.addSupplierInformation()<br>\tobj.addCustomerInformation()<br>\tobj.addPaymentMeans()<br>\tactQuery is Data Source  = QRY_Verkauf<br>\tactQuery.paramSearchFor = 101268<br>\tHExecuteQuery(QRY_Verkauf)<br>\tHReadFirst(QRY_Verkauf)<br>\tIF HFound(actQuery) THEN<br>\t\t<br>\t\tTestCheckEqual(obj.xmlDoc.Invoice.AccountingCustomerParty.Party.PostalAddress.Country.IdentificationCode, \"DE\")<br>\tEND<br>\tHClose(actQuery)<br>\t<br>\t<br>\tobj.addTaxTotal()<br>\tobj.addMonetaryTotal()<br>\tobj.addInvoiceLines(GCS_CB_VERKAUF)<br>\t\t<br>    XMLSave(obj.xmlDoc, fParentDir(fCurrentDir()) + \"\\out\\after_assign_InvoiceCommonHeader.xml\", XMLFormatting+xvNoValidation)<br><\/pre>\n\n\n\n<p>So yes that does what it should do and is not well structures.<br>Then the 3) comes into play. I&#8217;m nearly always using Polymorphism and template methods. So I try to figure out some kind of a root class with the stuff which is needed in it and implement that. So I don&#8217;t have to care about that down the inheritance line.<br>There will always be some kind of methods to be overwritten \/extended<br><br>Currently, it is this one: PROCEDURE addPart()<br><br>I&#8217;m building a XML document out of parts, and the parts are subclasses of the top class.<br>I try to improve on the naming, and for that, I&#8217;m grateful if there is at least some support for in the language I have to use. And there is but one tool which is always there in WLanguage and Access, you can run a compiler and fix the problems along the compilation errors. I can assure you it works, and it really helps. <br><br>I like the wording from tsoding daily about this &#8222;Compiler supported refactoring)<br>See this channel: <a href=\"https:\/\/www.youtube.com\/@TsodingDaily\">https:\/\/www.youtube.com\/@TsodingDaily<\/a><br><br>I really like this channel and the way he does things. I guess I&#8217;m not alone with that. <br><br>Any programmer among the few readers here, who like to share what they do\/think?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My programming runs along these steps1) try to understand (if in doubt write some code to tests)2) make it work3) restructure it4) make it prettier I try to get a handle to the problem. What do I have, what do I know, what do I have to learn to understand. After that I try to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7758,8001,7979],"tags":[],"class_list":["post-15905","post","type-post","status-publish","format-standard","hentry","category-it","category-meinung","category-programmierung"],"_links":{"self":[{"href":"https:\/\/www.q-software-solutions.de\/blog\/wp-json\/wp\/v2\/posts\/15905","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.q-software-solutions.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.q-software-solutions.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.q-software-solutions.de\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.q-software-solutions.de\/blog\/wp-json\/wp\/v2\/comments?post=15905"}],"version-history":[{"count":1,"href":"https:\/\/www.q-software-solutions.de\/blog\/wp-json\/wp\/v2\/posts\/15905\/revisions"}],"predecessor-version":[{"id":15906,"href":"https:\/\/www.q-software-solutions.de\/blog\/wp-json\/wp\/v2\/posts\/15905\/revisions\/15906"}],"wp:attachment":[{"href":"https:\/\/www.q-software-solutions.de\/blog\/wp-json\/wp\/v2\/media?parent=15905"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.q-software-solutions.de\/blog\/wp-json\/wp\/v2\/categories?post=15905"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.q-software-solutions.de\/blog\/wp-json\/wp\/v2\/tags?post=15905"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}