Backus-Naur Form – layman explanation

I came upon this term at work, or its abbreviation BNF, that sent me on a search of trying to understand it. So here’s a post to solidify my understanding.

Here’s a youtube post that summarizes it quite nicely. https://www.youtube.com/watch?v=8cEhCx8pwio

What is BNF?

It is a way to describe how software language can be written, similar to how human language can be spoken. It is liken to the grammar, and I think it is easiest to think as so too. The difference between BNF and normal grammar is that normal grammar has a lot of exclusions. The interesting and main similarity is that BNF uses a definition to be used in another definition. I think the video above explains succintly.

To relate to my experience, I was telling my son that computers uses ones and zeros while humans counts differently. I asked him to subtract 9 million from 10 million, and he answered one million. I repeated without the millions and he dully answered. I then asked him to count his fingers and he got the understanding that we use only ten numbers only actually, being one to ten (which I corrected to 0 to 9).

He then went even further and said that actually we learn the same way, where we use what we understand then to discover even more things. Or we use things that we have to make more things (that we have). Kinda like Lego.

So yeah, BNF is like a catalogue describing the lego blocks in programming. I’ll settle for that now.

Thank you for reading.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *