Wednesday, November 19, 2008

Report from Öredev day 1

Keynote with Ted Neward

The renaissance in development, according to Neward, is the renaissance of programming languages. The reason the renaissance is here is that the practitioners and the academics are, finally, working towards the same goal. Historically there has been downright hostility between them. This is because the academics and the practitioners are working towards different goals. The academics want to prove a concept while the practitioners wants to get work done. When the practitioners finally get what the academics have done the academics have left the project years ago.

Three forces work together to create the renaissance.

  • Virtualization – virtual machines allow programmers to ignore the low-level details and to focus on the real problem. The same is true for language designers.
  • Tools – IDEs, analyzers, debuggers, profilers, etc. are used by programmers and language designers use parser generators, AST generators, grammar debuggers, etc.
  • Linguistics – Functional languages introduce new ideas, at least to the common programmer. Languages become more diverse to conceptualize different constructs, not everything is an object anymore. We have functions, aspects, meta-object protocols.

Technical challenges of the next generation are for example

  • Concurrency
  • Security
  • Distribution and services
  • User interface expression

There are more languages than ever and it is easier than ever to create your own language.

5(2) aspects you’ve never heard about by Alef Arendsen

Started with a quick introduction to AOP for logging. AOP is about the three Ws: Where?, When?, and What?.

Before, a business service, log a message.

  • A pointcut is an expression for finding a number of joinpoints.
  • A joinpoint is a place where you can inject an aspect.
  • An advice is the code that is injected in the joinpoint.
  • An aspect is the combination of a pointcut and an advice.
  • Pointcuts should always be singular.

Aspect 1: Mixing Hibernate and JDBC usage

Hibernate uses transactional write-behind which will put the database and the cache out of sync. If I try to access the code via JDBC it will not get the correct data.

This can be solved with an aspect that flushes the cache to the database before a JDBC call is performed.

Before any JDBC operations flush the Hibernate session.

Aspect 2: Specific criteria should be applied based on orthogonal data.

I only want to get data from a specific location when performing a query.

Before a top level business service propagate location and after a top level business service delete location.

The advantage of this approach is again that it applies to both the Hibernate code and the JDBC code. It requires adding views to the database, but that would probably be a good idea anyway.

Dynamic Languages on .Net with J. Hartley

In five years we will look at compilation as the weakest form of unit testing.

Jim started out by saying that Ruby is not just simpler, but better :) Generics in C# is nice but it comes at a tremendous cost of obscuring the actual code.

IronPython supports Decorators to allow adding functionality through attributes. It will be supported in Visual Studio in 2009. An IronPython ScriptingEngine can be embedded into an application with a just a few lines of code.

What makes a programming language productive by Walter Bright

The D language is created by a diverse community of experts. It is a multi-paradigm language that supports c-style, OO, scripting, template metaprogramming, assembler, and functional programming. It is meant to replace C++.

The right way is the easy way. Work harder to do it the wrong way.

D supports simple template syntax. Header files are optional, type inference, foreach loops, reducing the source code with 30 percent compared to C++.

Diversity Challenges in Agile Teams by Aslam Khan

Writing software is cerebral but EQ overrides all IQ.

Leadership is taught to all, but followship is never taught.

Tuesday, November 18, 2008

Time for Smalltalk

Öredev is coming up and I’ll be giving a talk called Time for Smalltalk. The title of the talk is supposed to imply that the time for Smalltalk is finally here. I claim this since the publicity of dynamic languages like Ruby and Python has paved the way for Smalltalk. Only a few hardcore developers are still resisting the power of modern IDEs, so the barrier of Smalltalk adaption is considerably lower than it was a in the beginning of the eighties when Smalltalk first arrived.

The reason developers in dynamic languages should switch to Smalltalk is that the Smalltalk environment is alive. You are working inside a running system and instead of constantly trying to create new worlds, the Smalltalk way is to modify the world to fit your needs. This metaphor fits a lot better with the way good systems are usually developed. Start small and let the system grow incrementally.

The liveness property of Smalltalk also gives you the ability to refactor the code in a safe way. At runtime I can just ask the system in what classes a certain method is implemented and then I can let the system rename it as I wish.

Three of my new colleagues from factor10 Jimmy Nilsson, Aslam Khan and Lennart Ohlsson will also be speaking at the conference.

Saturday, November 08, 2008

What should be in an application 2008?

Listed here are features that I want in any application. The features are separate from the domain specific service that the application is designed to provide.


The feature that I want more than anything is search. Everything should be indexed: menus, toolbars, dialogs, windows, selection boxes, shortcuts, help files, configuration files, application components, objects, scripts, the works! It should be possible to make generic full-text searches for anything matching my criteria, but it should also be possible to make specific searches by category or tag. It should also be possible to save the searches for later.

Search should also be available in all places possible. It does not have to be a search field, it can be a selection box or a textfield. It should preferably be integrated into the components to help me out whenever it is possible.

External tools should also be able to search. Tools like Google Desktop and Spotlight, and Launchers like Quicksilver and Launchy must be kept in mind when designing for search.


Anything searchable should also be taggable. It is possible that my terminology is different from the one that the application developers have. I may also want to group things together that does not appear related to anyone else. It should of course be possible to assign multiple tags to the same thing.


Everything should be scriptable. Whatever is possible to do in the GUI should be possible to script. This lets me create my own automated tasks that I can re-use later or share with other users. It should be possible to run and create the scripts both inside and outside the application. The scripts should not be limited to use application functionality, they should be allowed to call operating system commands or other applications. The scripts will thus also serve as plugins for the application.

As with search it is important to have external tools like Quicksilver and Launchy in mind, but when it comes to scripting the scope is wider and you need to think about command line interfaces and other external applications too. Provide many entries to your application.


It should be possible to assign shortcuts to any action available in the system. This includes saved searches, tags and scripts. Shortcuts should allow Emacs-style multi-key-shortcuts, such as Ctrl-C, Esc-V, M.


It should be possible to save the state of the application at any time!. It does not matter to me that a form or that whatever I’m doing is an invalid state. Perhaps I like invalid.

It should be possible to save it anyway. It should also be possible to take snapshots at any time and to reset the application to a previous snapshot at any time. Preferably it should also be possible to compare different snapshots with each other in a useful way.

All in all I want persistence to work like a versioning system giving me the possibility to move through history at my leisure.

Export – Import

Exporting is just a different flavor of persistence. It should be possible to export (persist) the application data into some format that is useful to another similar application. This format should naturally also be importable.

Since exporting is just a flavor of persistence I naturally want versioning of my exports to. Perhaps it’s a good idea to just use git as a persistence engine?


I mentioned validation above on persistence. Validation is a valuable tool in an application but more often than not it gets in the way. The validation should not force me to enter data in a specified order unless it is absolutely necessary. It is good and even helpful to provide hints and markers along the way. But let me work the way I want to work and stay out of my way.

The important thing with validation is that it should indicate an error as soon as it appears but it should not force me to do anything about it until whenever I try to do something fatal such as, to quote Simon Peyton Jones, launch missiles.


I find it really helpful to be able to link things together in Wiki style. The need for this is very dependent on the type of application but I find it very useful to be able to relate one item to another when I commonly need them together.


This list is by no means meant to cover everything, but I think it is a good starting point for anyone who want to make a useful application that can evolve with time.

Friday, November 07, 2008

How (not) to buy books

If you, like I, read a lot of books from different areas you probably buy a lot of books that are of questionable quality. I used to do this too. Now, I use libraries instead. Some of the advice here will be specific to Sweden, since this is where I get my books, but you can probably find similar places where you live.

  • Find the book you want. If it is an English book Amazon is the place to go. If it is Swedish use Bokus or AdLibris. The value of these websites is that they provide a lot of information about the book, such as summaries, reviews and references to other related books. The related books are interesting since they provide you with options based on what others bought, the author and other people’s recommendations. All to help you find the best book for your topic.
  • Use the ISBN, title, author, etc and search in your local on-line library catalog. In my case it is the library in Staffanstorp. If you find it all is well, just reserve it and pick it up the next day.
  • If you don’t find it in your local library goto your country’s common library catalog. In my case it is called If you don’t find it here you will have to buy it, but I have found more than 90 percent of my books here lately.
  • If you find the book, go back to your local library catalog and make an Inter library loan (fjärrlån in Swedish). Make sure you say that you found the book in the common catalog and that you want it delivered to your local library unit. The book is usually delivered in about a week at the cost of 5 SEK.
  • If you like the book and think you will read it again, buy it. If you don’t, just return it and feel content with that along with saving a small tree, you didn’t encourage a crappy author to write another book :)

Monday, November 03, 2008

Notes on The Long Tale

The Long Tail by Chris Anderson is a book about what happens in a market where the cost of production and distribution becomes negligible. The long tail refers to a statistical distribution where the distribution curve never drops to zero.

Short-Tailed Markets

In a market where the costs of inventory are high, such as in a standard book store, the store can only hold a limited amount of products in stock. The store will naturally want to keep the best selling books in stock to maximize their profit. This is often referred to as the 80/20 rule. 80 percent of the sales come from 20 percent of the products.

The 80/20 rule and the inventory limitations changes the buying patterns of the customers since they will buy what is available instead of going to great lengths to get something that is hard to get or even completely unknown to them, thus re-enforcing the rule.

Long-Tailed Markets

The reduced costs of product inventory and distribution due to the Internet and Just-In-Time techniques is changing the rules. Amazon is reporting that sales from books that would not normally be kept in stock in a normal book store provides one third of the total market share. And the share is growing rapidly.

There are three things that enable the long-tailed markets: production tools that enable cheaper small scale production, cheap and simple distribution tools, and a new connection between producers and consumers.


Cheap, simple production tools, such as Garage Band, iMovie, blogging tools, etc. enable enthusiasts to create acceptable music, movies, podcasts, articles, etc. at virtually no cost. And they do. The production in the tail is not driven by money. In the tail the drive comes from the need to express oneself and to have fun. People who do things for themselves instead of for money often produce better products.


The digital media can be distributed via any of thousands of channels, YouTube, Vimeo, iTunes Store, Pirate Bay and DC++. Music and video are easily downloaded to iPods and other portable players. Books are available as audio books or available as PDFs to read on-screen or to print at home. Bloggers are writing millions of articles everyday, available to anyone, for free!

The Connection between Producers and Consumers

Google is The Start Page for the Internet and it enables the connection between producers and consumers. It also enables the consumer-to-consumer connection. The trust in advertising is steadily decreasing while the trust in individuals continue to rise. Google enables me to find like-minded people that are happy to give recommendations to anyone who is interested in what they do or are interested in. We are the critics in the Internet age.

There is so much information available that the need to filter is higher than ever. Google provides this filter with the assistance of numerous blogs and other social tools. The filter has moved from pre-production to post-production making it possible for us to choose what fits our needs instead of the needs of publishers that are ultimately driven by money and professional critics with different taste than ours.

But, the professional critics have not disappeared, they have just become less important. And in the abundance of information that the Internet provides it can still be a good choice to rely on external agents instead of trying to make all the choices ourselves (see The Paradox of Choice).