Programming Patterns Are Your Happy Little Friends
Friday • May 12th 2023 • 10:59:57 pm
The sweet and tiny things in the world of responsible programming, can be called strong and common solution patterns.
And what is even cooler, is that you already know them all, just by poking at various programs and web pages.
The uncommon patters, are rare, because they are unstable, or can’t translate well, between the world of mobile and desktop.
The uncommon patterns are great entertainment, for when you are learning, or try to invent something new.
But if they end up in your program on Launch Day, you will discover that you will regret using them at launch.
Launching a product is a very delicate process, and there is a great deal of confidence in common solution patterns.
For example, use a plain drop-down box for when user needs to select from a set of options, you don’t need a fruity fruit-loop fruit cake with transitions.
Because the one thing you can be certain of, is that a notable percent of your users, will be using fruity computers as it, an old RaspberryPI, a once proud ATM machine that was then stolen…
A god damned electrolyte powered potato, which happens all the time.
And of course a fleshy fat butt-dialing butt, that yearns for a box Covfefe, “despite the constant negative press”.
Aside from being common and reliable, all the solution patterns that you are familiar with, are powerful.
After all you are seeing just the end-user interface, there is usually a very good programming reason right beneath.
One of my favorite programming patterns is a record browser, because records in a database table always have the same fields.
That is a constraint that comes from relational databases, which themselves are a pattern.
The databases just uses three simple functions, union, difference, and intersection, along with lesser stuff like chunk filter and map.
When performing operations on two tables of data, where every row is a record; or user account, or email message, or item in a cart...
And the columns, are just labels for things like username, from, to, price, date, you need a stable set of fields.
So if you are going to make a list of logged in users that have stuff in their shopping carts, you will perform an intersection on username filed in logged-in table, and username field in shopping-cart table.
An intersection creates a list of unique values that are included in both tables, so logged in, with stuff in the shopping-cart.
So now look at what you can make, you got a list of rows in a table representing users, or carts, or users witn stuff in carts.
That means you already have a list of fields, that you can put in your GUI, you can generate a solid guess, and then let the user tweak it.
On top of that, if you just add a previous and next button, you can now move between records, go up and down the table.
If you add a search field, you now have a search engine, that will only return a list of matching rows or records, or users, or users with stuff in their cart.
Repeat this 20 minute process a few times for different tables and you just built a company management application.
Add a few wizards, which is a common pattern as well, which is where you have a next button to continue filling out some form.
And now you are capturing complex procedures that once required a specialist, and now it is just a wizard.
And then add reports, where you sum, average, or map and reduce long columns of fields spanning countless records.
And decorate them, with a line or pie chart.
On the surface, you see search, previous, next, most of the fields in a pretty form.
But beneath, the reason why the UI looks tis way, is that you are just moving up and down a list of rows.
Directly over an actual database table, or a virtual table that does some different or intersection…
And perhaps picks many different fields from the multiple tables it merges, creating a new table to browse.
There are many ways to do database editing, an infinite number of ways.
But you just need this one, it is simple, lovely, the GUI sits right on top of the table or query result.
And you got it all, an easy way to edit, search, navigate, make reports, and automate company processes by means of a wizard…
That now goes out to edit multiple tables, but only step by rational step.
You already know the patterns, learning what is under the hood, is fantastically easy, motivational and educational.
You don’t need to know much, you just look at the program, how it works how it flows, and the it will hit you… oh, that is so simple.
Yes, it must be, simplicity means low cost, low maintenance, little refactoring…
No chance to disgrace yourself, by calling the first version, a reference implementation, as if you planned to create a wreck, on purpose.
Finally, that all that means, is that the world of responsible software development, is small.
It is easy to master, friendly, brilliant, and rational, and it is not scary or intimidating at all.