Run gradle project as java application

18 07 2015

gradle run

is not a default task in gradle. To use it, you need to enable the ‘application’ plugin. To enable the plugin add this line to your build.gradle:

apply plugin: 'application'

This plugin requires one variable to be configured – the main class name:

mainClassName = "com.looksok.Main"

Now you can execute the

gradle clean build run

to run your app





Web development done well: WordPress web coding standards

11 10 2014

We all know that mess that grows in CSS, JavaScript and HTML files. There is no compilers as in static typed programming languages that will keep you from doing that mess bu there are Clean Code standards.

The team working on files should keep common standard and follow best practices. It is a failure if each team member has his own preferences and style and writes his parts with his own conventions. WordPress recommendation is:

"All code in any code-base should look like a single person typed it, no matter how many people contributed." – Principles of Writing Consistent, Idiomatic JavaScript

WordPress has its standards. Due to its opensource nature these are vital to keep an order in their web templates and sources. I follow most of their recommendations:





Clean code: Error-proof and testable code

30 03 2013

Continuing the previous post, here is another video. This one is lot more packed with concepts and best practices, so it is impossible to catch everything after first watch – one would have to consecutively come back to it and analyze particular clues. Slides are not very good in my opinion, however concepts and talk is worth watching and remembering.

There is a lot of concepts here, all worth attention. It is about Dependency injection, SRP, OCP, Manager / Processor classes, Law of Demeter, Null checking etc.

Do you like my blog?
I manage this blog and share my knowledge for free sacrificing my time. If you appreciate it and find this information helpful, please consider making a donation in order to keep this page alive and improve quality

Donate Button with Credit Cards

Thank You!





Clean Code: Dont use if’s! Use polymorphism instead

23 03 2013

Writing clean code is crucial, so the software developer constantly needs to improve his skills and code understanding.

My way to do it, is to explore others’ best practices. Here is one of them to consider:

I am not fully convinced that all the if‘s shall be refactored and removed, however the example given is much cleaner with polymorphism. Moreover it is testable and deprived of code smells and arguments of this guy seems to be reasonable.

You may also want visit the Anti if campaign page :) – Thanks Maciek!

Do you like my blog?
I manage this blog and share my knowledge for free sacrificing my time. If you appreciate it and find this information helpful, please consider making a donation in order to keep this page alive and improve quality

Donate Button with Credit Cards

Thank You!








%d bloggers like this: