> On Sat, Jan 7, 2017 at 11:51 AM, Keisuke Miyako <[email protected]>
wrote:
> maybe it's better not to include the seed values as static text in the
code
> itself.

Is it okay if I agree with you while carrying on what I'm doing ;-)
Seriously, your suggestions are spot on and I'd advise anyone following
along at home to heed them.

So, yes, I find myself surprised that I'm heading down this road. I *hate*
finding long screeds of hard-coded text in 4D methods. It's just not a
great look, it's virtually impossible to maintain, it's unreadable, etc.
But I'm experimenting. I've gotten into some habits and am giving myself
more of a clean slate to see what happens. In this particular case, I'm
seeding records and then running the cases against the records. For sure,
the data could be stored in an external file. That obviously has a couple
of small costs and some big advantages. For example, after building you can
automatically clear the file and keep it from bloating the distribution.
(Assuming this magic file is in the /resources path in the first place.)

For what it's worth, this is just a developmental phase. The painful part
of starting with a blank slate is that I'm missing a lot of my magic
scaffolding. So, I'm building back up piece-by-piece, but with a fresh
look. A couple of milestones down the road, I should be generating the
predictable test cases automatically and can then run them in memory, write
them to disk, write them to records, use them to produce documentation,
etc. For now, it's kind of fun to do things the hard way. One of the great
things about the hard way is it gives me a good reminder of what I'm trying
to simplify.

I listen to podcasts while I'm doing boring tasks like yardwork of chopping
veggies and lately Tim Harford has been making the rounds in support of his
newest book, "Messy":

http://timharford.com/books/messy/

I've heard him about three times now and he's great. Lots of good reminders
about changing your point of view and giving serendipity a chance to
intervene in your life. (I even have one of the early editions of the
Oblique Strategies cards he goes on about...although I never did find them
that helpful for programming.) Tiny example:

Someone spilled coffee on my external keyboard yesterday and it's dead.
(Well, not "dead", but to keep using it I'll need to learn a language
without the letter "d".) So I rearranged my computer and monitors after
many, many years of using them "the way I like them." Guess what, the new
arrangement is way better, and I never would have tried it out on my own.
Once again, the virtues of coffee cannot be overstated. Just a little
reminder of how helpful it can be to do things a bit differently.

So, yeah, I'm doing something kind of stupid in my code and enjoying it for
a minute.

> if you really need to put the string in 4D code,
> why not stick "Get text from pasteboard" in the debugger "expression"
pane and
> save that state.
>
> just copy whatever text you want to paste in code and open the debugger.
> the text in the "value" pane will be ready to take away.

Yeah, I did that first...it got old in a hurry. This way I can run a few
dozen or hundreds of tests and pretty quickly convert the text as needed
for the seed method. But, yeah, it's not an approach with a great future...
**********************************************************************
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