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
**********************************************************************

Reply via email to