My experience:

(1) Do bang up, really good word, save/make major improvements in the work of the organization.

(2) Thus, fully unintentionally scare the management (afraid of being upstaged, shown up) all the way to the top.

(3) Have the scared management arrange to fire you.

Response: Find a market need can meet with own resources (e.g., think of a new Web site, get some computing equipment, write the code, go live on the Internet, get some publicity, users, and ad revenue, entertain buyout offers), be the first level worker and also the manager and owner. Basically, if get good revenue, can't get fired, e.g., can't lose your job.

Experience examples:

(1) In high school plane geometry, in class mostly slept, refused to admit doing any of the assigned (too simple) homework, but there were some more difficult exercises in the back of the book so made sure I did ALL of them. One took me Friday to Sunday evening, and on Monday in class the teacher had the class work on an easy exercise with the same figure, so for the only time I participated said "There's an exercise in the back with the same figure ...". For about 20 minutes the class and teacher struggled with increasing frustration but no success. Since I didn't want to be accused of wasting the class time, said "Why don't we ...", and the teacher interrupted, spoke over me, wouldn't let me finish the suggestion, and said with anger "You knew how to do it all the time." Of course, wouldn't say anything otherwise. Point: The main goal was to learn some plane geometry which I was doing apparently quite well but got anger instead of praise.

(2) At the end of the class, there was a State achievement test. The last problem was "What is the first step in using construction to inscribe a square in a semi-circle." I didn't get it so after the test kept working on it until I did. My solution was first to construct something easier: Construct a square of whatever size, circumscribe a semi-circle, thus, have a figure similar to the desired one but of the wrong size, construct a 4th proportional to get the needed length in the given semi-circle. Constructing the second figure looked novel, not from the course, so after school asked the teacher if that was okay? She said "No, but why are you working on that?" Later I discovered that I'd reinvented similitude, actually taught in some more advanced material. Point: The main goal, even beyond what was in the class and book, was to make progress, even invent, in the subject. Again the from the teacher I got contempt instead of praise.

(3) Working in a time-sharing company, my job was the math library. The FFT (Fast Fourier transform) was a hot topic, and I got fairly deep into it, along with the related Blackman-Tukey power spectral estimation, dropping the assumption of number of samples a power of 2, etc. The manager's remark was "You tend to pick the bones clean" and fired me. Point: The main goal was to please the customers, and having a better software library in the FFT hot topic was a part of that. So, from doing admittedly exceptionally good work, I got fired instead of promoted or even keeping my job.

(3) After the FFT work, got hired as helper of users of a university computer center. As a tool for teaching some statistics, a prof had written a main program to call the statistics routines in the IBM SSP (scientific subroutine package). In testing he found that
two of the routine were slow (for integer n points of input ran in time proportional to n^2) and for polynomial fitting (via a method that led to the notoriously ill conditioned Hilbert matrix) gave numerically inaccurate results. So, for the two n^2 cases, I found tricky ways to use the n(log(n)) heap sort without using more storage (did some tricky overlay, reuse of the storage in the passed parameters) and for the polynomial case used some Forsythe and Moler work to get better numerical accuracy. To do this, some days I worked late, and the head of the computer center said critically I hear that you have been working all hours of the day and night" and fired me. The Dean of the business school kept me on to teach courses in computer science. Point: Again the main goal was to have better software, better than the prof wrote, to have a better computer center, and my work, improving on what the prof and IBM had done, was exceptionally good work, but I got fired instead of praised.

(4) At FedEx, the BOD was seriously* (funding at stake) concerned about scheduling the fleet. At a meeting to see how to respond, no one had any ideas, so I said I'd solve it. I had some ideas, wrote the code, ran the code, pleased the BOD, saved the funding and the company, and got an angry manager who tried to get me fired. The founder, COB, CEO got me a Senior VP as a new manager; I did some better work on scheduling the fleet, and the VP's response was "there no money in the budget for you", and wanted me fired. The promised stock was very late, and I went for a Ph.D. in such applied math. Later FedEx worked with a prof and a grad student and implemented, as a Ph.D. dissertation, my scheduling idea (0-1 integer linear programming set covering). While reporting to the VP, I pleased again the BOD and saved the company. Point: So, I had saved the company twice, and the new scheduling proposal in effect directed a dissertation, i.e., it was good work. But the two managers both tried to fire me and there was no stock and no money in the budget.

(5) Later in a major AI project, there was a big problem with the design and code. The team had a crude solution in mind, that would take weeks of coding and at best would not be very good. So, I had an idea, got a pizza, worked all night, and had running code for a nice solution. I got an award from my manager, but from the rest of the management chain soon I was fired. Point: I'd done novel, good work, saved the AI project, but got fired.

There are a few more examples.

Old quips: "No good deed goes unpunished." "The nail that sticks up gets hammered down." "Don't rock the boat."