(data-logic)=
# Blending data and logic

(two-different-programming-styles)=
## Two different programming styles
<!--separation of data and program logic (control flow)-->

Imagine you want to write an application that checks if the entered food is one of the following vegetables or not:
- carrot
- beetroot
- cabbage
::::{grid} 2
:::{grid-item-card} Take 1
```{literalinclude} ../code-wi/dietician_data_logic_integrated.c
:language: c
```
:::
:::{grid-item-card} Take 2
```{literalinclude} ../code-wi/dietician_data_logic_separate.c
:language: c
```
:::
::::

- `char variable[][N]` means a collection of strings, where for each string `N` characters are reserved. We will introduce this.

:::{activity}
:label: data-logic-separation
1. Which differences do you notice regarding:
   - readability
   - structure, e.g., where which components of code is located
1. How could this difference affect the programming experience?

Steps:
1. 3 min think individually and discuss with your partner
:::