I was the 12-year-old girl who stayed inside at recess to dissect frogs in the biology lab. In high school, I was one of only two girls on the maths team – sticking with it in spite of the bullying teacher in charge, who professed "girls can't hold a candle to the boys in math". The other girl earned a degree in applied mathematics. I went to medical school.

In medical school, I was encouraged time and again – by clinical instructors both male and female – to go into paediatrics or obstetrics and gynaecology, the "fitting" specialties for women. Though I admired my colleagues who did pursue those fields, that wasn't my path. I was interested in surgery and in pathology – twinned passions that led me to forensic pathology. I have built a career as a doctor who performs autopsy death investigation, which is very unladylike.

So when I came across the Twitstorm over IBM's #HackAHairDryer campaign, I was genuinely confused. At first I thought it was a spoof. Why a hairdryer? IBM doesn't make hairdryers. It makes the world's most powerful supercomputers, among many other things. #HackAHairDryer couldn't be a real effort to persuade women to come work for it. Right?

Wrong. On its website, it has a page seeking to recruit women in consulting. It has a Women at IBM Facebook page. IBM's CEO is Ginni Rometty. Yes, the top executive at this company is a woman and she didn't reach that position with the aid of a hairdryer.

We can guess someone in the bowels of IBM's marketing department was told to create a hashtag campaign to attract women scientists to the company. So they overlooked all the women at the company who were writing code, creating artificial intelligence, running meetings, bossing people around—and, instead, came up with this: Hairdryers!

The wicked (and predictable) social media backlash has apparently caused IBM to shut down #HackAHairDryer, but, as a woman and a scientist, I really hope this epic hashtag fail doesn't sour the firm on reaching out to the #womenintech and #womeninscience who would certainly be excited to join its ranks. In the interest of advancing that cause, I would like to suggest a few ideas for its next campaign – and for any company thinking of reaching out to women and girls who love science and technology.

1: Consult the women who already work for you on how to attract others to the field. Interview them and ask them what they love about their jobs, and what they would go back and tell their 10-year-old selves about the work world. Make a two-minute YouTube video of those interviews.

2: Set up marketing campaigns that have money and mentorship programmes attached to them, both internships and paid scholarships. The mentors don't all have to be women, but they do have to treat your target audience like equals, and pay them for their time and labour. Asking women to #HackAHairDryer for free, with no compensation or purpose, is a waste of everybody's time. Instead, invite them to hack into a purpose-built server to see how secure it is. Invite girls who code to write a programme that you can actually use.

3: Tell us about the women in leadership positions at your company. Who are your female lead engineers? What contributions have they made to the company? If you don't have women in leadership positions, then you need to look at your hiring practices. When more women have hiring authority, more women get hired.

4: Once they're hired, you want them to stay. Set up family friendly work environments with paid parental leave. Allow employees to work from home. Create a marketing campaign that shows what a great company you are to work for. You won't have to hire actresses for it.

Don't waste our time with condescending marketing campaigns. If you want to inspire women, show us the money. If you fund it, we will come.

Dr Judy Melinek is a forensic pathologist who performs autopsies for for the Alameda County Sheriff Coroner's office in California, and is the CEO of the medico-legal consultancy PathologyExpert Inc. Her New York Times best-selling memoir Working Stiff: Two Years, 262 Bodies, And The Making Of A Medical Examiner, co-authored with her husband, writer TJ Mitchell, is now available in paperback.