“A SAMURAI would never write software!” barked a senior executive at one of Japan's biggest electronics firms, as drinks flowed at a dinner party. His view is widely held in Japan. Monozukuri (making things) is macho. From sword-forging in feudal times to machines and microchips today, real men toil tirelessly to make things you can see. Services are for sissies.

But like the traditional samurai hairstyle (shaved pate and topknot), such attitudes are looking increasingly out of date. Writing business software is now a growing business in Japan. The country's large electronics companies are buying into the sector. Even foreign companies are coming to Japan in search of programming talent.

Software firms typically make fatter profit margins than hardware firms. The best ones easily hit 30%; electronics firms struggle to reach 5%. The software business needs fewer people and less capital; handy for a country with a shrinking population and tight-fisted banks. Jobs at big electronics firms are scarce, and the work is sometimes boring. Small wonder that Japan's young, creative engineers are getting in touch with their inner sissy.

Japan has long made popular video-game software—just ask the Mario Brothers. Yet its computer makers have done little to foster independent software businesses. On the contrary, by bundling programs free with machines, they taught customers that software was of little value, says Kazuyuki Motohashi of the University of Tokyo. They also locked customers in, making it costly and cumbersome to switch to rivals.

The result is that Japan's software industry is underdeveloped. Since 2008 Japanese software firms have lost 20% of their market value, even as software firms elsewhere grew by 15%. In software spending relative to GDP Japan ranks 35th, around the level of Saudi Arabia, according to INSEAD, a business school.

Japanese code has tended to be inferior, says William Saito, an entrepreneur who sold his software company to Microsoft years ago. This is because it mirrored the shortcomings of Japan's business culture: it was written in a hierarchical way that outsiders would have trouble building on, when the trend in America and Europe was exactly the opposite.

A transition is under way, however. Firms such as Rakuten, an online shopping mall, and DeNA, a developer of games for mobile devices, have reached global prominence. So has Trend Micro, a big security software firm. Small companies are succeeding too, such as Cybozu, which makes collaboration software. And Japan has begun filing international software-related patents galore (see chart). Only America files more.

An example of Japan's shift to software is Ruby, a programming language that undergirds big websites such as those of Twitter and Groupon. It was created in Japan by Yukihiro Matsumoto, and counts 1m developers around the world. Marc Benioff, the boss of Salesforce.com, a large “cloud computing” firm in Silicon Valley, sees opportunities everywhere in Japan. Over the past year the company paid $212m for Heroku, which develops web services based on Ruby, and acquired stakes in Synergy Marketing, Uhuru and Netyear, three business-software firms.

Old hardware companies want a slice of the software sashimi. Most are looking abroad. On July 1st NTT, Japan's incumbent telecoms operator, said it would acquire OpSource, a cloud-computing software firm in California, for $90m through its South African software subsidiary, Dimension Data, which NTT acquired last year for $3.3 billion. Hitachi and Toshiba are hunting for software firms, too. Fujitsu, a big hardware firm, already gets two-thirds of its revenue and nearly all its profits from software and services.

Japan's indigenous software industry faces several obstacles. The country lacks venture capital, a vibrant stockmarket and angel investors with technical knowledge to nurture start-ups. And its big, slow firms tend to suffocate the small fry, says Fujiyo Ishiguro, the founder of Netyear, an online-marketing software firm (and one of the few female bosses of a publicly-listed company in Japan).

For now, hardware is king. Newspapers cheered when Riken and Fujitsu unveiled the world's fastest supercomputer in June. But the shift towards the intangible is inevitable, says Ms Ishiguro. Japan's sissies are tougher than they look.