Monday 22 June 2009

A late news years resolution

I have decided to stop learning new programming languages unless I have a use for it that no other language will cope with. This year so far I have taught myself Objective C, Erlang and Haskell.

Not that I've actually had a use for them. I can get what I want done in C, C++, Java, Perl, Python, Ruby, Tcl/Tk or Lua (or any other language that I might know). Learning programming languages has been getting in the way of me writing code. Also no new technologies for the same reason.

My Amazon wish list is now three pages shorter.

My resolution is therefore to write the actual applications!

Interesting things are the bane of my life.

Wednesday 17 June 2009

"All this useless beauty"

There is a phrase "Photoshop designer" which I use to identify those designers who design websites in photoshop which the client then signs off without it ever passing the desk of the person who has to code it. Now I know that it is possible to go from a psd file to nice clean html. There are even companies who do nothing but that.

But why all this pain?
  • What font is that?
  • What is the hex for that colour?
  • Spacing and paddings, are they in ems, px or %?
  • How does the page behave when resized?
  • How does the page behave when there is real data in there?

Imagine that an architect delivered his design for a building as a couple of water colours and 1/50th scale model. Sure you could reverse engineer quite a bit from that but the architect is on your side so he will also give you blueprints and a list of materials.

The "Photoshop designer" on the other hand is your enemy, why else would he give you a jpeg full of "Lorem ipsum dolor sit amet, consectetur adipisicing elit..." and expect you to build a website.

Because he hates you.

Tuesday 16 June 2009

Looking good, feeling bad

What do you feel about the following line of output?

20 tests, 20 assertions, 0 failures, 0 errors

Happy, sad or nervous?

Well Ruby helpfully generates the scaffolding for tests whenever you create a new controller. They look like this:

require 'test_helper'

class HomeControllerTest < ActionController::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end

So I have just tested that true does really equal true, twenty times. That warm fuzzy feeling is changing into a nervous tick. I propose a new rule, tests should actually test something or delete them.