Tim,

šŸ˜Š

It seems possible to me that there is another option for the ā€œFolder separatorā€ 
character.

On startup the address for this character is populated with the correct value.

Thereafter it is retrieved as any other constant.

Iā€™m guessing it is determined in runtime, most likely at startup.

Iā€™m glad you think about such things.

David Ringsmuth

From: Tim Nevels via 4D_Tech
Sent: Thursday, July 13, 2017 8:24 PM
To: 4d_tech@lists.4d.com
Cc: Tim Nevels
Subject: Re: Folder separator constant

On Jul 13, 2017, at 6:47 PM,Wayne Stewart wrote:

> Mind you it took me a long time to discover the Folder separator constant!!

<rant>

Now here is a great feature implemented in the wrong way. It confuses a 
programmers logical sensibility. 

ā€œFolder separatorā€ constant. It is a ā€œconstantā€. Constants have a single value. 
Right? 

ā€œFolder separatorā€ constant has whatever value it correct depending on the 
platform it is running on. If on macOS it is colon ā€œ:ā€. On Windows is it back 
slash ā€œ\ā€. 

Compile your database. Run a method on macOS and you get one value for ā€œFolder 
constantā€ and a different value on Windows. Client side, server side, it 
doesnā€™t matter. Runtime determines the value not compiling. 

But I thought constants were evaluated and resolved at compile time. Isnā€™t that 
the way it works in all other programming languages? A constant is a single 
value hard coded into the program code by the compiler. 

So 4D Compiler must treat this ā€œconstantā€ differently from other constants. The 
4D compiler must code this as a function that gets evaluated at runtime. 4D 
what were you thinking! 

Was it so terrible to make ā€œFolder separatorā€ into a function like ā€œApplication 
typeā€? Or did some engineer have the intense need and desire to see ā€œFolder 
separatorā€ show up in the method editor as a constant. Damn the semantics of it 
all! It may look like a constant, but itā€™s not. It is secretly a function.

From a programmers point of view it sure seems like an odd decision to me. 
</rant>

This has always bugged me. I just had to finally get it off my chest. :)

Tim

********************************************
Tim Nevels
Innovative Solutions
785-749-3444
timnev...@mac.com
********************************************

**********************************************************************
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:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

**********************************************************************
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:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to