Question: After 2.5 years working at my current job (programming), I recently came to the conclusion that I want to find a new workplace.
Reason for this is solely my boss who (in general has a good heart but) is never satisfied with my work, never shows appreciation, gets angry over almost everything I do (no matter what I do) and in general is very disrespectful and offensive.
I get along very well with my coworkers. Most of them have the same problems with the boss.

I want to start applying for other jobs and as soon as I find something hand in my resignation.
Currently I'm at the beginning of a project which is transferred to me and a coworker, by another coworker who will leave the company at the end of the year.
The guy who's leaving is basically teaching us what he knows so we can continue his work once he is gone.

Since I already know that I will leave as soon as I find a suitable job, this might become a problem. It would make more sense to transfer this project to someone who stays in the company. On the other hand, I don't know how long it will take to find a new job. It could take only 2 months or if I am unlucky much longer.

Should I tell my boss or colleagues that I will leave the company?
If I do so, working there could get weird and also he could fire me which would make me unemployed for an unknown period.
If I don't tell anyone, people might be mad at me for getting trained and then leaving.

I am living and working in one of the DACH (Germany, Austria and Switzerland) countries in Europe.

Answer: 
**No, just give your notice once you have a job.**

I think organizations would gain enormously if they welcomed people telling them that they were planning to leave. The knowledge losses are enormous from it.

But you have to protect yourself. Your boss might fire you if he thinks you are disloyal. And you probably could use the income and it is much easier to find a job when you already have one.
> 
> Should I tell my boss or colleagues that I will leave the company?
> 
> 
> 

No.

Do your job search interview and wait until you have an offer in hand that you are ready to sign. Make sure that factor in your legally required notice time into negotiating the start date of your new job. Maybe you also want to do a few weeks of in-between down time, if you can afford it.

When the new job is ready to go, hand in your resignation and serve your notice period as stated in your contract. Sometimes you can negotiate an early departure, but be prepared to serve the full period.

If you want to be nice to your current employer, take good notes during your project onboarding that you can share with whoever will be taking over from you and you can start working (quietly) on a hand-over plan on the side. That's the best you can do.