Posts

Switch Statements vs Visitors

Switch statements should only be used at process bounds, where data is still un typed. As soon as you are outside of your http ( or other externalization protocol ) binding layer, you should have instances that are ready to be used with visitors.  NOTE : it's valid to create an Unknown visible type which you map anything in your switch statement fall through default case to, so that visitor handlers can address cases of added types that they don't yet support, gracefully. 

Thread Local Storage ( Or Async Local Storage in JavaScript World )

Use thread Local Storage to separate the concern of contextual state propagation, from the domain specific concern you are trying to implement. This makes your domain code more portable. And your method signatures easier to parse. It's clear what's needed for the method and what is just needed to ensure any downstream code can access the operating context for tech level concerns such as authentication, caching, APM and transaction management.

IDE Gripes

Who thought "closing character type over" was a good idea? "type over closing quotes or brackets." If you are ever trying to nest brackets, which is a large portion of the time, then this feature makes the ide completely unusable.  In what world, should an intentional keystroke, to insert a parenthesis, ever be considered by your IDE to, by default, be the wrong move?  If I look at a closing parenthesis, and I decide hey, I think I need a second, and I explicitly set my cursor there and type in a parenthesis, why in the name of someone important, would I want the IDE to just automatically undo that.  "Yeah we.. uh we don't think you wanted it enough. " #VsCode #IDE #SoftwareEngineering #Coding

The World of Conceptual Data Modeling

The virtual world.  The world of conceptual data modeling. It has rules. Rules as undeniable and irrefutable as the laws of physics.  There are ways that concepts can be assembled, and ways that they can't. #SoftwareEngineering #DataModeling #Software #Data Trouble is, most of us data modelers do not fully understand these rules.  And so we keep trying to do magic. It's important to understand these things about your data. Is it a Reference Type? Or is it a "scalar value" type?     The latter mans that if an identical value of this conceptual type exists in two or more places, it exists as a copy. ( and importantly SHOULD  exist as a copy ) Is it a "primary" or "singular" concept, or is it a relation between two distinctly and independently referenceable concepts?  Is it a "concrete" concept or an abstraction/type union? ( this can apply to both singular and relation type concepts ) "Child Entities" are a myth. At least child en...

AI Self Awareness in Video Games

I believe that #AI for game characters will be the first to be self aware.  This is because their models will be less strictly controlled because they are not serving mission critical services like operating a car or directly handling decisions that affect large sums of money. Such systems are usually not enabled for learning. Rather they are responding to stimulus using pre-trained, and well tested, neural networks. But more importantly, Game AI, like the AI in a #Tesla , will be capable of not only perceiving the world, but mutating it.  This ability to perceive, and then action, and then perceive the result of the action, is I believe, a critical feedback loop for self awareness. Another critical piece of course would be to hallucinate or perceive self produced input in addition to external input.  If the AI's neural network is in a mutable state as it plays the game, can mutate the external world around it and perceive the result of that modification, and can pipe int...

Angular Material Form Groups are very React Like :(

#angular  Material Forms use what appear to be "contexts" with the relationship between the Form Group and Form Field. This is a very "#react" style approach. It's very non declarative which is unusual for angular. Components have to just know, trust that they are in a form group context. Better to have the form group as an input to the material form field https://material.angular.io/components/form-field/overview I use contexts and tuples on occasion, especially in recursive programming or graph processing, but you really have to be very careful with them and use them in very narrow scopes.    I suppose form groups can be recursively nested.  Still when possible, I believe you should use a more declarative approach and I think that explicit binding of form group as an input to each mat-form-field is far better strategy The result of using a context strategy is that you get runtime errors when you get it wrong.  I believe angular scans for and detects these issu...

An "aha" Moment with Angular

In angular, a component declares mutability. A function is opaque to angular and so does not.  This declared mutability allows angular to trust the stability of output and evade polling.  This <add-one input="x" />  Not This addOne(x) #FrontEndDevelopment #Angular #Software