It's bad ethics to write stuff that only you can maintain, so what other methods can one achieve this/what do you mean?
It's bad ethics to write stuff that only you can maintain, so what other methods can one achieve this/what do you mean?
Being good at something (or at least, much better than your co-workers) is the other method you're looking for, no need to resort to evil stuff.
Likely this was reflected in the OPs salary, note that he's let go but his co-workers are not, so probably he was making more per hour than they. And now he'll make more per hour still and his former boss will be more than happy to pay once he realizes that OP could turn him down just as easy as he was let go.
Don't burn your bridges...
Could be a win both ways in that sense. OA gets a customer with a regular need and existing investment. Former boss gains flexibility and can show headcount reduction.
However, even in the best codebase, it takes time for somebody new to come up to speed. If they need help now, it will make sense for them to call in the original developer.
So, if you were a good developer and something happens, you can get called in to consult. Make sure you hit them for 50+% more than whatever your salary was; that's the penalty for the company gaining the flexibility to not use you when they don't have work.
And, even if something doesn't happen, they might want you to train the next person, again, make sure you charge appropriately for it.
Don't be a dick--especially if the company is going down, there are going to be other people springing loose shortly and you might want to work for/with them.
Good luck.
It's bad ethics to write something only you can maintain for self-interest.
If your boss tells you to throw hacks in or pile up a bunch of tech debt, it's your job to say, "this is ill advised, and here's why", and then do it anyway if that's his or her informed decision. There are often pressing business needs that mean having feature X now, and possibly paying more in the future to clean it up or for other features, is a fine tradeoff.
Lots of code is in the place, where test coverage is poor or there are grungy hacks to make things work, and hence is much more easily maintained by the original author.