I had a revelation yesterday while thinking about del.icio.us, the most well known social bookmarks site. I find out that I almost never use my tags, and I am often not satisfied by results when I search using tags. What use can you make of 100s of tags? in the end only less than 10 are usable to classify very different stuff. And even then compared to a search it’s not a much useful classification.
If del.icio.us search engine was decent then I am sure I would never use tags. But their search engine is slow, and does not search much (it sometimes fails to find results on words in titles).
What is needed is really a social search engine, where you could look things up by user as criteria, and possibly by dates. I googled for it and immediately saw that my “revelation” was quite common. There are several social search engines. There is cranky, where you can see eventual reviews by some users, added to search results. There is eurekster, where you can search in any user bookmarks, but you can’t search everybody (how silly). There is Yahoo MyWeb, quite decent if you ignore the presentation and if they added descriptions on results.
A friend of mine told me that furl, another social bookmarks site, is more search oriented, but unfortunately a bit slower to use since it keeps a copy of the page you bookmark.
But still I feel like none of the sites do the right thing, some have too many features, others bad presentation, focusing on useless crap. I actually think that google should have that feature integrated with the common search. I am sure it will in the future, but they seem to be late on the social side of the web.
I am less enthusiastic about the Apple experience than I was one year ago.
I am quite enthusiastic with the hardware in general, except the keyboard. The computer is small and quiet, and there are not many competitors at this price on the market.
Experience as a developer
I feel frustrated with MacOs X as a development environment, when compared with Ubuntu Linux. I always miss the multiple desktop, despite expose magnificient look. The standard behaviour for the terminal, bash, vim, etc. are more convenient in Linux. Installing software and updates is much more convenient on Linux thanks to the open source repositories.
The key bindings for special characters is awful for a programmer on the Apple keyboard, because non standard, and not even written on the keyboard. Installing linux on a mac mini intel is not trivial, but I am considering it seriously.
Experience as audio/web user
No particular complaint about the web, but I use Firefox instead of Safari, because of Firefox Adblock extension. Chat works well, Skype is ok. There are sometimes problems with bluetooth audio for Skype that, I think, are related to MacOs.
Audio is good too, I end up finding iTunes ok to use, it is fast enough to manipulate 100GB of songs. But I don’t use any fancy feature, except cd-burning. It makes a good jukebox, and the remote is handy, but not terrific (any wireless keyboard would do in the PC world, for 90% of the cases).
Photo is not great, I don’t like iPhoto that much (especially when compared to Picasa). iPhoto is quite slow for me (and I have 2gb of RAM). I found it a pain to install TheGimp on MacOs, not knowing which X server to use. Photoshop is still not compiled for intel, and dog slow on my mac mini.
Page is not great either. It does render beautiful letters, but overall I don’t find it very usable compared to more standard software like OpenOffice, and it’s time limited!
Conclusion
Overall I think I would not buy a Mac again if comparable PC hardware exists. MacOs is not a bad OS, but I prefer Ubuntu Linux. If you don’t use or like Linux then is really Vista worse? I don’t think so.
While looking through some code for a project, I saw that:
public static final ProductYP instance = new ProductYP();
public ProductYP() { if (instance != null) throw new RuntimeException("Only one instance allowed");
prods = new HashMap(); }
public static ProductYP getInstance() { return instance; }
And I don't think it was done by a newbie... It's actually not far from being correct, it's just that the guy obviously does not know about private constructors. I have seen several broken singleton implementations in previous projects and had several debates on the double-checked locking pattern (it works since JDK1.5 with volatiles but is useless). I am upset to see another half broken implementation. Everybody should have read at least this.
I used to like the java specialists newsletter, most news used to be a bit challenging. Nowadays however the quality is lower. In the latest news, the author proposes to use the StackTrace to get the class name, in order to declare a Logger independently of any explicit reference to the class name.
While this is a clever hack, it still requires some code to be duplicated in every class, compared to Aspect/IoC approach. But was there really a problem with declaring loggers the usual way in the first place?
With modern IDEs, most people just create a template for the logger declaration line. Also, renaming MyClass to MyClass2 will rename MyClass.class to MyClass2.class automatically. Here is my template for Eclipse to which I assigned the short name log4j:
private static final Logger LOG = Logger.getLogger(${enclosing_type}.class);
I tried a bit django for one very simple thing, where django is not of much use, but it was a way to try it with something else than examples on the site.
Even if django templates features seem very good and very convenient when reading the docs (for example the extends keyword), I found out that the template system is very annoying. Firstly one has to learn another templating system. Secondly, and much more importantly, the debug facilities for templates are close to non existent. I have a better memory using ruby on rails templates (which are not the best either).
Java templates, based on Velocity, JSPs or JSF are much nicer to debug. PHP (which I consider an ugly language that can unfortunately often gets the job done) used to be crap at debugging, but with eclipse plugin phpeclipse it is much better these days.
I think templates play a very important role in web application development, and I am surprised that a framework with so many good ideas fails in reality (at least for me) because debugging templates is a pain. Hopefully it will become better one day, but until then bye bye Django.
Why would GWT be so well acclaimed if JavaScript was a good language. When you talk about GWT to someone (a developer preferably), the first reaction is often
great I don’t need to do any JavaScript
I recently discovered another similar open source project, ZK. The
first thing you can read on the website is
ZK is an open source Ajax Web framework that enables rich user interface for web applications with no JavaScript and little programming.
If you compare that with how JRuby is (or Jython used to be) trendy, you will agree there must be a problem with JavaScript.
JavaScript is not bad at everything, for very simple scripting, it is quite decent, the recent inclusion of Rhino in the JDK 1.6 is useful anywhere you need simple dynamic behavior. But most developers obviously don’t want to deal with it.
I discovered a new baby in the build world. Some open source projects use a combination of ant and maven. I thought you could vaguely use ant from maven. But I did not know of Maven Antlib that allows you to use maven2 from Ant. Why would you use Maven2 from Ant?
because Maven2 requires to adapt your project to its standard hierarchy, or to have excellent Maven2 skills to create your own archetype for each existing project.
because everybody knows Ant, but Ant does not manage dependencies well. Maven2 Antlib can be used just for that: managing dependencies.
A friend of mine had a good idea for a Java project named “hibernate proxy”. I renamed it “hibernate network proxy” because hibernate proxies are already a well known concept among hibernate users (it allows lazy loading through a Java Proxy class).
The hibernate network proxy, is a way to use hibernate remotely, that is to proxy hibernate calls through TCP (or even HTTP) to another machine, that will execute the session.saveOrUpdate or the session.load, etc. calls and return the corresponding objects, serialize them and deserialize them for use on the client.
As most projects in my company involves several distributed services, this idea could have been potentially very interesting, allowing hibernate use in several services that would interact with a common service in charge of the db. It made me think about other standard patterns:
This is not very different from the classical EJB session facade architecture, except we don’t expose application functionalities, only hibernate stuff. In fact we don’t want to expose application functionalities since they are not shared between services.
This is very similar to Entity EJBs used without facade, remotely, the first kind of design we heard about when EJBs came out. This would actually be a good fit for doing this kind of stuff, amazingly. I never thought remote entity EJBs were of any real use. Unfortunately for our projects, we already have a messaging infrastructure, and I am not sure how feasible it is to change of EJB transport protocol. Seeing the complexity of something like IIOP, it looks like a dead end.
This is a kind of Hibernate Second Level Cache, a cache with remote capabilities. The cache would proxy the request to the db service, and the db service would answer to that. This is a possible implementation that seems very flexible.
Use a regular TCP connection to the DB, and hibernate in a standard way. Ok, it does not use our internal message bus, but it is so simple and standard.
The last solution raises the most important question:
Why does it need to be proxied?
To go through some particular port? -> use a port forwarder.
To go through HTTP? -> use HTTPTunnel.
You want Java only? ->use JHttpTunnel,there is even JSch for ssh.
Until recently, I always found Eclipse CVS support to be excellent. The synchronize view was really a big plus to do clean commits, without forgetting any file.
But I have encountered several problem with Eclipse 3.2+:
On one project, it keeps putting the build directory into CVS, and I can't find how to change that setting. Each time I open the project I have to change the CVS/Entries file.
On another, where I have lots of files in, Eclipse delete some of the files (checked in CVS) regularly, although not often. It won't retrieve them back again from CVS. It seems to be the same files each time. I have no clue why.
The diff sometimes tells me the whole file has changed while there is absolutely no change.
I could not make the merge work. It kept on complaining about some parameters.
And now the workaround for all those cases:
The good old CVS command line.
I never remember how do to a merge with the command line, so I each time go to google and read this merge example page. Here are the very simple steps if you are in a branch and want to merge:
cvs update -A mypoem.txt (use head as local repository)
cvs update -j release-1 (merge release-1 changes into local repository)
I am writing only as a newbie on Maven2. I tried to use it several times on small projects, but each time I found out that the time involved to make it work with an existing project was too much a pain in the a**. When confronted to very simple hierarchies that are not the standard of the documentation, I was a bit lost on how to arrange things, except changing the whole hierarchy to adapt to Maven.
Also on small scale code, Maven requires you again to adapt your project to it and it will make your small code look like an important enterprise project. For example if you want to build a small test that can be executed as a server (with one particular class), as a client (with another class), or as a servlet, using one or two other common classes, Maven requires at least 3 source hierarchies (with src directory).
I think it is not only because I know ant (much) better that ant proved many times to be quite flexible, and I have never been on a project where switching from Makefile to ant was a problem. I am not an ant fan. I have a preference of code over XML that ends up here and there being like code, in a much less flexible way. However Ant, as I said, is flexible. One can always use the good old scripting languages (javascript, beanshell, etc.) to define new tasks, and therefore bypass any inflexibility of the original design.
Still Maven2 has plenty of very good stuff, especially for more normal projects. It provides versioning, central repository and dependency checking for you. It is probably a good idea to use it rather than bad ant scripts, or, even worse, old Makefiles. Also Maven2 hierarchy conventions are not stupid, it is just not fitted for quick and dirty stuff.