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

Define "Scalar Value"

Scalar values are non reference values. This does not necessarily mean simple values. They may have multiple components that are independently mutable. "scalar" simply means if two "entities", have the same value for the same declared field, they have a copy... #Coding  Side note, document ( or "schemaless")  stores and APIs tend to have a lot of what should be reference types, embedded as scalar values.   This is problematic...   It's 100% fine for a derivative "readonly" view. It's a problem when it's your mutable source of truth store. #MongoSucksUnlessItsACache

Why The Phrase "Over Engineered" is a Bad Wrong

Never tell me something is “over engineered”. Complex problems often require complex solutions and attempts to simplify them often lead to opaque and rigid systems where the complexity is hidden, not only from end users, but also peer developers and our future selves, rather than properly declared and then reduced for the 80% with sensible defaults and templates. This means that every time the code is introduced to a new developer or returned to after some time, the solution effectively needs to be reverse engineered to be modified. You have to look at the imperative implementation code to understand the model , inputs or outputs. Because “Declaring” your contract with schema was “ too complex”. Because drafting your design first in PUML to make sure you understood how everything worked together was “over engineering”. NOW, that said, often when people describe a system as over engineered, what they actually mean is overly redundant. Meaning hosting infrastructure, containers, shar...

Merging Things does not Reduce Them.

Merging Things does not Reduce Them. It simply makes them more difficult to distinguish. It often seems intuitive that merging two methods results in a reduction of complexity. Ironically this is not true. When you merge two methods, you still have 2 conceptual tasks that can be executed by an #API. Only now, you've invented your own hidden, single use "schema" for defining them and how to invoke them.  All you've done is hide them from your declared interface. They are no longer discoverable at compile time by your compiler and knowledge of how to invoke them and what is supported is now tribal.  In fact you've added complexity and hidden critical information from the compiler. Yet this is common practice. Extremely common...  The same goes for model schema by the way.  Behavior modifiers on methods and conditionally relevant fields on models, highlight this problem. Be verbose in your contract definitions so that you don't have to be verbose over slack. #sof...

Separation of Concern: Domain Logic vs Tech Logic

 Separate domain specific logic from framework, support or general tech specific logic.  Also, don't' write domain specific logic. :)  That sh** should be no coded.  #Software #Architecture  @MMJetpack  #NoCode

Separation of Concerns: Infrastructure & Compute

Separate Async processing compute from compute hosting end user occupied threads.  They have different scaling, security, acid compliance, eventual consistency and other concerns.  #Software #Architecture #infrastructure #microservices 

Typescript ( Declarative Polymorphic Type Safety in General ) Allows for Aggressive Solutioning

  Me, in another role, to a lead engineer on the team, who is so bogged down in code reviews now that the team is more than 3 engineers that he's become a bottleneck.   What I want to say is "You know, if we had tyepscript, we wouldn't’ need you to spend as much time reviewing. You know that right? like,  yeah, w e can be a lot more aggressive with typescript…". He felt he needed to be involved in every MR to thoroughly   vett  and scan for issues caused by a lack of tribal knowledge. He didn't catch the irony in that sentiment, given how vehemently he had rejected typescript, which does that job automatically, and near instantaneously, at compile and develop time, early in the process, and well before a complex change has come in as a merge request. Background, our lead doesn't like typescript because the first time we tried to apply it, he lost half a day trying to get  his local env building. We then had a debate on the team, on whether or not to ...

Twitter Removes Security from User's Accounts Without Consent. Not a Great Plan.

Twitter did this https://blog.twitter.com/en_us/topics/product/2023/an-update-on-two-factor-authentication-using-sms-on-twitter " After 20 March 2023, we will no longer permit non-Twitter Blue subscribers to use text messages as a 2FA method. At that time, accounts with text message 2FA still enabled will have it disabled. " Anyone who is inactive for a while, will simply have a reduction in security that they did not explicitly authorize. These people are extremely vulnerable.  This is just, bad.. really bad. Never do this. I'm curious if the motive is the cost of supporting text based 2fa. They pose it as a security improvement but if you are reducing peoples existing security levels without their express consent, that's not great. It will disproportionally affect people who are least closely monitoring their twitter accounts during this period.   It may be okay for them to say that anyone who hasn't switched to app based auth will be allowed to login "n...

Please use #plantuml for all new designs.

Nothing helps you get your head around a problem, and convey concepts to your team like visuals.  A picture is worth a thousand words" - somebody smart said that. Being able to understand the problem(s) and the solution before ever writing a line of code is clutch. https://plantuml.com/ You want to minimize time spent discussing with other engineers? Put a diagram in front of them. DONE. It's like magic. Except more powerful. It's like coffee. #Software #Architecture #Coding #Engineering 

Use Angular

That's it... that's the whole post.  OH and don't use react. More on this later.  Also react hooks are not good. State management and separation of concern in react is a nightmare.  Also React doesn't read good.

Boolean Logic, Conditionals, If, else, then..etc, in Code is BAD

Conditional blocks in code, generally mean a developer merged something.  A developer took two separate concerns, and squashed them together.  And now the compiler can't tell what data the method or model needs, because it depends. So now a developer has to read your method, or your (hopefully) well written documentation, to figure it out.  In methods, this is also highlighted by the presence of "behavior modifiers". Booleans or enums in the method signature that make the function, have another function.... In state encapsulations, these are usually fields that have different constraints or usages or meanings or requirement status, based on the value of other fields. I call this "Conditional Relevance" or "Conditional Meaning".  Essentially the developer is saying that this object  is one of two or more different objects and should be handled differently depending on what values are set on one or more of its various fields.  The problem is there again,...

Component Architecture

 "Component Architecture" (Because I can't think of a better title ) Domain specific modules should generally not be made into libraries Generic tech frameworks can be split this way. Domains should be split vertically into #microservices. Libraries are for reusable code. If your code is domain specific it has little to no reusability TODO: More to follow... maybe

Designing and Building Software Solutions

Don't build to ship, build to build. Don't ship your prototype. Iterate, on both the produced product but also the process that produces it. #Software #Coding #Engineering  

Type Safe Programming Isn't About You, It's about Friendship

Type safe programming, is less about saving you time as the author, and more about saving your fellow and future developers time as the reader of your code. If I have to recursively scan through 3-4 ( or possibly many more ) layers of nested implementation code to understand why a parameter is used or what its constraints are.. Yeah, type safety saves you time. Also what happens if those constraints change.... Please respect your fellow devs. Use a type safe language.