<?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: JSL ignores white-spacing for names, most people don't take advantage of this! in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-ignores-white-spacing-for-names-most-people-don-t-take/m-p/717188#M89886</link>
    <description>&lt;P&gt;I think when I started writing JSL I immediately opted out of all the ways JMP lets you set the names and most likely it was because I didn't really trust it and it felt weird (I had some background from javascript and Python BUT I didn't have any proper programming style for any language back then).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nowadays I do &lt;SPAN&gt;use code reformatting quite a lot when writing JSL and it will add whitespace to JMP names (because I have insert Spaces in operator names enabled). And in my names I don't use whitespace (I loosely follow some sort of Python Style Guide for JSL), this does (sometimes) help me separate my own names from JMP created names.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jan 2024 05:53:22 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2024-01-16T05:53:22Z</dc:date>
    <item>
      <title>JSL ignores white-spacing for names, most people don't take advantage of this!</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-ignores-white-spacing-for-names-most-people-don-t-take/m-p/717161#M89883</link>
      <description>&lt;P&gt;Not an important question, but I've often wondered why.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At my company there are many casual scripters in JSL and a few heavy-weights.&amp;nbsp; I'm a voracious consumer of other peoples code (reading) and have read a great deal of code from more than 20 people here.&amp;nbsp; Also, I've seen many examples of code posted here in the community forums.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Almost universally I see that the code authors do not take advantage of JMP's strange decision to ignore white-spaces and case in names.&amp;nbsp; Below are some examples.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems that most people use built-in functions -- such as &lt;CODE class=" language-jsl"&gt;Insert Into()&lt;/CODE&gt; -- with white-spacing, but for user-defined names generally opt out of doing it.&lt;/P&gt;&lt;P&gt;My main question is why?&amp;nbsp; I find that code is much quicker to read when using white-spaces as one would in general writing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can understand when someone comes from a traditional programming language, but I've seen quite a few folks here at my job that are first-time scripters, and they will generally do the same (use spaces for built-in names, not use spacing for user-defined names).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Personally I've grown to greatly appreciate the flexibility that JSL affords names, but I'm curious as to what other folks here think.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Examples:&lt;/P&gt;&lt;P&gt;from&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4867"&gt;@drewfoglia&lt;/a&gt;&amp;nbsp; in this &lt;A href="https://community.jmp.com/t5/Discussions/Object-Oriented-JSL-Examples/m-p/20012/highlight/true#M18248" target="_blank" rel="noopener"&gt;post&lt;/A&gt;:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ErraticAttack_0-1705367082105.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/60320i05CBD932187420FA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ErraticAttack_0-1705367082105.png" alt="ErraticAttack_0-1705367082105.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/3907"&gt;@Phil_Brown&lt;/a&gt;&amp;nbsp; in this &lt;A href="https://community.jmp.com/t5/Discussions/Object-Oriented-JSL-Examples/m-p/20016/highlight/true#M18252" target="_blank" rel="noopener"&gt;post&lt;/A&gt;:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ErraticAttack_1-1705367098015.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/60321i45C56C786414C4E7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ErraticAttack_1-1705367098015.png" alt="ErraticAttack_1-1705367098015.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The file &lt;A href="https://community.jmp.com/t5/JMP-Scripts/Recall-Function-Library/ta-p/49462" target="_blank" rel="noopener"&gt;libRecall_v2_0.jsl&lt;/A&gt; by&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4530"&gt;@MikeD_Anderson&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And here is an excerpt from my code -- I use white-space in names extensively:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ErraticAttack_4-1705366535356.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/60319i15D22BCCF055781A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ErraticAttack_4-1705366535356.png" alt="ErraticAttack_4-1705366535356.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 01:05:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-ignores-white-spacing-for-names-most-people-don-t-take/m-p/717161#M89883</guid>
      <dc:creator>ErraticAttack</dc:creator>
      <dc:date>2024-01-16T01:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: JSL ignores white-spacing for names, most people don't take advantage of this!</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-ignores-white-spacing-for-names-most-people-don-t-take/m-p/717188#M89886</link>
      <description>&lt;P&gt;I think when I started writing JSL I immediately opted out of all the ways JMP lets you set the names and most likely it was because I didn't really trust it and it felt weird (I had some background from javascript and Python BUT I didn't have any proper programming style for any language back then).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nowadays I do &lt;SPAN&gt;use code reformatting quite a lot when writing JSL and it will add whitespace to JMP names (because I have insert Spaces in operator names enabled). And in my names I don't use whitespace (I loosely follow some sort of Python Style Guide for JSL), this does (sometimes) help me separate my own names from JMP created names.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 05:53:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-ignores-white-spacing-for-names-most-people-don-t-take/m-p/717188#M89886</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-01-16T05:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: JSL ignores white-spacing for names, most people don't take advantage of this!</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-ignores-white-spacing-for-names-most-people-don-t-take/m-p/717323#M89903</link>
      <description>&lt;P&gt;Well - I can't speak for the others, but for my part, it's mostly habit. I was coding in Basic, VB, LaTeX, and Mathematica long before I started doing JSL. &amp;nbsp;All those languages have restrictions on the whitespace. &amp;nbsp;It never made sense for me to retool my skill set for one language when it would make it harder for me to step back into the others or step into new ones (like when I picked up Python over the lockdown).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 15:28:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-ignores-white-spacing-for-names-most-people-don-t-take/m-p/717323#M89903</guid>
      <dc:creator>MikeD_Anderson</dc:creator>
      <dc:date>2024-01-16T15:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: JSL ignores white-spacing for names, most people don't take advantage of this!</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-ignores-white-spacing-for-names-most-people-don-t-take/m-p/717365#M89910</link>
      <description>&lt;P&gt;I do definitely have a number of issues switching from JSL to Python / JavaScript!&amp;nbsp; If you're spending a lot of time switching between languages it does make sense to keep a uniform format as much as possible.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 17:30:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-ignores-white-spacing-for-names-most-people-don-t-take/m-p/717365#M89910</guid>
      <dc:creator>ErraticAttack</dc:creator>
      <dc:date>2024-01-16T17:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: JSL ignores white-spacing for names, most people don't take advantage of this!</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-ignores-white-spacing-for-names-most-people-don-t-take/m-p/717394#M89914</link>
      <description>&lt;P&gt;Another thought on this - since the built-in variables (formulas, etc) have syntactic highlighting built into the JSL editor, it's easy to tell that they're something special. &amp;nbsp;With the user defined stuff - it gets hard to tell what's one variable or two that might be missing a semicolon between them. &amp;nbsp;That would make debugging more difficult on longer scripts and applications. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 21:26:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-ignores-white-spacing-for-names-most-people-don-t-take/m-p/717394#M89914</guid>
      <dc:creator>MikeD_Anderson</dc:creator>
      <dc:date>2024-01-16T21:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: JSL ignores white-spacing for names, most people don't take advantage of this!</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-ignores-white-spacing-for-names-most-people-don-t-take/m-p/718061#M89991</link>
      <description>&lt;P&gt;Hm, after investing 2 hours in debugging a script and then finding out that Concatenate, sometimes,&amp;nbsp; differentiates between upper and lower case, you will start to wonder&amp;nbsp;why column "Age" can be different from column "age" and column "a g e":&lt;BR /&gt;(c)&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;from&amp;nbsp;&lt;A href="https://community.jmp.com/t5/JMP-Wish-List/data-table-message-column-exists-colname/idc-p/573117/highlight/true#M3140" target="_blank"&gt;data-table-message-column-exists-colname&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt:age &amp;lt;&amp;lt; set name("a g e");
dt:age[1] = 999;


Show(Column(dt, "age")); //Column(dt, "age") = Column("a g e");
Show(dt:age[1]); //dt:age[1] = 999;

dt &amp;lt;&amp;lt; New Column("age", Numeric, Ordinal);
Show(Column Name(2) == Column Name(6)); // Column Name(2) == Column Name(6) = 1; // Columns don't need unique names?
Show(Column(dt, "age")); //Column(dt, "age") = Column("age");
dt:age[1] = 9999;
Show(dt:age[1]); //dt:age[1] = 9999;

wait(1);

dt &amp;lt;&amp;lt; Delete Column("age");
Show(Column(dt, "age")); //Column(dt, "age") = Column("a g e");
Show(dt:age[1]); //dt:age[1] = 999;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;This was the time when I decided to stick to one rule :)&lt;/img&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Nevertheless, soon it will be a bit easier:&lt;BR /&gt;Via &lt;FONT face="courier new,courier"&gt;dt&lt;/FONT&gt;&amp;nbsp;&lt;FONT face="courier new,courier"&gt;&amp;lt;&amp;lt; Has Column()&lt;/FONT&gt;&amp;nbsp;a user will have the possibility to check for a column - and choose if the match has to be exact or with some freedom:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1705874367096.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/60444i54EB52EA147E5404/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1705874367096.png" alt="hogi_0-1705874367096.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jan 2024 22:03:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-ignores-white-spacing-for-names-most-people-don-t-take/m-p/718061#M89991</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-01-21T22:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: JSL ignores white-spacing for names, most people don't take advantage of this!</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-ignores-white-spacing-for-names-most-people-don-t-take/m-p/718068#M89992</link>
      <description>&lt;P&gt;You're right about column names -- they aren't strictly matched to the name structure of most JSL names.&amp;nbsp; That is great to hear of the new JMP18 feature -- I'll definitely use it a lot!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another issue with JMP column names that would be amazing if it were to be fixed -- the fact that they take precedence over local / here names.&amp;nbsp; In the example script here I cannot use the Here name "device" because it has the same name as a column in the little table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;JSL should have a strict column reference mode that ONLY allows columns to be accessed (outside of column formulas) via explicit scoping.&amp;nbsp; That would be a nice thing...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here( 1 );
device = "ABC";

dt = New Table( "test",
	&amp;lt;&amp;lt;New Column( "DEVICE", "Character" ),
	&amp;lt;&amp;lt;New Column( "VALUE", "Numeric" )
);

device = "TOOL1";

dt:device = device;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Jan 2024 02:26:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-ignores-white-spacing-for-names-most-people-don-t-take/m-p/718068#M89992</guid>
      <dc:creator>ErraticAttack</dc:creator>
      <dc:date>2024-01-22T02:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: JSL ignores white-spacing for names, most people don't take advantage of this!</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-ignores-white-spacing-for-names-most-people-don-t-take/m-p/718075#M89993</link>
      <description>&lt;P&gt;Maybe here the problem is that it's not possible to write a String to a column, but just to a cell:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here( 1 );

dt = New Table( "test",
	Add Rows( 1 ),
	New Column( "DEVICE", Character)
);

device = "TOOL1";

dt:device[1] = device;&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Jan 2024 05:27:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-ignores-white-spacing-for-names-most-people-don-t-take/m-p/718075#M89993</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-01-22T05:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: JSL ignores white-spacing for names, most people don't take advantage of this!</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-ignores-white-spacing-for-names-most-people-don-t-take/m-p/718076#M89994</link>
      <description>&lt;P&gt;yes, if local names and columns have the same name, it's a lot of fun to use both in parallel:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here( 1 );

xxx = "device";

dt = New Table( "test", add rows(10), New Column( "DEVICE", set each value (random integer(20))),
New Column( "VALUE", set each value (1))
);

device = "value";

Print(device);

distribution of DEVICE = Distribution(	Continuous Distribution(	Column( device )	));
distribution Of VALUE = Distribution(	Continuous Distribution(	Column( Eval(device ))	));
another distribution of DEVICE = Distribution(	Continuous Distribution(	Column( "device" )	));

:value &amp;lt;&amp;lt; set formula(device);

wait(3);

:value &amp;lt;&amp;lt; set each value (device)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In total, there are 13 rules + some exceptions!&lt;BR /&gt;&lt;A href="https://www.jmp.com/support/help/en/17.1/?os=win&amp;amp;source=application#page/jmp/rules-for-resolving-names.shtml" target="_blank"&gt;https://www.jmp.com/support/help/en/17.1/?os=win&amp;amp;source=application#page/jmp/rules-for-resolving-names.shtml&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2024 05:52:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-ignores-white-spacing-for-names-most-people-don-t-take/m-p/718076#M89994</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-01-22T05:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: JSL ignores white-spacing for names, most people don't take advantage of this!</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-ignores-white-spacing-for-names-most-people-don-t-take/m-p/718081#M89996</link>
      <description>&lt;P&gt;There are a lot of rules, but it would be nice to have a flag in JSL to turn on a strict mode, such that unscoped names are FORCED to be local (as in, only check the local scope, not HERE, not GLOBAL, and certainly not any column-names), and anything not local is required to be explicitly scoped.&amp;nbsp; That would be nice.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jan 2024 08:11:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-ignores-white-spacing-for-names-most-people-don-t-take/m-p/718081#M89996</guid>
      <dc:creator>ErraticAttack</dc:creator>
      <dc:date>2024-01-22T08:11:14Z</dc:date>
    </item>
  </channel>
</rss>

