Skip to main content

Getting Real

getting real

When a colleague recommended a book from 37singals I was skeptical, to say the least, not because it is a bad company, but I do kind of find them very cocky and also my first impression was "Isn't that going to be a something about Ruby?". But  I gave it a try and liked it enough to write a few good words about it.
So what is this book about? In my opinion, it's about agile software development at its core and to quote the authors "Getting Real" is a book about:
The smarter, faster, easier way to build a successful web application.
When I started reading it became obvious right away that this book is a great collection of short stories, tips, quotes and lessons from various companies and software developers and not just 37signals, although it had some very good ones from them also. In some places, the authors were direct about what is their standing, sometimes even cocky but definitely in a really good way.

Getting Real is about doing software with fewer features, fewer docs and less of everything that is not essential. The authors goal is to show a way of doing the software version of the famous Einstein's quote:
"Everything should be made as simple as possible, but not simpler."
The books are organized in various chapters about "priorities", "staffing", "code"... where there are great lessons like:
  • "It's a problem when it's a problem" 
  • "Hire the Right Customer"
  • "You can't Fake Enthusiasm"
  • "Actions, Not Words" and,
  • "Start with No"
While I can't say that I agree with them on all of the lessons I can say  for sure it's a book that should be on every programmer's reading list. Another awesome thing is that, even though, the book can be ordered in hard copy from places like Amazon, 37signals have made it available for free in pdf on the book's site.
I will finish with a quote found in the introduction that is not originally intended for software development, but it fits like a glove:

Vigorous writing is concise. A sentence should contain no unnecessary words, a paragraph no unnecessary sentences, for the same reason that a drawing should have no unnecessary lines and a machine no unnecessary parts. This requires not that the writer make all his sentences short, or that he avoid all detail and treat his subjects only in outline, but that every word tell.
                        -    William Strunk Jr., Elements of Style

Popular posts from this blog

HTML 5 data-* attributes, how to use them and why

It is always tempting to add custom attributes in HTML so that you can use the data stored there to do X. But if you do that there is no way of knowing if your HTML attribute will not be overridden in the future and used for something else and additionally you will not be writing valid HTML markup that can pass HTML 5 validator and with that you can create some very bad side effects. That is why there is a spec in HTML 5 called custom data attributes that enable number of useful features.

You may go around and read the specs, but the basic idea is very simple, you can add any attribute that starts with "data-" and that attribute will be treated as non-visible data for that attribute. By non-visible I mean that it is not something that gets rendered to the client so it does not affect the layout or style of the page, but it is there in the HTML so in no way this is private.
So let's get right into it, the following snippet is a valid HTML5 markup

<div id="aweso…

Basic Authentication with RestTemplate

Spring Rest Templates are very good way of writing REST clients. By default they work with basic HTTP so if we need to use Basic Authorization we would need to init the rest template with custom HttpClient. This way the Rest Template will automatically use Basic Auth and append to the HTTP headers "Authorization: Basic BASE64ENCODED_USER_PASS".

HttpClient client = new HttpClient(); UsernamePasswordCredentials credentials = new UsernamePasswordCredentials("USERNAME","PASS"); client.getState().setCredentials( new AuthScope("", 9090, AuthScope.ANY_REALM), credentials); CommonsClientHttpRequestFactory commons = new CommonsClientHttpRequestFactory(client); RestTemplate template = new RestTemplate(commons); SomeObject result = template.getForObject( "",SomeObject.class );

In EE application this would probably be managed by DI framework like Spring Core and only initialized once sin…

Temporary files and directories in Java 7 and before

Sometimes we want to create a temporary file, whether to save some data that gets written by some other application or just to temporary store stuff. Well, usually applications have their own temporary folder where they do this and it gets somehow configured. But why not use the underlying OS specific file like "/tmp/" in Linux so there must be some system property that has this info and there is. The key is "" resulting in "/tmp" in my case or by code:
String tempDir = System.getProperty(""); We can use tempDir  folder as a temporary place to store files, but there are a lot nicer ways to work with files like this even in JDK6 not just in JDK7:
import; import; import java.nio.file.Files; import java.nio.file.Path; public class TempFile { public static void main(String[] args) { try { // create a temp file File tempFile = File.createTempFile("old-file",…