Syntax and Algorithms. What’s the difference?
What’s syntax?
Syntax can be said to be rules governing our use of a particular language. In English Language, syntax can be briefly described as the arrangement of words in a meaningful way, for example, “Ade bullies everyone in the classroom” is a meaningful sentence in contrast to “bullies everyone Ade in the classroom”
In programming, Syntax is the way we write our codes to achieve to avoid errors during execution. It’s a set of rules that guide the way we write and format our codes.
What is an Algorithm?
Algorithms in programming on the other hand are a set of predefined lines of codes that state the process data goes through when applied to it. It’s a set of instructions that details the process inputted data goes through before it’s processed
A simple example of an algorithm would be a line of code that tells us when it’s about to rain based on the data gotten from satellites or an algorithm that makes a diagnosis based on the information gotten from a patient.