RSS

Category Archives: Sweet Sixteen

Embrace the Change

Episode 33

Everything changes and nothing stands still.

-Heraclitus

          Software changes. Technologies change. Build systems change. Deployment environments change. Requirements change. Markets change. Clients change. Some people refuse to change though. How to deal with all that fuss without losing sanity?

Wind of Change

          This week’s episode of How To Train Your Java is hosted outside of the usual place, namely on my company’s tech blog, right here. Enjoy :)

Sweet Sixteen

          By the way, if you happen to be in Wrocław, Poland in four weeks from now and you are not afraid of Polish language, you are welcome to join my talk on principles in object oriented programming. I’ve titled it Sweet Sixteen (since there will be 16 principles). Its free, includes beer and pizza, you just need to sign up on the event page, right here.

          In the next episode I will do something I haven’t done for quite some time. I will show you some actual code. Stay tuned.

embrace the change

 
2 Comments

Posted by on September 1, 2016 in Agile, Sweet Sixteen, Technology

 

Tags: , , , ,

I know what you committed last summer

Episode 31

            As promised, the continuation of Code of Principles is here. This time I’m going to talk about stuff that is less canonical and perhaps not so well known. Today’s motto is that you are not alone. There are strangers, psychopaths, users, fellow developers and good scouts out there.

Don’t talk to strangers

StrangerDanger_NeighbourhoodWatch_FINAL_ybg

            Let’s discuss Law of Demeter also known as Principle of least knowledge. Proposed in 1987 by Northeastern University, can be informally described in four bullet points:

  • You can play with yourself (naughty boy).
  • You can play with your own toys (but you can’t take them apart).
  • You can play with toys that were given to you.
  • And you can play with toys you’ve made yourself.

Which basically means that object should assume as little as possible about its environment, surroundings, its structure, properties and anything else, especially about Read the rest of this entry »

 
3 Comments

Posted by on August 18, 2016 in Clean Code, Sweet Sixteen

 

Tags: , ,

Code of Principles

Episode 30

            Enough about recruitment, let’s get back to code. This article is (more or less)  going to be a continuation of Rock SOLID Code. I’ve talked about five principles forming letters in the SOLID acronym, now I’m going to talk about further set of well known (hopefully) programming (and not only) concepts.

(K)eep (I)t (S)imple, (S)tupid

kiss problem

            “Everything should be made as simple as possible, but not simpler.” Albert Einstein once said. KISS acronym was coined by Kelly Johnson, U.S Navy engineer in the sixties. Basically, simple thing doing the same job as complex thing is better. It’s easier to understand which means being less error-prone, easier to maintain, cheaper and more efficient. Always try to Read the rest of this entry »

 
4 Comments

Posted by on August 11, 2016 in Clean Code, Sweet Sixteen

 

Tags: , , , , ,

Lightning Fast Code

Entry 15, Day 51

As promised, today’s episode is going to be about low-level optimization. First, a quote.

„Premature optimization is the root of all evil”

   – Donald Knuth

Yes indeed. We all love when things go faster than slower, but deadlines are tight and working, stable software with acceptable performance is better than software which is fast but unstable or not working at all. There is no point in tuning your Java computation to take 5 milliseconds instead of 50, when you are going to wait for database query that takes 5 seconds (optimize the query, maybe?). Also, in case of web application, there will be network latency of tenths or hundreds of milliseconds. Another issue is code readability. Sometime, to run faster, the code has to be more complicated and that’s always pain in the ass…

the-profound-programmer1

So when to optimize?

First, get to know your API. There are many small problems, that are already solved by standard Java library. And solved well, for example using Read the rest of this entry »

 
4 Comments

Posted by on September 21, 2014 in Clean Code, Sweet Sixteen, Technology

 

Tags: ,

Rock SOLID Code

Entry 12, Day 27

          You came back to me, good, good. As I’ve promised, this episode will be about SOLID. What’s that? It’s an acronym for five fundamental principles in object oriented programming coined in early 2000’s by Michael Feathers and Robert C. Martin (aka Uncle Bob). I’ve added Michael’s and Robert’s blogs in Places section, it’s highly recommended reading. Each principle is also covered by an article under “Read more” link. There are C++ examples, but it doesn’t really matter, ideas are valid for any statically typed language.

Now, let’s get down to business. Letters in SOLID stand for:

(S)ingle Responsibility Principle

          A class should have one, and only one, reason to change. Class should do one thing. Or broadly speaking, the context (method, class, package, module, etc.) should have a single responsibility and that responsibility should be encapsulated by this context. Why? Imagine a Read the rest of this entry »

 
5 Comments

Posted by on August 28, 2014 in Clean Code, Sweet Sixteen

 

Tags: , , , , ,