How do you cope with deadline pressure on a coding job?
Break up the task in small chunks
Estimate how long each of those takes
If totals more than deadline, either renegotiate deadline, or drop features/subtasks
If not, track small tasks using mini-deadlines - they are much easier to accomplish and thus generate less pressure.
Exercise periodically to work off stress
Next time, don't procrastinate :)
There are 3 factors you have to play with when planning:
- feature scope
- time scales
- resources (programmers)
You can decide any two of these, and that dictates the third (e.g. the number of features and the number of programmers will determine time scales).
If you're under deadline pressure, I would suggest reviewing the above. I realise this isn't directly answering your question, but it should give you some better control of your project going forwards.
I think our job is a constant balance between being really busy, and really bored. Every time i find myself hating life... aka working 70 hour weeks, i think about 2 months down the road where things will be so slow i am bored. Its an unfortunate pro and con of our job.
The other thing I do is i try to stay healthy. No matter how long i have to work i always will take 1-2 hours a break to work out and just release stress. Whether that is reading xkcd, coding horror, or watching tv, or working out, anything to take a break....
Biggest thing is to make sure you realize that stress/worry will never help you accomplish your goal. Our job is always about managing expectations, and balancing deadlines.. once you have survived a couple all the others never seem as bad.
Also, when you realize you're not going to meet the deadline, tell your colleagues/superiors as early as possible. Waiting until the last minute hoping some miracle will happen is a bad strategy. The earlier you figure out something isn't working out, the more time there is to make changes without derailing the entire project.
I try to disassociate myself from my coworkers and obstruct their work so that I don't feel so far behind. This has the added benefit that I can mention to the boss (in an ingratiating manner) that a coworker is going to miss a goal, which acts like a smoke screen so that I have more time to slap my own work together. I also find that writing lots of status reports to the boss on why I am so far behind can give me the feeling of "doing something about it".
You have this marked as a junior programmer, so I'm going to address it from a non-management view.
First recognize that there will always be deadline pressures, it is part of the job. If you don't want pressure, this is wrong career field for you.
Second, keep your management informed about your progress and any issues or unavoidable delays that will affect the deadline. Do this as soon as possible. The manager doesn't want to know the day before the deadline that you haven't done something because you have been waiting for two weeks for someone else to fix your permissions on the database.
If you are in trouble as far as the code itself, ask for help. Tell someone you don't understand how feature X is supposed to work or that you can't seem to figure out how to make it do that. A more experienced person may be able to point you to the right technique failry quickly. People are not annoyed in general when you ask for help. What they do get annoyed about is when you ask for help repeatedly on the same types of issues that they already showed you how to fix 6 times. If you don't learn from the help you are given, people will quickly stop helping.
If it is a major release, try not to plan too many outside obligations the release week. You may be working overtime and weekends.
Now comes the tough part, when to say no to working more hours. You are not productive working 18+ hours a day no matter how much you think you can. Tired people do things more slowly and make stupid mistakes. It is more productive to quit after a maximum of 12 hours than to keep working all night. You will be able to do things more quickly with some sleep. Also take meal breaks. Food helps feed the thought process. When you find yourself getting exhausted or making those mistakes, tell your boss you need to take a break and come at it fresh in the morning. If he won't let you, then it is time to be considering a different place to work.
Finally, when there is deadline pressure and stress, people get cranky and possibly say things they don't really mean or blow up at small issues (the "straw that broke the camel's back" blowup). Don't take these things personally. Don't get mad back. Chalk it up to stress (although don't ignore suggested corrections to your code). You and your co-workers will be happier in the long run if you do this.
Be a team player when under deadline. Don't refuse to do something because you think it is outside the scope of your job. People remember well those who pitched in and helped when help was needed.
Don't go to your team or your boss just with problems either, suggest solutions, suggest a good place to reduce the scope if need be; tell him what you need to fix the issue, don't just toss the problem in his lap.
Tackle things one at a time; when you break things into chunks, they don't seem so overwhelming. Give yourself mini dealines on parts of the project. When planning your own work, make your personal deadline ealier than the deadline you are given. That way you have time to handle the unexpected and meet the actual deadline with less stress.
It gets done when it gets done. If you're stuck, you need to get help fast. If you're not stuck, but know it will take a bit longer, you need to tell whoever needs to know about an extending deadline. From my experience, everyone has the most important task that needs to be done by yesterday. Don't let that distract you from doing things properly. Eventually, you'll learn to estimate projects better.
Good luck!