[HN Gopher] A Pure Types-Driven real-world apps development appr...
       ___________________________________________________________________
        
       A Pure Types-Driven real-world apps development approach
        
       Author : jhoxray
       Score  : 12 points
       Date   : 2021-09-11 12:13 UTC (10 hours ago)
        
 (HTM) web link (medium.com)
 (TXT) w3m dump (medium.com)
        
       | tuatoru wrote:
       | Could be interesting, but it's on Medium.
        
       | bob1029 wrote:
       | We've built a proper data-driven business application - all the
       | logic is effectively SQL over tables.
       | 
       | The challenge has nothing to do with the particular language or
       | type system. Having a strongly-typed language helps a ton with
       | refactor, but its not a prerequisite for data-driven to work
       | correctly.
       | 
       | The _most_ important part of doing this right is stepping away
       | from the computer and listening to how the business refers to the
       | things and their relationships. Getting the schema /normalization
       | correct is foundational to long term success.
       | 
       | For instance, understanding that circular dependencies exist in
       | the real world, and then actually being able to model them
       | accurately is super important. If you have a Customer & Account
       | that need to talk to each other both ways, invent a 3rd (or more)
       | type(s) to relate them together. Model the nature of the
       | relationship itself inside this new type. Very rarely is the
       | relationship between 2 business types just an ID map (e.g. _when_
       | was the relationship established? By whom?). Also, absolutely don
       | 't do any sort of bullshit where you arbitrarily decide which
       | type "wins" in a hierarchy, unless the business has expressly
       | informed you that one of those types is king always.
       | 
       | Closely related to this is nesting of complex types. Just don't.
       | Make arrays (tables) of things and map between them via
       | relations. You _can_ query into JSON blobs with most database
       | engines (we use SQLite), but it 's a shitty way to author your BL
       | in my experience.
        
         | jhoxray wrote:
         | Thank you, very good points!
        
       ___________________________________________________________________
       (page generated 2021-09-11 23:03 UTC)