<?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: coding best practice in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/coding-best-practice/m-p/801255#M315329</link>
    <description>&lt;P&gt;The most important thing is the consistent use of indentation to identify logical units in code (DO-END, SELECT-END, etc.), and the consistent use of empty lines (e.g. between steps). Spaghetti code severely reduces maintainability.&lt;/P&gt;
&lt;P&gt;Take every opportunity to make code layout consistent.&lt;/P&gt;</description>
    <pubDate>Thu, 10 Mar 2022 07:53:08 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2022-03-10T07:53:08Z</dc:date>
    <item>
      <title>coding best practice</title>
      <link>https://communities.sas.com/t5/SAS-Programming/coding-best-practice/m-p/801248#M315322</link>
      <description>&lt;P&gt;Hi I am looking at a lot of sas programs I realise whoever wrote it keep changing the case of the data set name or variable&amp;nbsp; name. e.g. one line the data set is in all capital letters and the next few data set below it was referred to with small letter instead.&lt;/P&gt;
&lt;P&gt;is this some kind of common coding practice where case kept changing by programmer&amp;nbsp; for certain sense of readability etc,, I wonder please enlighten me&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 07:30:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/coding-best-practice/m-p/801248#M315322</guid>
      <dc:creator>HeatherNewton</dc:creator>
      <dc:date>2022-03-10T07:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: coding best practice</title>
      <link>https://communities.sas.com/t5/SAS-Programming/coding-best-practice/m-p/801252#M315326</link>
      <description>&lt;P&gt;The common accepted practice (see the posts by senior users here - Super Users and Proc Stars) is to use all lowercase.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 07:47:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/coding-best-practice/m-p/801252#M315326</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-03-10T07:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: coding best practice</title>
      <link>https://communities.sas.com/t5/SAS-Programming/coding-best-practice/m-p/801255#M315329</link>
      <description>&lt;P&gt;The most important thing is the consistent use of indentation to identify logical units in code (DO-END, SELECT-END, etc.), and the consistent use of empty lines (e.g. between steps). Spaghetti code severely reduces maintainability.&lt;/P&gt;
&lt;P&gt;Take every opportunity to make code layout consistent.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 07:53:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/coding-best-practice/m-p/801255#M315329</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-03-10T07:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: coding best practice</title>
      <link>https://communities.sas.com/t5/SAS-Programming/coding-best-practice/m-p/801276#M315339</link>
      <description>&lt;P&gt;We created a linter, which can enforce a series of best practices on SAS code.&amp;nbsp; There's an article on it here:&amp;nbsp;&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Hacker-s-Hub/Hacker-tip-5-Linting-SAS-Code/m-p/801098#M125" target="_blank"&gt;https://communities.sas.com/t5/SAS-Hacker-s-Hub/Hacker-tip-5-Linting-SAS-Code/m-p/801098#M125&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Over time, with the help of the community (or as our &lt;A href="https://sasapps.io" target="_self"&gt;organisation&lt;/A&gt; grows, through projects and sales of &lt;A href="https://datacontroller.io" target="_self"&gt;Data Controller&lt;/A&gt;), we will enhance and improve this library.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 10:30:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/coding-best-practice/m-p/801276#M315339</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2022-03-10T10:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: coding best practice</title>
      <link>https://communities.sas.com/t5/SAS-Programming/coding-best-practice/m-p/801384#M315388</link>
      <description>&lt;P&gt;Not claiming to be a "best practices" expert.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code indentation I would say is more helpful than worrying about case except in displayed text like Format values, Titles, Footnotes or variable Labels.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, I have lots of data step code that originated as Proc Import code. Which will use a lot of upper case. I'm too lazy to change all that. But will use lower case versions of the variables for the code I write.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Occasionally I will use mixed case if I am sharing code so that the variable may be a little bit more self explanatory to someone else on the project. Otherwise variable LABELS carry the burden of describing the contents of variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Personal peeve is coding in proportional fonts and "bold" or "italic" fonts or anything that affects the amount of space individual characters occupy. A monospace type font makes it much easier, IMHO, to align code for parallel structures.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 16:18:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/coding-best-practice/m-p/801384#M315388</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-03-10T16:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: coding best practice</title>
      <link>https://communities.sas.com/t5/SAS-Programming/coding-best-practice/m-p/801833#M315598</link>
      <description>&lt;P&gt;There is no standard as such, it is usually down to individual programmers' preferences.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While most SAS users code in lowercase, there is a strong argument that mixed case improves readability. Imagine trying to read a book that is printed entirely in lowercase. Personally I've started to limited mixed case, especially for table and variable names. Frequently SAS reads external databases where tables and columns are usually defined in mixed case. It makes sense to keep that the same once imported into SAS. Consider this:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;mylongcolumnname&lt;/LI&gt;
&lt;LI&gt;MyLongColumnName&lt;/LI&gt;
&lt;LI&gt;my_long_column_name&lt;/LI&gt;
&lt;LI&gt;My_Long_Column_Name&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Which do you find more readable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Mar 2022 23:27:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/coding-best-practice/m-p/801833#M315598</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-03-12T23:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: coding best practice</title>
      <link>https://communities.sas.com/t5/SAS-Programming/coding-best-practice/m-p/801851#M315600</link>
      <description>&lt;P&gt;You may find it funny, but I like option 3 best.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2022 05:59:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/coding-best-practice/m-p/801851#M315600</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-03-13T05:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: coding best practice</title>
      <link>https://communities.sas.com/t5/SAS-Programming/coding-best-practice/m-p/801862#M315608</link>
      <description>&lt;P&gt;Would agree with others, this type of inconsistency is not good.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While there is no accepted best practice for a SAS coding style, I think the important thing to strive for in a programming style is consistency.&amp;nbsp; If you use a style consistently, the reader's mind will identify patterns and use them to help interpret the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As an example, in most cases SAS doesn't care if you use single quotes or double quotes.&amp;nbsp; I had a macro language teacher who said he always uses double quotes, unless there a reason to use single quotes.&amp;nbsp; His argument was that this made his code more ready to be macrocized (macrofied?) in the future, since macro tokens don't resolve inside single quotes.&amp;nbsp; And also that when you were reading his code, if you saw single quotes, they communicated an unusual intent: 'I am using single quotes here because I do not want any macro tokens in the string to resolve.'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Having two different styles in the same program can also be informative, if unhelpful.&amp;nbsp; e.g.&amp;nbsp; could be a sign that the code was written by two different people.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Personally, I'm probably too inconsistent in my use of single quotes/double quotes.&amp;nbsp; And also in my use of lowcase/PropCase. But I still see value in consistency. : )&lt;/P&gt;</description>
      <pubDate>Sun, 13 Mar 2022 13:50:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/coding-best-practice/m-p/801862#M315608</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2022-03-13T13:50:14Z</dc:date>
    </item>
  </channel>
</rss>

