Skip to main content

Posts

SHORT TECH NOTE | Are you using 'FInal' keyword in the right way?

 'Final' keyword is a powerful modifier used in Java and in other OOP languages to denote that a given construct is no more extensible. Rather than a mere keyword, I would argue it's a 'key trade off'  decision, by looking at the future and arriving at the conclusion  whether we should really allow further extensibility in a given construct or limiting it.  The final keyword is applied at 3 levels; at class level, at method level and at field level. It's a simple decision to decide whether or not one should apply the 'final' keyword at method or field level, so in this short note, I am focusing on the 'final' at the class level.  By using the 'final' keyword in front of a class, you are essentially sealing the class off and preventing any further 'extensibility' of it, violating one of the SOLID principles, 'open to extension and closed to modification'. This violation means that you cannot create a subclass to add the new...

Harnessing Computational Power used for Proof-of-Work in Block Chains

Harnessing Computational Power used for Proof-of-Work in Block Chains I t's well known that proof-of-work carried out by miners to add a new block to the block chain requires lot of computation power. This power is used to find a hash value matching to some random value. The purpose is to make the block adding process exhaustive such that fraudulent behavior will be discouraged. I was wondering , perhaps in the future, that there will be a motivation to adapt a new kind of proof-of-work such that, the miner will be required to carry out a useful X amount of data processing tasks and provide the proof. Such a trend would open up the opportunity for the organizations/individuals to outsource their data processing tasks and issue a token of task completion? perhaps. An example to simply this idea is, those organizations wish to get their data processed, publish to a public queue and the miners will pull the jobs off to execute them, which would ultimately be published to a pr...