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.
> 
> 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.
> 
> 
> 

Frankly, I think you are overestimating how crucial you are to this project.
Your managers never took it for granted that you are always available and if
they thought it would be problematic if you leave, they would have taken countermeasures.
All you would be doing is creating a weird situation and harming your own standing in the company until you leave.