Thanks Kirk, I also use

OB SET($obj;\
  "key1";$value1;\
  "key2";"textValue";\
  "key3";someFunction($functionary);\
  "key4";42)

extensively, I had just never seen it used so unnecessarily and it threw me.

On Sun, Sep 4, 2016 at 7:08 AM, Kirk Brooks <[email protected]> wrote:

> Jim,
> Since the \ was incorporated into the method editor the advantage is being
> able to break up long lines into more readable text. Humans tend to read
> vertical text faster than horizontal. It's a real benefit when you've got a
> lot of params to pass to something. This is going to be easier to read (ie.
> debug)
>
> myMethod(\
>   $param;\
>   AnotherMethod(p1;p2;p3);\
>
>   ->[Table];\
>
>
> YetAnotherMethod($pointerToSomething;$pointerToSomethingElse;$
> pointerToPoorlyNamedVariable))
>
>
> than all of that strung into a single line. And I always use it building
> c-objects:
>
> OB SET($obj;\
>   "key1";$value1;\
>   "key2";"textValue";\
>   "key3";someFunction($functionary);\
>   "key4";42)
>
>
> I generally don't bother with variable declarations but it's the same
> principle. Unlike javaScript you can't add comments when you use \ because
> it's not actually creating new lines just breaking up the display of the
> single line.
>
> My understanding is it has zero impact on compiled code (since all that
> stuff gets stripped out anyway) and virtually zero impact on interpreted.
>
>
> On Sat, Sep 3, 2016 at 9:37 PM, Jim Dorrance <[email protected]>
> wrote:
>
> > Are there any advantages to writing code like this?
> >
> --
> Kirk Brooks
> San Francisco, CA
> =======================
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[email protected]
> **********************************************************************




-- 
Jim Dorrance
[email protected]
[email protected]
www.4d.dorrance.eu

PS: If you know of anyone that needs an experienced 4D programmer to add
energy and experience to their team, please let me know. I have
experience in many areas. Reasonable rates. Remote or Paris only.
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to