On Wed, Nov 30, 2016 at 3:22 PM, David Adams <dpad...@gmail.com> wrote:

> 1) Give up on components in 4D.
​They are getting better.

> 2) If you're using components, consider a "tell, don't ask" approach.
> (Miyako nodded towards this concept in recent weeks.) In this case, it
> would mean storing the data in the component and telling the component what
> to do. In other words, don't keep pulling stuff out of the component and
> back into the host for manipulation - do the manipulation in the component.
​This is the direction my experience has led me over the last few years.
Components are pretty useful to me for providing a library of basic
functionality (math, string, date, file functions). I've got a method
editor I like and ​a Structure Explorer that's handy.

​What I personally haven't had great success with is building complex
components (like 4DPOP or Peter's Code Wallet). I just may not have the
patience. But getting back to me I seem to have settled into the using
components as functions and independent tools which embrace that "tell,
don't ask" philosophy. ​

First off, I was using it mainly for Mustache, which
> ​ ​
> gave me a new appreciation for logic-less templating.

​+1 on this. I'm using it in a project where I need to convert a JSON into
a web page. I took a run at using 4D tags and doing it on the 4D side. Not
pretty. Mustache and Handlebars was so much easier. ​

> Instead, I use TSV (Tab Separated Values) - another kind of structured text
> with other benefits.

​I think TSV (and CSV) gets overlooked a lot because it's sort of like your
father's Oldsmobile - been around forever and no longer cool. But like you
say it's got some real advantages. In addition to the ones you outlined
I'll add how easy it is to manage and clean up the data prior to importing
using a decent text editor and/or google spreadsheets. I continue to do a
lot of this sort of thing with various price lists in various formats. ​

​And since the old 32k limit on text blocks went away (a long time ago)
​you can setup an import form allowing a user to paste in the TSV text. I
do this also with everything from a few lines to files a few megs in size.
Quick and easy.

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

Reply via email to