Java Persistence with Hibernate now in MEAP

September 12th, 2006

Finally, the second edition of the classic and must-have “Hibernate in Action” finally made it to Manning’s Early Access Program. The first chapters of “Java Persistence with Hibernate” are available now, with more to come. The book will of course also feature EJB3 related information.

Looks like Hibernate finally gets a worthy reference manual. As much documentation as there is, it’s still very under-documented. Hopefully the second edition fills this void even better than the first one.

More on Freelancing

September 10th, 2006

Over at Brian & Stephanie Reindel’s Blog, they wrote up a nice piece about freelancing. “A programmer’s pocket guide to freelancing” is a nice write-up about some common pitfalls including finances, contracts and self-marketing, and full of good advice. A nice addition to my earlier posts in this category.

And if that’s not enough, there’s also a small essay about common pitfalls in resumes. Very good advice, not only for freelancers, of course. Your profile is the first contact a new customer or employer will have with you, so you better take good care of it and make it a good and fitting representation of you and your skills.

Excellent stuff.

Freelancing Adventures, Part II: Getting new Gigs

September 4th, 2006

When you’re a freelancer, you usually don’t work very long on a certain project. You need new gigs every now and then. There are a lot of ways to get one, and for me until now, many of them (yes, even in the quite small time of my life as a freelancer) worked out well. Don’t settle for a specific way to get your hands on new projects. Play the field, take it all in, and chances are you can make choices.

The following list is probably far from being complete, but it’s a start. It’s what I usually recommend to people and what worked well for me. Most of them are not only applicable for freelancers, but people preferring being an employee too.

__Build a Network__

This obvious, but it can’t be said enough. If you know people, they know you. It’s that easy. Go to business events, user group meetings, a regulars’ table for freelancers, conferences, you name it. Get to know people and make them get to know you and your skills. Join a social networking platform. Something like OpenBC or LinkedIn will do. I’ve heard of people who got gigs through MySpace, but I’m not in that camp. The same probably goes for Orkut. Some people tend to misunderstand the tool of social networking. Many people at OpenBC like to use the forums as a way to show off or to to offer their services. While that’s nothing unusual, there’s something uncomforting about the way some of them do it. Post a question, and your answer is something like “My company has the perfect solution for your problem. Maybe we can talk in private and I’ll make you a good offer.” That’s probably one of the main reason why not many forums over there are actively used for communication and solving problems. That doesn’t mean you should be offensive about getting your profile to people, but keep it private.

There are also specialized web sites for freelancer and project exchange. A good example in Germany is Gulp (very Web 1.0), freelancermap or projektwerk. Recruiters publish their projects there and look for people suitable for them. So be there or don’t work.

Find people with the similar interests, get in touch, get to know them, ask them what they do, about their experiences with a framework, a language, a certain way to handle certain things, you name it. Tell them about your experiences. Share thoughts, maybe work on a small project together. The better the other person knows your skills the better she’ll be able to recommend you for a job. The same goes for you, of course. It’s not a one-way deal. If you’re asked to join a project, but aren’t able to work on it for whatever reasons, the decent thing you do is think of and recommend your fellow freelancer friends.

__Let recruiters help you__

I actually got in touch with headhunters soon after I became a freelancer. And I’m glad I did it. I got my current job through one. A headhunter (or recruiter) is hired by companies to find people suitable for a project. In the freelancer world they’re usually in a hurry. It’s not uncommon that a recruiter calls you about a project where you’d have to start the very next day. Many customers have projects that suddenly popped up or projects that are on the verge of failing. Both often need immediate staffing and that’s what recruiters get their money for.

In the beginning you usually apply for projects. Recruiters often have special web sites or forms to that where you can put in your details, upload a profile and send it off. The good thing about it is that you usually not only apply for the project. The recruiter will have your details in her database. Of course they usually contact you, if they find your project interesting enough, and ask you if they can can get back to you in the future, or ask for more details for the current project, for that matter.

You do that a couple of times, and usually apply with different recruiters. You don’t need to be good at math to know that more and more people constantly looking for freelancers will know about you. The good thing about this is the fact that in the future they’ll contact you, if they have new opportunities. This doesn’t mean that you can lean back and rely on them to offer you projects on a silver plate, but it gives you a nice edge, and one more way to get new gigs. Sure they want a piece of the money cake too, but hey, they got you the job right?

__Get the Word out__

And I mean that literally. When it comes to a profile, most recruiters want a Word document. They have their reasons, probably. The point is, you need a profile, a good profile, a profile that tells a person everything they need to know about you. I can’t give you exact specification about how your profile has to look, but I can tell you some things that worked pretty well for me:

* Keep it short and simple. A good portfolio tells more than a thousand words. Well, probably less than a thousand words, but it needs to speak in a simple and effective language. Describe the projects you worked on in a short manner. No more than five or six lines per project. When, who, what.

The tripleju is your friend. You need a timeframe, a customer (maybe with a contact for reference, some recruiters like to have that, so customers interested in your profile can call them), and a short description of the project and the technologies you used. Some people tend to write down every little tool they used, even the operating system. For me personally that’s not important, and if you want to have it on your profile, put it in an extra skills list. I wouldn’t put Eclipse into the technologies used on a specific project, because I take it for granted. Yes, I know, others might not, but that’s why you can always put it in your skills list. The point is to keep it focussed. Put in enough information for someone to get a good impression of what you can do. The rest can and will be more detailed in an interview.

* Make your profile available. Nobody will care about what you can do, if your profile is not available to them. Freelancer exchange sites will usually let you maintain your profile for public viewing. So maintain it, maintain it good. Keep it neat and interesting. And keep it up-to-date. Your profile isn’t worth a penny, if it doesn’t contain your recent work. Link it on your blog or personal web site, too. Offer it to people. Don’t be shy to send it to people who only looked for an employee. Sometimes they don’t find someone suited for their needs and might get back to you.

* Make a difference. I know this is easier said than done, but on the other hand it’s not too hard. There’s some conventional and common wisdom concerning profiles. And a lot of people adhere to them. They make weird and stiff looking head shots. They use Times New Roman as the font for their profile, you get the idea. Of course you shouldn’t use Comic Sans (which some people do) or WingDings, or put in a picture of you lying on the beach. But you can spice it up a little, with a clean font (like e.g. Frutiger or Lucida Grande).

You could use a picture that shows you as, well you. Not in some way you’d look dressed-up or uncomfortable. A natural-looking you will say more about your personality than a person looking somewhat like you, but is wearing cloth you’d probably not be wearing to work. Some people like wearing suits, on occasion I do to, but at work I like to wear casual clothing. Yes, that’s sneakers, shorts in summer, and thongs if it’s warm enough. Fortunately your picture only shows your upper body. Wear something you’re comfortable with, but don’t look too geeky, of course. The same goes for an interview. A few years ago I wore a suit everytime, until I found myself being always over-dressed, and turned to a Dickies, neutrally looking sneakers and something like a white shirt. That’s me, and he who prefers to judge me based on my clothes, maybe I don’t want to work for him.

In the end it’s up to you to draw a line between you and the rest. But it’s important to find that line. Of course you can constantly redraw it, as long as the line doesn’t cross you and the rest, you’re fine. Think about stuff that makes you different, more interesting. I for one have made good experiences with presenting myself a little unconventional. As long as your profile still says enough about you and your skills, you mostly can only win.

__Don’t put two eggs in one basket__

Many projects look for people through different channels. Recruiters usually compete for people to staff open positions. So you’ll be offered the same projects more than once. Don’t be tempted to apply to more than one recruiter for a project. The person on the other end of the pipeline, who decides who’ll get the job, will then have to choose between the two (or more) recruiters. They too want their money, you know. You could say that it should be first come first serve. But in the end you could loose either way, because the person on the other end doesn’t want to make that decision and prefers people placed targeted applications. It may or may not work, it’s not easy to say, but if you don’t hear again from either of the recruiters, chances are you’ve been dumped for said reason.

So when I say play the field, I mean the field where you don’t pass the ball to the same player twice, but where you let everyone have a fair share of ball-time.

Sometimes it’s not easy to tell if a project offered by two recruiters is the same. They usually have the same list of requirements, but when in doubt ask, and ask about wages. In doubt you can always chose the recruiter who’s willing to offer you more.

__Learn to say no__

I know, you’d love to please everyone, and work on two or more projects at the same time. There’s the money, people will like you, your profile will shine, and everyone will win. Unless you want to work 16 hours a day to satisfy two customers, you better learn to say that word that nobody likes to say. Parents maybe, but even they hate to say it to their children.

Saying no is an important part of getting new gigs. You can’t do several projects at once. Well, of course you can, but ask yourself, is it really worth the sacrifice of time, personal life and health? Not only you will suffer, the quality of your work usually will too. Being able to say no is a good thing. Enjoy the pleasure of being able to choose. I know I do. People say no to you all the time. Well, sometimes they don’t, but would like to, but lost your phone number, and you’ll find out on your own anyway when they didn’t call you after some weeks. So why won’t you? It’s not only a pleasure for you. Not being able to make up your mind doesn’t help the others either. They rely on your decision. If you say no, they can move on and ask the next person. Of course it sometimes hurts to let go of a great project, but if you don’t have the time, you don’t have the time. Don’t be afraid to disappoint someone, because you won’t. They’re used to it. So should you.

That about sums up the experiences I made over the last months, and years, since most of it not only applies to freelancers. As a good employee you’re better off standing out of the crowd, having a good profile, contacts and even have recruiters looking for you. Pick what works for you, refine it, suite it to your needs, but do something. A new job usually goes a long way, but you can shorten it considerably when you do something about it.

I welcome further advice.

No RailsConf for me

August 20th, 2006

Too bad. A new project popped up on the horizon, and its most important deadline is September 15th. The choice was either the project (and therefore earning money) or RailsConf Europe in London.

Well, see you next year, or at RailsConf Germany.

Telling the truth

August 16th, 2006

Maybe I was too harsh last time or too emotional. Of course this is part of our jobs. From the project view I guess as a startup you can live like this for a while. Especially if you dont have too much code to write, or customers who pay a hell of a lot of money for your product. But if the project comes into the years, some developers passed by, you have some code nobody has an glue about, had some dirty hacks to make without cleaning up afterwards the chaos starts growing and the troubles begin. Then you need some rules.
I have seen too many freelancers who resignated due to these cirumstances in some projects. They say, oh well, its their problem, if I get my money everything is ok. With this nothing gets better. So I started writing a paper, but how to tell them what they dont wanna know?

* Stay positive but certain. Saying things in a positive way helps them to understand you. Tell them what they gain with the changes and not what desaster is going to happen or thats all bullshit what they are doing. Tell them about the increasing motivation, that they are going to be more productive.
* Explain them whats wrong and how it could be solved. Have at least one chapter where you show some starting points. As an example if they dont have any tests, how they could start writing tests, at the best show some examples.
* Stay honest, dont promise things you cannot hold. If all goes well your paper will be an important one. They will take every word very serious.
* Though the managment decides stay connected with the team. Not necessarily with all, but if it comes to changes you need at least some of them.
* Consider the consequences. It happend to me one time that after the CEO read our paper the project leader and team leader had been suspended because their reports draw a wrong picture about the project (and we could proof our statements). So insist its nobodys fault and they have to look ahead and not behind. If personal consequences are not avoidable its at least not your fault. You just told the truth.

Small vs. Big Companies

August 14th, 2006

Something I realized over the last days: Small companies with junior teams don’t finish projects on time, because noone knows how to do it (see this post), while big companies don’t finish projects on time because everyone thinks he knows how to do it right and the process stalls over useless discussions and over-regulations.

What’s the solution? Common sense and a good team, I reckon. Both can in some way shield you from the environment that wants to slow you down, be it intended or not.

Amateur projects

July 20th, 2006

It happend to me again. Today I found myself in a new project where everything seems to go wrong. The climate is non productive, they have sitting 12 developers, where I guess 2 or 3 good ones can do the same job. They have absolutly no unit tests, no build server, no documatation, neither external nor within code, no code reviews, a lot of changing developers, an over complicated build system which doesnt work, too much code which is solved by open source libraries, and so on. If you work like this you get used to it, but if you know there is a much different way there is only one way: you have to tell. The decision is as always between leave this as soon as possible or try to change, which of course is much harder. But this depends on the situation, as long as there is enough money nobody cares. Its easier to convice them if they realize its a case of surving.

Freelancing Adventures, Part I: Handling Finances

July 16th, 2006

One of the things that differentiates freelancing from a day-job is the fact that you don’t get your money on a regular basis. While it’s not a problem to get used to this fact, you gotta adapt your financial habits to this fact. Some should be common sense, but these things tend to get more important once you start handling stuff like taxes, insurance and the like by yourself.

So, welcome to the first part of my “Freelancing Adventures” series. Since there’s a lot of different stuff that becomes important, apparent, or just obvious once you’re a freelancer, I thought it’s best to separate these into nice and easy posts.

This one deals with finances. While you’ll have to deal with finances in any case, whether you’re an employee or a freelancer, some things are a little different.

* __Plan your start-up costs__

When you quit your day job to become a freelancer, you’ll most likely have some start-up costs. These may not be much when seen separately, but they add up. Depending on what you have you’ll most likely have to calculate for new hardware (I know I did), maybe an office, stationery, marketing (website, business cards, etc.). The new hardware might be the costliest thing in this list. Having such a list ready gives you an idea on how much money you should have saved up to begin your freelancer career.

Don’t be too optimistic. Eric Sink said something like this in his book “On The Business of Software”: “Write down all your costs (income and expenses) for the next year. Refine the list until you have a sense of it being realistic. Then multiply the expenses by two and halve the income.” After doing this you’ll have a list that’s deprived of any optimism that might’ve been left in you. Though his book deals with founding a product-driven software company, this example is easily applicable to you as a freelancer. Your income also depends on paying customers. You might not have to invest in employees, don’t need something like a year or two to develop your product, but you definitely need some time to get things going.

The resulting list shouldn’t scare you. If it does, maybe you should think again, if it’s the right thing to do. The more money you have saved up until now, the better and more comfortable your initial bootstrap will be.

* __Plan your monthly expenses__

It’s very important to be aware of what you have to pay and who’s to be paid for what. This is not to be seen as a to-do list for payments, but rather as a calculation of how much money you’ll have to spend, and therefore to save up. While you can’t plan everything in advance, you’ll at least get a rough idea of your fixed costs, and can maybe add a little for stuff like books, hardware, your next barbie, and stuff like that.

Put everything in here you’ll have to pay on a regular basis: rent, insurance, phone/internet, car leasing, magazine subscriptions, your Basecamp subscription, to name a few. I tend to add some money for food, electricity, my mobile and general household stuff. It will give you a good idea about how much money you’ll have to have in your pocket for the current or next month.

I use an OmniOutliner sheet to keep track of my expenses. An Excel sheet or a simple text file will do, too.

* __Keep track of your bills and payments__

Whenever I write an invoice for a gig, for rent or other stuff, I put it into another OmniOutliner sheet. I add the invoicing date, a number for the invoice and, once it’s paid, the payment date. This way I can keep track of what invoices I’ve written and which have been paid when (important for the tax office). If you like to automate this stuff you can use tools like Blinksale to send out your bills.

This list also gives you an idea of how much money you’ll have at hand. This of course implies that your customers are happy to pay you on time. I’ll get back to that later.

* __Saving up__

Don’t spend all your money! This might seem obvious, but once you get your first payments it’s tempting to buy that new MacBook or that big-screen TV you always wanted. Think twice before you do it. If you’re sure you can afford it, go ahead, big spender. But otherwise you might be better off saving some of the money. You might need it someday.

Imagine that you don’t find a new gig for two or three months. You need some money then right? As a rule of thumb the money in your savings account should be enough for you to live for three months without a gig. Whether you wanna do a trip to Australia in that time (I know I do ;) or just want to spend time with your kids or that new book about the coolest new technology, is up to you. The fact is that you’ll need money to pay your fixed costs. Your landlord won’t care if you don’t have a gig right now, and neither will most likely your phone company. So you better start saving right from the beginning. It might take you some time to have enough money in your savings account, but it’s definitely worth it. Having enough money in the back pocket will not only allow you to live without a gig for some months, you can even take that time off, if you want to.

Regardless of what you wanna do with it, it doesn’t hurt to have enough money on your savings account.

* __Taxes__

This one goes hand in hand with the last item. You don’t get all your money for free. Your tax office is gonna wanna have some of it. Keep track of how much money you’ll have to pay and put it on your savings account. If you have to pay taxes annually this is a nice way to at least let that money work for you over the year.

* __To buy or not to buy__

Whenever I’m in the mood to buy something, I browse some online shops, fill my shopping cart, and usually proceed to checkout. That’s the moment when I tend to have second thoughts. Do I really need a new hard drive? Don’t I already have enough pairs of shoes? Do I really need another book about Rails? While the answer to the latter question usually is “Yes”, the other questions are more than valid.

The point is that I tend to think twice about what I buy. While it’s not always good to never buy anything (if you spend money on something valuable for your business, you can deduct it from your taxes, and the less money you’ll have to pay your tax office), it never hurts to think about an investment. The bigger it is, the more you should think about it. If you come to the conclusion that you don’t really need it right now, put it on a reminder for later, and stop thinking about it.

Another trick is to let it settle for a few days. Put your errand on a piece of paper, put it into your inbox (or somewhere else you’ll find it later on) and stop thinking about it. If it’s still in your head after some days, go ahead and buy it. If it doesn’t: money saved. It will come back into your head once you really need it. If you’re worried that you might need it someday, and it might to late by that time, then maybe it’s a good idea to buy it anyway.

But the point is to think twice about stuff you buy. Spending money is normal and part of a healthy business, but how you spend it should be thought through.

* __Keep a financial log__

Write down what you spend. That way you always have a back log of what you spent and when. You don’t need to write down every Coke or pack of cigarettes (you should rather give up both bad habits ;), but every investment that exceeds a specific amount of money. Whether that’s 10 bucks or 20 is up to you. The higher the amount, the more coarse-grained, the easier it is to lose track of those small payments that easily add up to a few hundred bucks. The smaller, more fine-grained it is, the more work there’s for you. Work needs time, and time is money. So you’ll have to find out what works for you here.

* __Don’t freak out__

If you don’t have enough money to pay your bills, there’s no need to freak out. You’re not alone for sure. There are some things you can do. See what payments you can postpone. Ask your customer if she can give you some money in advance, borrow something from your spouse (I recommend not borrowing money from friends, unless there’s no other way, and both of you are aware that you might not be able to pay it back right away) or family. Or maybe you can live with your checking account being in debt for a while.

For the most part, there’s always a way out, even if it means to get a new day-job. When you’re out of luck money-wise, it’s best to have a realistic view at all your options, even the ones you don’t necessarily like. Living by your principles or keeping your pride is not always best in that kind of situation. It’s not weak to ask someone for money or help, if you’re in trouble.

* __Don’t count on money you don’t have__

‘Nuff said, although it can’t be said enough.

Handling finances is not easy, but nobody’s gonna do it for you. While you can let an accountant handle your taxes, she can’t give you the money to pay them. You’re in control and you better take over the stick. Otherwise you might be out of luck, and out of money someday. Personally I don’t need everything planned out, but it doesn’t hurt to have a rather realistic view on your finances. Having to pay money for stuff is not the scary part (people are paying you, anyway), it’s rather the thought of not having enough because you spent it on something you don’t really need.

And for the record: I still enjoy spending money on shopping trips or while going out with friends.

If you have more tips on how to handle finances, feel free to leave a comment.

Technorati Tags:
, , ,

Checkout Maven

July 15th, 2006

I worked for a company where they used Maven as a standard build tool. They used maven1, but I had some spare time the last couple of weeks, so I used it to play with maven2. I read the book Maven from the Developers Notebook series and Better Builds with Maven.

First of all, why use Maven instead of Ant, which are most familiar with?

1) Its a collection of best practices of build & configuration managment: Where do I put my configuration files, how do I integrate common tools like xdoclet, clover or checkstyle, make project reports, where do I put my external jars, how to announce a new version, do the deployment and so on. When I checkout old projects of mine, which are based on Ant, I always have to look in the build.xml how and where files are copied and so on. With maven thats not the case, because everything is just at the right place. And because with Ant there is no standard build structure, every project is different.

2) Reuse: Maven has a plugin concept. Every task is a plugin which gets loaded when you use it the first time, or gets updated if there is a new version. Even common tasks like clean are plugins. So you dont need to write scripts, you just call mvn clean without having any definition of clean in your project file.

3) Productivity: you start creating a new project with mvn archetype:create -DgroupId=your.main.package -DartifactId=projectname and you get a basic project structure. You define your final archive like jar, war or ear, add your external jar dependencies to pom.xml, call mvn eclipse:eclipse or mvn idea:idea, you get your project files for your IDE and can start working within seconds. And finally mvn install compiles your code, runs your unit tests and packages your archive. All that is done without the need to write any build code. Last but not least maven2 is faster than Ant.

There is much more you get with maven for free, like cruisecontrol integration, repository integration plus reports and stats, you can run your httpunit or cactus tests out-of-the-box.

The dependency managment is great: Maven supports transitive dependencies, so if you use Struts you just add Struts to your dependencies and get all jars needed by Struts. Maven provides automatic conflict managment. And every dependency has a scope, some jars are just needed at compile time, for tests and so on. All that is nothing you have to worry about, you just add the scope tag to your dependency.

So I really believe every java developer should consider using Maven, at least give it a try and play around with it a little bit.

An Unscheduled Update

July 14th, 2006

Okay, so it’s been a while without any post. I’ve been rather busy lately with Rails stuff and getting new gigs, which isn’t easy. I’ll post about both soon. Both can be fun and a little annoying. But both pay off in their ways ;)

Also, summer is quite hot this year in Berlin. We have like 30 degress (Celsius) every day for quite a few weeks now. While I enjoy that (although I miss the Byron Bay surf beach), it’s definitely too warm to do much in the evenings after work. So I rather enjoy nice, warm evenings after spending the whole day in the office.

I’ll keep you posted. Cheers.