Naming is the most important part of design. Concise yet meaningful names are hugely important.
One of my top recommendations to improve legacy code, is to improve & clarify naming. Names should be short and sweet, yet meaningful. For example — Customer.Name.
Blocking methods in Java often declare they may throw InterruptedException. How should we handle it?
In this article, Brian Goetz explains why rethrowing it is usually the most correct approach.
Documentation is important. All of us have experienced the challenge of finding the documentation we need, and most of us have struggled to try and write well. But it need not be so difficult.
Following is an easy approach plus a few guidelines that will help to produce & maintain real, usable, documentation easily.
Eclipse recently has suffered increasing numbers of questionable autocompletions — sometimes auto-wrongly replacing perfectly good code typed by the developer.
While there might be a few underlying issues, I found replacing “map.put()” with “map.compute()” particularly annoying and went to investigate. Here’s the solution.
Just today, I found the “amusing” fact that Tomcat server developers have taken it upon themselves to delete support for the HTTP Status Reason.
Think “200 OK” or “404 Not Found”. Even for applications sending a reason & clients expecting it, Tomcat is coded to explicitly drop the value — sending just a bald 200 or 404.
Unsurprisingly for those with the slightest knowledge of protocol compatibility, this is now breaking clients in the wild.
When processing SQL data in Spark, sometimes single rows are not the right unit — your calculation may need a collection or group of records as input.
This post shows how to group SQL data for use in Spark. Continue reading
Today I got a very unusual error while trying to debug the DeepLearning4J framework.
Conditional breakpoint encountered runtime exception. Reason: java.lang.InternalError: Got MethodID of ReferenceType that is not a member of the ReferenceType occured retrieving stack frames.
Continuing last month’s theme of searching Git history — here we look at how to find the source of changes, even after other people have worked on (or reformatted) the area in question.
The question: which commit actually introduced a given string into the file? Continue reading
Great post on inheritance from the Sicpers blog, and why — as a concept — it often fails in OO languages such as Java.
This blog post can help you understand why:
- “Cat and Dog extend Animal” is poor use of OO.
- “Square extends Rectangle” is poor use of OO.
From my own experience, I’ve moved to primarily using inheritance in only two ways: Continue reading
Working on many separate enhancements.. How to find which branch my changes to a particular file are on? And if a file was deleted, how can I find that?
Luckily, Git can help us! Continue reading