Edited 2002-09-03 - Forgive the rambling, I like to ramble from time to time.
"Do Long Work Hours Affect Code Quality?"
Yes and no. It all depends on your work environment and your personal life.
Personal life.
If your partner is understanding and encouraging, and you personal relationship with your parner is strong the long work hours are not going to be too much of a problem. This is my case. My partner encourages me to do well, and to do things I like to do. I likewise encourage her to continue with her personal projects and interests. You have to. We also understand when the other needs to do a lot of extra work to get a job done.
I use a powerful laptop to do most of my work on. My workplace desktop computer is used as a secondary machine during the day. This means I don't have to stay at work until the next morning, I can do it in the comfort of my own home. My employer has a very active HR department, constantly putting out policies to ensure the company complies with laws, and it's employees have flexibility (One of the current issues is parents can take extra holiday time or work shorter days for slight decrease in salary). Another 'initiative' allows some limited work from home time.
It also helps that my work (software engineering/programming) started as a hobby 18 years ago: I love to program, so long as it is an interesting project! ;)
This all makes working extra hours a fairly comfortable thing.
Work environment.
A good work environment makes you want to do extra work for the company.
A work environment includes just about anything you can think of: chairs, desks, colour schemes, colleagues, other staff, management, windows, airconditioning, salary, work-hours, coffee, snacks, smoke breaks, interesting work, smart project timelines, understanding supervisors, parking, public transport, nearby greenspaces, nearby shops, outside air quality, noise, language, etc...
A good work environment needs good people, good indoor working environment, good area amenities.
In my case, the company I work for has cubicles which are just over 2x2 meters, with desks made for people who are 5.5 feet tall, terrible (but expensive) chairs and a cantankerous airconditioning system. Blood red partitions, dark blue carpet, and bone desks and walls. I am used to it now, but at first it was headache-inducing!
We do, however, have a great view over our city.
The people I work with are great. A mix of quality and average, but everyone has value. We have great laughs, playtime (in and out of work), and everyone can take critisism, praise and a joke. Salaries are about average, with some undeserving and deserving people getting above average, and some getting below. There is no overtime for 3/4 of the company, but a sattelite office does get overtime (which is a source of frustration for some).
Employees here have great freedom with regards to working hours. Most come in between 9am and 10am, and leave between 4pm and 6pm. From what I've seen management has never asked people to stay behind an unreasonable number of hours. There are some people who stay unreasonable hours off their own bat. No questions are asked about long lunches or short days. So long as the job gets done.
The area's ameneties are quite good. We're a 15min drive from the beach, 10min from a major park with others nearby also. We are 15min from the city center, and 5 from several shopping centers. And I am 5 minutes from home. So when anyone feels the need to "get some air", they're a short drive away from their fancy.
Currently some (engineering) people are working on intersting work from our HQ, and a whole bunch of others are working on a sattelite office's project. A few of us have been moved from project to project to project over the last few years, to the point whre only 1 person of an original bunch is still working long hours. Our local management is not interested in the project in development at our HQ, instead they are pushing a far inferior project from our sattelite office. This of course causes friction between the offices, and frustrates the engineers who have to work on the inferior project (and there is a huge difference).
In any case, we have everything except for lack of politics, and interesting work.
These two facts, combined with the bad workspaces mean that most people do not work late. They are not motivated to do so. In my case, after being moved from project to project to project, and now wokring on the inferior project, I am not at all motivated to work extra hours or even work hard!
A few years ago, when we were working on a very nice project, we were all highly motivated and all worked a lot of extra time. We did not get any thanks, the project was cancelled in favour of a far inferior project.
(DISCLAIMER: The console products mentioned below are for illustrative purposes only!)
Imagine the following scenario: A company with dwindling marketshare and a poor product has two products in development: one has equivalent capabilites to a Gameboy, the other a Dreamcast. The Dreamcast was cancelled in favour of the Gameboy. Now a similar situation exists: We have a Sega Megadrive in development and an XBox. First we have the Dreamcast team put to work on finishing the Gameboy. Now we have XBox people removed to work on the Sega Megadrive. The XBox is not cancelled, it is in development mostly at HQ.
Anyway, I think this has turned into a complaint against my employer! ;)
Currently I do not work many extra hours, only if absolutely necessary. When the politiking between offices stops and our local management is finally bowled over by the upper management at HQ (which in this international company is inevitable) then long hours will start again. I like the company and want it to grow, I work with a great bunch of engineers and QC people. When some decisions have been made and the situatio changes for the better: bring on the caffeine, because long hours will happen. If changes are for the worse: well, shorter and shorter hours, with less and less satisfaction, until all the good engineers leave. If it ever reaches that stage then HQ will stop local development and turn local offices into sales offices.
Again, If the work is interesting, the environment is good and the personal life is good: long hours are not so much of a problem, on the other hand If you are working long hours to escape your personal life you must change your personal life.
If you are working long hours and your personal life is fine, but your work is not interesting and the environment is bad: LEAVE! If you don't change a bad work life or a bad personal life, you are going for destruction in the other.
Enjoy!