yFaizuS / Delivery-International

0 stars 0 forks source link

Primitive Obsession #6

Open yFaizuS opened 1 year ago

yFaizuS commented 1 year ago
index.js

```javascript ... $(document).ready(function () { let type = "" let urutan = "" let vegetarianCheckbox = "" const data = ""; const headers = { 'Content-Type': 'application/json', }; ... ``` in the snippet code above shows a primitive obsession, from the variable **type**, **urutan**, and **vegetarianCheckbox** uses empty strings. However, using these primitive values directly can make the code less readable and harder to understand. It's a form of primitive obsession because it doesn't encapsulate the behavior or meaning behind these values.

LidiaIvanova commented 1 year ago

Primitive Obsession is a code smell and type of anti-pattern where you are trying to use primitives for definable basic domain models. But here you have simple string variables.