Ruling on working as a programmer for a company that sells some unlawful items
Praise be to Allah
It is permissible to work in programming that will be used for permissible purposes, such as buying and selling, on the basis that buying and selling are permissible in principle, so long as that does not involve helping in something haraam, because Allah, may He be exalted, says (interpretation of the meaning):
“And cooperate in righteousness and piety, but do not cooperate in sin and aggression. And fear Allah; indeed, Allah is severe in penalty”
The fuqaha’ stated that the means come under the same ruling as the ends, and that whatever may lead to haraam is also haraam. Similarly, they stated that it is prohibited to sell grapes to someone who will use them to make wine, or to rent a building to someone who will use it for unlawful purposes, because that comes under the heading of helping in what Allah, may He be exalted, has prohibited.
So it is not permissible to work as a programmer for a riba-based bank, or a business that sells alcohol, and the like.
As for businesses whose products are mostly permissible, it is permissible to design programs for them, even if they sell some things that are haraam, because the presence of some unlawful things in stores is something that has become overwhelmingly widespread (and can no longer be avoided), such as cigarettes and the like. That is so long as the programs do not specifically mention these haraam things.
In the answer to question no. 11517 there is a fatwa from Shaykh Ibn ‘Uthaymeen about concessions regarding such matters.
It is not permissible to sell statues, crosses, images of animate beings or images that include crosses, because it is not permissible to make any of those things. Rather what is required is to remove the images and statues, and to break the crosses, for when Allah prohibits a thing He also prohibits its price. See the answers to questions no. 49676, 98632 and 115038.
And Allah knows best.