Apple Rumors and X86 first move

I find the mac mini a particularly compelling computer. It is small, noise friendly, relatively cheap. If you want to have a cheap home server (based on Linux or MacOS X), this is quite a good choice as you probably don’t want to hear all the fans of bigger computers the whole day. It’s also a very good candidate for a media box: you can connect a huge hard drive for mp3s, and watch your DVDs, photos on a nice LCD (and MacOS helps here).

Unfortunately it might not be the best moment to buy it now. There are rumors everywhere that the first Mac Intel will be presented in January. And I am quite confident that this Mac Intel will be the Mac Mini. Here are the reasons:

  • PowerMacs and iMacs use the quite modern G5 processor. It makes sense to update the very old G4 to Intel first.
  • if iBook was updated, it would be much more attractive than the Powerbook

This leaves us with either powerbook upgrade or mac mini upgrade, but:

  • XBox 360 has almost arrived. While not a direct competitor, it can be used as media center, it is cheap and powerful. Unfortunately it’s not customizable enough.
  • Powerbooks got a recent update. They are advertised heavily on apple websites, while the mac mini had just a silent and minor upgrade and is not advertised anymore.

7 Years Later: Still EJBs

In 1998, a student of my school had a project with Sun about EJBs. This was the beginning of EJBs, they were not public, and there was no J2EE. At that time he found it utterly complicated, and had difficulties to understand why they made it so complicated.

In 2000, I worked for a company who had built in-house most components of a today J2EE application server. For example, they had their own unified messaging system, on the JSP side, they were already using custom tags, etc.. Their problem is that they took lots of time to develop in-house, all what later became standard, and almost freely available.

Today, 7 years later, the big talk, new Java products, be it Spring, or JBoss Seam, are still all about the same ideas as in the first J2EE. Spring has the freedom to include whatever technology, but in the end, their scope closely matches J2EE scope. Service Oriented Architecture (SOA), the current buzzword, will come out relatively naturally with J2EE, session EJBs being natural candidate to expose functionalities to the outer world. JBoss (or Geronimo) architecture is fully SOA: a small kernel managing services, that are exposed for other to use.

To learn about EJBs, I still find Enterprise JavaBeans by Richard Monson-Haefel, the best book. The chapter (in the 2nd Edition of the book, not in the 4th unfortunately) where he rolls his own distributed objects system is for me a testimony on how well he wants you to understand what's behind EJBs. And if you want to better understand what's behind RMI, Java Distributed Computing (O'Reilly) has a chapter where the author rolls his own RMI.

To conclude, Sun was really clever in defining J2EE scope and branding several Java technologies as J2EE (despite the awful version naming). While the ideas were very good, the developer's life was forgotten. It was too much a pain in the a** and not flexible enough (especially the ORM side). JBoss gets it right, what people need is a way to use pieces of J2EE, without imposing too much unnecessary hurdle on development.

Job Hunting: Interview Madness

I have been doing interviews those past weeks. Today I had to present my resume for the N time where N is big. It is very boring. In France, it is common to have 5 interviews for a small company (that says a bit about how people trust each other and makes me envy Germany where the practice is to select very strictly on the resume and be more relax about interviews). But all those interviews give a valuable insight on the current market, and on some companies.

0. The Monster Rage

The first 2 days after I put my resume on Monster France, I got more than 15 calls from consulting companies. The following day, I removed my resume from Monster

1. Interviewing People

When I started working, I was very bad at interviews, I had a good academic record and thought companies ringing me would have been interested automatically. I supposed most people were dedicated to their work and did not bother doing a show, I was passive. So I often failed the interview process at the HR level.

Now I am doing the show everybody expects and it always works. Only one person asked me an unusual, clever question: “Do you write?” or

“Do you like to write?”

I am often more stressed by technical interviews as I find technical interviews can more easily be very badly done. Even specialists don’t agree on a good method, cf the artima article on How to Interview a Programmer. If someone asks you about some intricate details he knows lots about and you don’t, or you used to but you don’t remember, then that person can have a bad impression of you. In Java, this can be the supposedly trivial ,“what classes do you have to implement for an EJB ?”. I have done many EJBs in the past, but that was a long time enough that I need to look up somewhere to find the exact and precise answer. It is much better to ask someone about what he recently did, or about someone’s view on general subjects, especially subjects he knows about.

2. Interviewing Companies

As a junior in the business world, I had a very angelic view of companies. I had been lucky enough to do internships around very good people. But nowadays, I am starting to find difficult to pick a good company to work for. I found one question especially useful to find out more about your future mates:

“What do you like in this company?

and try to get to know the answer of “Why did you go there?”

3. The $$$ in Current Market

There seem to be huge disparities in salaries in France. I found consulting companies were very reticent to offer a market salary. More regular companies can either offer a much lower salary than the market one, a market salary, or a much higher one, for the same job!

Does Eclipse Rot The Brain?

Slashdot presented a really insightful article on Visual Studio by Charles Petzold called Does Visual Studio Rot the Mind. Interestingly it seems that Eclipse does things better than the future Visual Studio.

  • Autocomplete in Eclipse is really good and does not suffer of the bottom-up problem M. Petzold mentioned, nor from the forced CTRL-Z.
  • There is no Form designer, and in Java it has been the practice to lay out forms programmatically. The Java Layouts have always been scalable, and Java programs very rarely rely on pixels.
  • There is no unnecessary import statements.

His positive feedback on XAML is interesting, especially since he thinks this allows for a better automatic UI.

More importantly, he makes a good point on the exponential increase of method/classes/properties names to use for a regular programmer. This raises a serious question about how viable are the current tools.

Orkut Statistics and Blog Evolution

I was just having a look at orkut again. As in my last look in the past year, there is not much new or interesting. The technical forums are mostly uninteresting and it almost looks like nothing is going on. Take a look at the orkut java forums, in 1 year, very few messages are good.

Compare that to javablogs.com blogs aggregation, every week there are many interesting posts. The blog model is good because it is targeted at people who want to write. When you blog, you build a history. Forums don’t let you do that. You could have a social model on top of blogs, and I am sure this will be one of their next evolution.

I found one good page, the orkut statistics:

  • Brasil is number one country with almost 75% of the people from there. I wonder why they find it that much better than alternatives. It’s strange how something can be successful somewhere and not somewhere else.
  • US represent only 7.8%.
  • Iran and Pakistan represent 6%, that is almost the equivalent of the US. I was very surprised by that.
  • Europe does not exist there.

More than 50% of the orkutians are under 25, which probably explains why not much is going on there.

Spring Books Roundup Updated

I am completing my Spring Books Roundup with 2 new books:

  • Pro Spring, by Apress: a lengthy book, with some unnecessary information, but good overall. I did not like the Part 1, there is not much content in it. Fortunately, Part 2 is much better, dependency injection is very well described, almost on par, with the Fowler article of reference. Other Spring areas are well covered, in a similar manner as in Wrox book, except Java Server Faces, absent from the book, and nothing on Swing as well
  • Spring Reference Documentation, from the springframework.org website: I should have started with this one, it is of very good quality, and more up-to-date. There is notably a very good chapter on “Source Level Metadata Support” even if I don’t find particularly compelling that they chose yet another abstraction behind Java 5 annotations, partly to support older JDKs. Another plus is a chapter on JMX support, this was lacking in other books.

Interestingly most other books are very similar to the reference documentation, in their presentation and content. The reference documentation is extremely well written. Each time the author carefully explains what are the advantages of the Spring solution, or what does a particular feature solve. Only dependency injection and swing are not treated properly.

To conclude, to best learn Spring I would advise:

  • Read Fowler article about dependency injection.
  • Read O’Reilly’s A Developer Notebook. It is the most appropriate book, because the presentation is a bit different, focusing on quickly understanding Spring and using it in your project, and it is the only one mentioning Swing Spring features.
  • Read the reference manual to find out about the details you need for a specific feature.

Spring Books Roundup

Spring is hip these days, so I decided to learn a bit more about it. I had used Avalon a while ago, I was attracted by its design by component and the way it seemed to lay out a proper infrastructure to build a server application. In the end, I was a bit disappointed, it required a bit too much glue code for my taste and did not provide that much in exchange. I don’t remember if, at that time, it was advertised as IoC (Inversion Of Control) container. This experience is one of the reasons why I did not jump on the Spring ship.

I have read 3 books, here is what I thought of them, briefly:

  • Spring: A Developer’s Notebook, by O’Reilly: I enjoyed reading that book, because it is well written and has a good structure. It explains what is dependency injection by doing it without Spring, with Spring. But for a more complete understanding, I would recommend Fowler article. There is an interesting chapter on Swing with Spring. Minor drawbacks is that it does not talk about Spring Timers and has very little on Remoting. But I would recommend that book.
  • Spring In Action, by Manning: I was disappointed by that one, because there is not much more information than in O’Reilly, it is a bit less practical to use. While it is a bit more detailed than O’Reilly, I did not find the extra information very useful in general. Remoting is better covered here than in O’Reilly, but there is nothing on Swing.
  • Professional Java Development With The Sring Framework, by Wrox: I liked that one better than Manning, but again information inside is very similar. I find the explanations more complete. Inversion Of Control is well presented (it is even comparing constructor injection with method injection). It gives examples of alternatives to XML configuration. Remoting is covered in greater details than Manning. I would recommend it over Manning anytime, and if it included a Swing chapter, I would recommend it over O’Reilly as well.

You can wonder a bit why there are 3 books on Spring, that similar. I believe there is space for other intelligent presentations of Spring. Subjects are often treated superficially. For example, look at the Fowler article versus the best chapter about IoC, the one from Wrox, and you’ll see how much more detailed it could have been. I find it a bit shocking since IoC is the basis of Spring. It would have been good to see a book explaining why Spring chose that particular design over another, for the main features, and presenting alternatives better. I would also have welcomed a book explaining the use of maybe just a few Spring aspects, but in the frame of a big, commercial application. For example after reading those books, it is not immediately clear to me what are Spring benefits when using Swing support versus other solutions. Another critic is that all those books were written around the same time, and are sometimes already obsolete. None of them describes Spring JDK 1.5 support (for transactions or JMX or metadata). The official free Spring reference book seems better in many ways.

Those books showed me Spring could be useful in some projects:

  • if you want remoting
  • if you want to promote clean code, then you can promote the “Spring way”. It is a good one.
  • if you want to use JSF. Spring makes JSF easy and natural to use.

On top of it you get AOP for easy debugging or profiling, which is always useful at some point.

I am not convinced about Spring when it comes to:

  • JDBC or database use: while Spring has a well done framework, Hibernate or iBatis have a very good API that makes Spring abstraction useless.
  • MVC: it is does seem that much better than alternatives, nor much less intrusive (OK you can test it easily). Anyway I am not that big a fan of web MVC after having seen real world .NET projects without strict MVC well maintainable. I find the JSF backing beans at least as good and more flexible. Continuation frameworks are interesting too, but I am worried of their performance impact and scalability.
  • Transactions: I just don’t think manual transactions are that bad or ugly or less maintainable. But using Spring for them is not necessarily a bad idea either.

To me, the main alternative to Spring, and a very good one, is JBoss. I will elaborate on that subject later in another post.

Interesting Plug-In Framework - DPML Transit

Today, I just found out about DPML Transit, it is a small framework that helps you build plug-ins based software. It seems to work a bit with DPML Magic, their build system based upon Ant. Both are quite interesting, since in big projects, you often end up with a packaging per component (which DPML Magic seems to make very simple) and a versioning of those components. DPML Transit allows then for an efficient way to look up a particular version of one component.

I have not heard of DPML before, they seem to write useful software. Has anybody used those frameworks already?

Java Puzzlers - Can you figure this out?

The book Java Puzzlers is quite good. I don't think anyone can get every puzzle right. This shows again how you can very easily make someone fail interviews if you ask too silly questions. I suppose that if people were asking those questions they would not expect the right answers, but study the candidate reactions.

Here is a sample:

public class DosEquis {
  public static void main(String[] args) {
    char x = 'X';
    int i = 0;
    System.out.print(true ? x : 0);
    System.out.print(false ? i : x);
  }
}


This will output "X88". Obviously this is not good code, which is precisely one of the book objectives: to show how bad some practices can be. But at the same time you learn a bit more about the Java language and its possibilities. In the latter chapters they have more interesting puzzles.

Is Prolog Better Suited Than SQL?

I am currently reading a Prolog book Artificial Intelligence Through Prolog, I have been doing a bit of Prolog when I was very young and wanted to refresh my memory a bit. It is a very interesting read, especially when I take the viewpoint of our current application where no ACID compliance is required.

It seems to me that all the logic we coded to parametrize SQL queries and construct them dynamically could have been avoided if we had chosen Prolog as Prolog expressions would have been very natural to use in our project. With Prolog, there is no need to think about joins, type of joins, SQL syntax. It is at the level just higher. I wonder very much why Prolog did not become more mainstream as it seems to solve some problems in a much nicer, natural way.

Here is a short example to get reviews of things by user or by user and tags or …:

let’s define some facts:

  • is_tag(tag1, user1, thing_id)
  • is_tag(tag2, user1, thing_id)
  • review(user1, thing_id, description, extended, date)

review for user “user_x”

  • ?review(user_x, THING_ID, DESC, EXT, DATE)

review for user “user_x” with tag “tag_y”

  • ?review(user_x, THING_ID, DESC, EXT, DATE), is_tag(tag_y, user_x, THING_ID)

We could imagine some better ways to lay out information. This is just a first draft.

Now of course, Prolog does not necessary makes sense for us because:

a) We already have it working in SQL

b) SQL is much more used and should therefore be more tunable, stable, etc.

Still the Prolog way of things is interesting and powerful. We could have written a code with a logic near Prolog instead of our custom code.

Previous

Next