Programming and The Art of War

4.8
(84)

A few days ago on the Discord, there was a question asked about whether you could teach programming through the medium of ‘philosophical text’. An example was how Sun Tzu’s classic, The Art of War, is used to teach business practices.

This got me thinking… Can The Art of War be applied to programming and software development in general… Turns out that, with a little bit of twisting and wild interpretation, that it can! I shared a few on the Discord server, but thought I’d give the idea a more permanent presence here on the blog.

I’m going to take some Art of War quotes from a list compiled on GoodReads and see how they can be applied to programming…

Victorious warriors win first and then go to war, while defeated warriors go to war first and then seek to win

This feels very much like it could be talking about Test Driven Development; where you write unit/integration tests before you write any code, with the idea that your tests are written as if the code has already been written. Many proponents of this approach to programming claim it results in much more robust code – a definite victory!

There is no instance of a nation benefitting from prolonged warfare.

I think this definitely applies from a project management kind of perspective – it is much better to complete a project as quickly as planned. Projects that go on for longer than first imagined can go stale, cost more to both the developer and the customer, and can cause frustration on both sides.

Treat your men as you would your own beloved sons. And they will follow you into the deepest valley.

This one is a bit of a stretch, but I think it can apply to customer service – if “your men” are your clients, if you treat them well, they’ll keep coming back to you.

Even the finest sword plunged into salt water will eventually rust.

Okay, this is more of a joke than anything, but… “You need Rust!”

One may know how to conquer without being able to do it.

Knowing how to do something in theory is one thing, but actually being able to it is something else altogether… It’s quite easy as a beginner programmer to try absorbing all the knowledge before you write a line of code. Putting what you’ve learnt into practice is how you’ll really progress.

Great results, can be achieved with small forces.

I like that this could be interpreted along the same lines as one of Javid’s most popular videos: Programmers! Know when to stop! Don’t over-engineer your code.

Ponder and deliberate before you make a move.

It certainly pays off in any project – professional or for fun – to do some planning beforehand to ensure you know how to tackle the problem at hand. Taking time to think about what and how you want to achieve your goal will pay dividends down the line, for sure.

The control of a large force is the same principle as the control of a few men: it is merely a question of dividing up their numbers.

Even Sun Tzu knew that breaking up your code into smaller, more manageable chunks, is the way to go instead of monolithic classes and methods!


Okay, that’s enough of that… Point proven, I think. Hopefully you got a chuckle or two out of it, and maybe even some insight about programming.

Don’t spam me, but if you find any more, feel free to drop a DM on the Discord and maybe I’ll compile a ‘community edition’ version of this list – just include the quote and a small paragraph explaining how it relates to programming.

Rate this post!

Average rating 4.8 / 5. Vote count: 84

No votes so far! Be the first to rate this post.