Traditional Programming VS Machine Learning

Amjad El Baba
2 min readOct 2, 2021

--

productcoalition.com

Nowadays, IT field is living a prosperity in its different branches, programming structure, implementation & methodologies was always changing in consideration of one main question: what is the objective I’m programming for? Or what is the project I’m aiming to achieve?

In this article, you will gain knowledge about:

What is traditional programming

What is Machine Learning coding style

Difference between these two styles

Traditional Programming

This type of programming is based on a traditional program or software written by a programmer manually defining its use cases and conditions as shown below:

Machine Learning

On the other hand, ML is a subset of Artificial Intelligence in a way of letting the software predict and anticipate what the output would be without being previously prepared or programmed to do so

Differentiation Between Both Styles

There are major differences between these two styles, we will see them through some code snippets.

Traditional Programming Style

let’s demonstrate a simple example for the sake of understanding the difference:

if(foodAteByChild == "Apple"){//Rule
print("You are a good boy"); //Answer
}
else if(foodAteByChild == "Chocolate"){
print("You must stop such types of food because it harm your teeth");
}

So, as we see here, the outputs are already defined in our program, and this program has no chance to predict or give an output other than the ones defined.

Machine Learning Style

In this way of programming, a dataset is feed into our model (which is a certain algorithm we are working on) in order to achieve an output containing a prediction which is predicted by our program previously trained by this dataset.

If you want to check how a Machine Learning (especially Deep Learning) program is written, please check here one of the small code snippets offered by Coursera.

To sum-up what we have learned in this article:

  1. A clear and simple definition of both ML and Traditional Programming styles of coding.
  2. The main difference in the concept of each one considering the way and type of implementation.

Thanks for your time and let’s boost our knowledge!

--

--

Amjad El Baba

Data enthusiast, developer, hard worker and a detail-oriented person who enjoys team work and leadership. Passionate about AI, Big Data and Data Science.