David, I’ve missed enumerated types and structs very much, just as I’ve missed such things as pre- and post-increment and decrement, the ?: construct (now addressed by Choose, admittedly), the lack of any true ability to break out of a loop and some of the more interesting and creative uses of #define. I used to use the last to cope with the loss of some of the lovely rich syntax of BCPL. Hey ho: there are some language design decisions which I shall never understand.
Booleans: OK, fair point. Numeric constants would accomplish what you want and look pretty similar, but I accept that boolean constants would be cleaner. The removal of 4D Chart just to fix the lack of constants (!) was perhaps, as one of my lecturers commented when I was at university, “getting the sledgehammer/nut ratio wrong”. I got round the problem by defining a large number of constants myself, but I vaguely resented the time I had to put into it. As to variable names, I’m a pretty quick touch typist. I just don’t like long names. I don’t like underscores in names, either (it’s camelCase for me). De gustibus… Jeremy Jeremy Roussak [email protected] > On 4 Jun 2017, at 10:35, David Adams via 4D_Tech <[email protected]> wrote: > >> I have been a fan of custom constants since I started using 4D, probably > because >> my background in C meant that I couldn’t imagine a programming > environment which >> didn’t have them (whether as preprocessor directives or enumerations). > > How have you coped with no enumerated types and no structs? I regularly > feel the urge to resort to self-harm because 4D has no structs and I never > used C. I mean, structs (and similar) a language feature from the > 1970s...not exactly some fancy modern novelty. > >> Boolean constants: why? What more than True and False do you need? > > Now there is an entirely fair question which I failed to answer well in my > feature request. Happily, Miyako answered it well: > > I think what you are after is more like > > MyMethod (with_this_option;without_that_option) > > instead of > > MyMethod (True;False) > > Yes. Lables that mean true or false - I would use them a lot. Here's an > example: > > Method_DoThingsAndStuff (True) // Eh? > Method_DoThingsAndStuff (Open file) // That's better. > >> Removing constants from compiled / distribution code. For completed > databases, yes. For components, no: I use constants >> exported from components as a way of communicating with them, as > selectors or parameters. > > Good point. Yeah, better that this is an option. I'm still getting used to > 4D's components and haven't thought everything through. Sometimes, I want > exacty what you describe, other times what I want is to make sure that > extra constants are tossed to avoid duplication up at the host database > level. Best would be if 4D would check for duplicate constants and notify > us. Righ now, you can stack multiple identical constants into the same > system. > >> I remember being bewildered when I started using 4D that the 4D Chart > didn’t using constants for the huge >> array of selectors passed to its routines, but needed me to remember > numeric selectors. > Oh, that's been fixed! They killed 4D Chart ;-) Oddly enough, the new > charting (toy) feature GRAPH supports 8 chart types but they're specified > by numerics without constants. I added my own custom constants for these. > >> But I must confess to being a monster, sadly. > You. Monster. I think that a lot of fancy conversations about programming > style boil down to typing speed. I'm probably in the 80-90% in typing speed > and I > loveReallyLongNamesThatCompletelyDescribeWhatAMethodDoesClearlyAndCompletely. > Others don't. I had a boss that typed like a chicken looking for corn. His > names were, well, brief. No philosophy, it was just hard for him to get > anything done because of his limited keyboard skills. There would have been > no problem spreading some philosophy on top of that as an excuse but, well, > it came down to only having a finger on each hand for typing. > ********************************************************************** > 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] > ********************************************************************** ********************************************************************** 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] **********************************************************************

