HNHacker News
TopNewBestAskShowJobs

rowland_street

162 karma · joined October 26, 2019

submissionscomments
rowland_street··on Generating a Java program with 90% less code
I've been a professional developer for 10 years at several mid size companies. I've led teams for a large proportion of that time. Not claiming to know everything, still learning. I'm just writing up my thoughts at this time, they do change (they often cycle).
rowland_street··on Generating a Java program with 90% less code
This twitter account will find its way through to me https://twitter.com/LLambdas
rowland_street··on Generating a Java program with 90% less code
I wrote this article, I'd just like to clear up my intent.

Firstly the Java patterns. Obviously it's not really necessary to use them for my toy example, but I don't want to write a blog about a full scale enterprise app. I have seen multiple tech teams at different companies evolve separately towards using similar patterns in both Java and C#. Doing so solves problems in concurrency and maintainability (This is documented in the other blogs on the Unitily site https://www.unitily.com/learning.html). I've seen teams be very successful using them. I like Java. Im not criticising it, I'm trying to explain why people do.

UnitilyLang doesn't exist, I'm not writing that language, the examples in that article are the only code snippets I've ever written (and probably ever will). The point is that there is a one to one mapping between that representation and the java code using the described patterns. This highlights the extra code you have to write in Java (and similar languages) just to support the clean code patterns.

Sure if you used Kotlin or Closure (or any functional language) it becomes less of an issue, and this is exactly the point I'm trying to make. However, its rare you have the option to choose a language, so developers end up coding in Java and complaining about it.

I don't like the new title the moderators have created, (perhaps the my initial one was a bit click baity) but generating code is only mentioned once in the last paragraph. The point of this article is to highlight that once you follow a set of coding principles which solve specific problems you are going to have to write extra code to do so. Perhaps something like

Writing clean code in Java requires boilerplate, learn to love it.

would have been a better title.

The video demo at the bottom of the article generates the code from pictures not UnitilyLang. These pictures are tightly coupled to the specific coding patterns, but is (in my opinion) a more natural definition than both Java and UnitilyLang.

rowland_street··on Writing clean code can get as repetitive as bricklaying, use a machine labourer
yes, but our definition of boilerplate is probably wider than usual. e.g. class definition, constructor injection, junit test layout: @beforeAll, @beforeEach etc. Main method/entrypoint construction of all units. As well as package management deployment etc.

i.e. we consider the majority of your application project to be boilerplate, all except your core business logic. This allows you to generate pretty much everything other than your core functions.

rowland_street··on Writing clean code can get as repetitive as bricklaying, use a machine labourer
thanks for posting the video demo link, you probably want to skip the first video in the play list if you want to see the app (and not marketing nonsense)
rowland_street··on Writing clean code can get as repetitive as bricklaying, use a machine labourer
yeah no excuse for not running it through a spellchecker, thanks
rowland_street··on Writing clean code can get as repetitive as bricklaying, use a machine labourer
Yeah perhaps it should, Im new to hacker news and maybe missing the etiquette.
rowland_street··on Writing clean code can get as repetitive as bricklaying, use a machine labourer
Not yet, but this is definitely a goal. Lightning Lambdas is the main app around the unitily tech at the moment, we're keeping the scope as small as possible to start with (AWS). We hope to build and Lightning Lambdas with itself soon.