- 1
https://250bpm.com/blog:36/
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
https://250bpm.com/blog:36/
> At that point every semi-decent programmer curses spaghetti code in general and the author of the function in particular and embarks on the task of breaking it into managable chunks, trying to decompose the problem into orthogonal issues, layer the design properly, move the common functionality into base classes, create convenient and sufficiently generic extension points et c.
<…>
It turns out that the 1500-line function was parsing a network protocol. It is a 30-year old, complex and convoluted Behemoth of a protocol, defined by many parties fighting over the specification, full of compromises and special cases, dragged through multiple standardisation bodies and then anyway slightly customised by each vendor.
<...>
Unfortunately, it turns out that the tweak intersects the boundary between two well-defined components in the implementation. The right thing to do would be to re-think the architecture of the parser and to re-factor the codebase accordingly. <
Вот так вот. Не стоит спешить любую портянку из 100+ строк кода называть "спагетти-кодом". Код может быть функцией микроконтроллера в котором вызов функции достаточно дорогой по памяти/времени, сложным алгоритмом и пр. Спагетти - это про организацию кода. Монолитный (но хорошо мапящийся на домен) код понять проще, чем солянку из функций, классов и пр. которые решают непонятно какую задачу (это и есть спагетти-код). Алсо https://en.wikipedia.org/wiki/Wikipedia:Chesterton%27s_fence
Какой оптимизм )))
З.Ы. Не отвечай уняку.
Кстати, оно реально существует.
Сам посчитай, учитывая что бабы с ВОЗу некоторые буквы пропускают, чтобы не обидеть Председателя и других Гейцов.