<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Why dont we like hard coded literald in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-dont-we-like-hard-coded-literald/m-p/3930546#M941154</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Takes less space for one if the same text is used in more then one place.&lt;/P&gt;&lt;P&gt;Also, if you have to change it and it's used in more then one place, you only need change it in one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Jun 2008 16:53:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-03T16:53:28Z</dc:date>
    <item>
      <title>Why dont we like hard coded literald</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-dont-we-like-hard-coded-literald/m-p/3930545#M941153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Abapler,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am planning a workshop for developers concerning guidelines. They shall use less hard coding.&lt;/P&gt;&lt;P&gt;But...  Why ?&lt;/P&gt;&lt;P&gt;It is clear for me in cases of translation. But what other reasons are there.&lt;/P&gt;&lt;P&gt;Do you have any source, ideas, examples ?&lt;/P&gt;&lt;P&gt;We are working with classic Abap and little OO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for every help !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simone&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2008 16:45:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-dont-we-like-hard-coded-literald/m-p/3930545#M941153</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-03T16:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: Why dont we like hard coded literald</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-dont-we-like-hard-coded-literald/m-p/3930546#M941154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Takes less space for one if the same text is used in more then one place.&lt;/P&gt;&lt;P&gt;Also, if you have to change it and it's used in more then one place, you only need change it in one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2008 16:53:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-dont-we-like-hard-coded-literald/m-p/3930546#M941154</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-03T16:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: Why dont we like hard coded literald</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-dont-we-like-hard-coded-literald/m-p/3930547#M941155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Simone, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hardcoding is a BIG no-no. it reduces flexibility. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If, for ANY reason you need to change that value, you must update the progam. Then, the whole program needs to be moved to Test, Unit tested, run through a QA team, given to functional team and end user for more testing, approved, and finally moved to production.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;whereas if you stored that in a table, you could more easily update just that table value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is a very simple concept - not sure if you are an ABAPer, but you might want to have them provide the guidelines and workshop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2008 17:07:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-dont-we-like-hard-coded-literald/m-p/3930547#M941155</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-03T17:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Why dont we like hard coded literald</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-dont-we-like-hard-coded-literald/m-p/3930548#M941156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Also, if you have to change it and it's used in more then one place, you only need change it in one.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And if you used hard coding you will have to change it not only in several places but in &lt;STRONG&gt;all&lt;/STRONG&gt; places. And most likely you will forget to change one place. The results can be strange...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One thing I would like to add: Most likely your developers will produce bugs once in a while. Or if they are perfect someone will try to use their programs for something they were not developed for. In the end you (or them) will have to debug the source code. And it's helping a lot if you can just search for a constant by it's name. If you just see in the code of somebody else that a 'magic' parameter is set to 42 you will have a really bad time to find all other places where 42 is used with the same intention. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;But this are all reasons that are not restricted to ABAP. It's true in every programming language. And there is one easy way to teach a programmer not to use hard coding whenever he can avoid it without major performance drawbacks: Just let him do maintainance for some weeks... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Jan Stallkamp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2008 18:41:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-dont-we-like-hard-coded-literald/m-p/3930548#M941156</guid>
      <dc:creator>JanStallkamp</dc:creator>
      <dc:date>2008-06-03T18:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: Why dont we like hard coded literald</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-dont-we-like-hard-coded-literald/m-p/3930549#M941157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Simone&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One of the 10 (or more) commandments of decent programming is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;"Thou shallst not use any hard-coded literals."&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The other ones can be found in Andy Hunt's &lt;EM&gt;The Pragmatic Programmer&lt;/EM&gt; book.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example: &lt;/P&gt;&lt;P&gt;You have many custom financial reports using a hard-coded VAT value of lets say 21.0 % (UK).&lt;/P&gt;&lt;P&gt;As we all know the VAT is every now and then increased. Using hard-coded VAT values you need to find all of them (no &lt;STRONG&gt;traceability&lt;/STRONG&gt;, &lt;STRONG&gt;Where-Used-List&lt;/STRONG&gt; ) and change each of them.&lt;/P&gt;&lt;P&gt;In contrast, if have a class ZCL_TAX with a constants MC_VAT = '21.0' you need to change the VAT at a single place and using the Where-Used-List for this constant you see immediately which reports will be affected by this change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2008 20:33:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-dont-we-like-hard-coded-literald/m-p/3930549#M941157</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-06-03T20:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: Why dont we like hard coded literald</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-dont-we-like-hard-coded-literald/m-p/3930550#M941158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;good idea to let them do the maintanance.&lt;/P&gt;&lt;P&gt;Many developers are very optimistic :&lt;/P&gt;&lt;P&gt;returncode , Exceptions, try - catch and constants are for pessimists - aren't they ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ciao&lt;/P&gt;&lt;P&gt;Simone&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2008 12:49:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-dont-we-like-hard-coded-literald/m-p/3930550#M941158</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-04T12:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Why dont we like hard coded literald</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-dont-we-like-hard-coded-literald/m-p/3930551#M941159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Simone.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ok, I'm a little bit biased. I'm working in an area of SAP where I have to dig into older source code quite often. And the most I learned about writing good (or better: robust) source code was when I started to deal with existing source code. One of my first software projects (back in the days at university) was to rewrite the entire GUI of a bigger program. And I learned more from that than from any class about software engineering...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Jan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2008 15:29:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-dont-we-like-hard-coded-literald/m-p/3930551#M941159</guid>
      <dc:creator>JanStallkamp</dc:creator>
      <dc:date>2008-06-06T15:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why dont we like hard coded literald</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/why-dont-we-like-hard-coded-literald/m-p/3930552#M941160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 18:53:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/why-dont-we-like-hard-coded-literald/m-p/3930552#M941160</guid>
      <dc:creator>SergioFerrari</dc:creator>
      <dc:date>2014-09-29T18:53:32Z</dc:date>
    </item>
  </channel>
</rss>

