Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

What is “spaghetti” code?

Автор: Smok Code

Загружено: 2020-11-12

Просмотров: 11499

Описание:

We all know how things are when you enjoy your spaghetti too much: slurping all without any consideration getting that sauce everywhere: cheeks, eyes, ears, your momma’s favourite tablecloth. Eating in a clean way without cutting it in pieces is way too hard to make it worthwhile. Same goes with the programming: when working with really messy code that isn’t following any good practices well often say it’s spaghetti code. But what is spaghetti code anyway?

#programming #tech #softwaredevelopment #cleancode #quickanswer

Implementing Effective Code Reviews
UK: https://amzn.to/355xOTW US: https://amzn.to/3dAgr1q

This term draws its meaning back from olden days when things weren’t as refined and settled as they’re now. Fathers of programming had to invent many concepts themselves, and until they did - many things were written without them. One such concept is structured programming invented by dutch computer scientist Edsger Wybe Dijkstra. Oh this guy. In 1968 he wrote an open letter “Go To Statement Considered Harmful” to Communications of the Association for Computing Machinery. Wow that’s a mouthful.
This letter caused serious debate in the community. You see - GOTO is the programming instruction that makes the program jump, or continue execution from a different place in the code. It is similar to the behaviour that happens when an IF statement’s condition is not met. Program just skips execution of these few lines that are between curly braces. GOTO is an unconditional change of execution flow from one portion of code to another.
Such jumps are imperative for compiled machine code, as processors only support limited logic, and we need to optimise for speed there, but no programmer is expected to think and design like a CPU. Almost no languages of higher level support goto today, and those which do - discourage its use.
Despite not using GOTO, modern code can still be considered a spaghetti code. Giuliana Carullo outlines following examples in her book (see the description):
Do not design your solution in advance, that is, no architecture, nothing.
Use a bunch of global variables.
Use an object-oriented (OO) language, but dismiss all the benefits (inheritance, polymorphism, etc.).
Forget that someone told you that design patterns exist. They are your enemy.
Write big classes with tons of different responsibilities.
Write highly coupled components.
Don’t think about APIs and just pick and choose your preferred names.
If parallelization is required, just add a bunch of threads when you think it might somehow work.
Don’t consider code reusability; someone else needs to reinvent the wheel in case needed.
It doesn’t take a genius to understand that this is a great spaghetti recipe. I call it: fire and forget - once you wrote this code forget about changing it in the future.
I recently had a pleasure of refactoring such code from its original form - I even found some goto’s in it, as C++ still supports them. It is less than 5000 lines of code, but I’m 9 months into this process and I still haven’t completed the damn refactoring. Majority of time was spent on writing unit tests, as there were none. Man - let me tell you: spaghetti code is a nightmare to maintain! Subscribe, and I’ll see you in the next one, cheers!

What is “spaghetti” code?

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

What is the KISS rule in programming?

What is the KISS rule in programming?

How to STOP writing spaghetti code

How to STOP writing spaghetti code

How I Untangled My Spaghetti Code

How I Untangled My Spaghetti Code

Как взломать любое программное обеспечение

Как взломать любое программное обеспечение

КАК НЕЛЬЗЯ ХРАНИТЬ ПАРОЛИ (и как нужно) за 11 минут

КАК НЕЛЬЗЯ ХРАНИТЬ ПАРОЛИ (и как нужно) за 11 минут

This Is Why Your Python Code Turns Into Spaghetti

This Is Why Your Python Code Turns Into Spaghetti

How Senior Programmers ACTUALLY Write Code

How Senior Programmers ACTUALLY Write Code

Bad Code v.s. Good Code

Bad Code v.s. Good Code

"Clean" Code, Horrible Performance

⚡️ Операция ФСБ в Киеве || Военные силы РФ в столице

⚡️ Операция ФСБ в Киеве || Военные силы РФ в столице

Избегайте наследования при разработке ООП-программного обеспечения?

Избегайте наследования при разработке ООП-программного обеспечения?

Spaghetti Code is OK Now...

Spaghetti Code is OK Now...

Путин избавился от генерала / Арест и расстрел

Путин избавился от генерала / Арест и расстрел

Domain-Driven Design | Просто о сложном

Domain-Driven Design | Просто о сложном

Линус Торвальдс в ярости из-за предложения RISC-V

Линус Торвальдс в ярости из-за предложения RISC-V

What is Spaghetti Code and How to Avoid It

What is Spaghetti Code and How to Avoid It

Cleaner Code: 3 Ways You Can Write Cleaner Code

Cleaner Code: 3 Ways You Can Write Cleaner Code

The 3 Laws of Writing Readable Code

The 3 Laws of Writing Readable Code

Программирование на ассемблере без операционной системы

Программирование на ассемблере без операционной системы

L07 Avoiding Spaghetti Code

L07 Avoiding Spaghetti Code

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]