3 ms·
No, definitely not. To me it is about the logical flow of thought that is put into a structured format. That might sound like spoken language, and to a certai
by turc1656 9y ago
No, definitely not. To me it is about the logical flow of thought that is put into a structured format. That might sound like spoken language, and to a certain extent it is. But code is more than just that. It is precise. There is no ambiguity. There are hard rules. A violation of format/structure/syntax is not allowed.
Most importantly, logical errors result in unexpected behavior. In most spoken language, someone could be an absolutely terrible speaker and can still manage to get the idea across. There is no code equivalent of saying to someone, "I dunno, it's hard to explain, but you know what I mean, right?"
I would say the closest "language" that code can be related to is legalese. It has definitions and exceptions and legal agreements tend to conform to standard to ensure their validity and enforceability. A significant error in this regard would void the agreement, or at least part of it - similar to a compiler error. Also, I like to think of good code being a battle plan where you want to make sure no one is able to do anything you don't want them to do, even if they do something unexpected or deliberately try to break your code. You try to think of every scenario that you can possibly encounter and you code for it. This creates a defense for your code. Legal documents tend to be created with a similar mindset of protection and survival.