2020-06-26

Domain Oriented Programming



The software that we write often invokes other software to get parts of the job done. These are known as Services or Dependencies. If Class A is making use of some Class B, then Class A depends on Class B, so Class B is a dependency of Class A. The principle of Dependency Inversion (says that a class should not contain any hard-coded direct calls to specific instances of any of its dependencies. Instead, it should receive these instances as parameters during initialization.

That's all very nice, but passing dependencies around can become quite a complicated business, and in large systems it can become a nightmare.

2020-05-30

On Validation vs. Error Checking

Let me start with a couple of pedantic definitions; stay with me, the beef follows right afterwards.

Conventional wisdom says that validation is different from error checking.

Validation is performed at the boundaries of a system, to check the validity of incoming data, which is at all times presumed to be potentially invalid. When invalid data is detected, validation is supposed to reject it by returning an appropriate result, not throwing an exception. Validation is supposed to be always on, you cannot switch it off on release builds and only have it enabled on debug builds.

Error checking, on the other hand, is performed inside a system, checking against conditions that should never occur, to keep making sure that everything is working as intended. In the event that an error is encountered, the intent is to signal a catastrophic failure (throw an exception) instead of causing some result to be returned. Essentially, the term Error Checking is shorthand for Internal Error Checking.  It can be implemented using assertions, thus being active on the debug build only, and having a net cost of zero on the release build.

So far so good, right?

2020-04-01

Index of GitHub projects

mikenakis-rumination

Making plain old java objects aware of their own mutations.


mikenakis-testana

A command-line utility for running only those tests that actually need to run.
https://blog.michael.gr/2018/04/github-project-mikenakis-testana.html

mikenakis-classdump

A command-line utility for dumping the contents of class files.
https://blog.michael.gr/2018/04/github-project-classdump.html

mikenakis-bytecode

A lightweight framework for manipulating JVM bytecode.
https://blog.michael.gr/2018/04/github-project-bytecode.html

mikenakis-agentclaire

A Java Agent to end all Java Agents.
https://blog.michael.gr/2018/04/github-project-agentclaire.html


2019-12-01

On Software Testing

At some point during his or her career, a programmer might come across the following argument, presented by some colleague, partner, or decision maker:
Since we can always test our software by hand, we do not need to implement Automated Software Testing.
Apparently, I reached that point in my career, so now I need to debate this argument. I decided to be a good internet citizen and publish my thoughts. So, in this post I am going to be deconstructing that argument, and demolishing it from every angle that it can be examined. I will be doing so using language that is easy to process by people from outside of our discipline.

In the particular company where that argument was brought forth, there exist mitigating factors which are specific to the product, the customers, and the type of relationship we have with them, all of which make the argument not as unreasonable as it may sound when taken out of context. Even in light of these factors, the argument still perfectly deserves to be blown out of the water , but I will not be bothering the reader with the specific situation of this company, so as to ensure that the discussion is applicable to software development in general.



In its more complete form, the argument may go like this:

2019-10-09

Red Heart Stickers

In this post I am documenting sightings of these red heart stickers.
If anyone knows what these are, who sticks them, what for, please do let me know.


2019-07-05

Bypassing the blocks to The Pirate Bay


If you try visiting The Pirate Bay from Holland nowadays, you are very likely to be disappointed. Your internet provider will most probably block your access with a page like this: https://blocked.t-mobilethuis.nl/

This is, of course, completely unacceptable. 

But while we are sitting around wondering when the revolution will start so that we can round up all those responsible for this situation and send them to the forced labor camps, it would be nice if we had some means of bypassing the block. 

Here is how:

2019-04-23

Samba (SMB) on Ubuntu

Right out of the box, an Ubuntu 18.04 machine will not see any Microsoft Windows machines on the network, and Windows machines will not see it.  Unfortunately, there is an incredible amount of work necessary to get it to work properly.  So, here are my notes on setting up an Ubuntu 18.04 Linux workstation to act both as a Samba server and as a Samba client in a Windows Workgroup.

Server


2019-04-21

Clipboard Managers for Ubuntu as of April 2019

I have been researching clipboard managers for Linux, (Ubuntu with Gnome,) and I am recording my findings here for the benefit of others.


2019-01-29

Medium.com: Psychology of Code Readability by Egon Elbre

This is an article I enjoyed reading.  I am in full agreement with every claim made therein. It was very nice to see certain conclusions that I have arrived at in the past being spelled out and illustrated with nice explanations.

https://medium.com/@egonelbre/psychology-of-code-readability-d23b1ff1258a