![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
... is passing parameters via "common variables", imitating "environment", which they are on most occasions not.
This is unavoidable if you have functions 100 lines long; you have those variables keeping this and that... then you split the code, but you have to keep those "shared variables", so there.
They are just parameters, you know. If you think of them this way, your architecture becomes clean and clear.
This is unavoidable if you have functions 100 lines long; you have those variables keeping this and that... then you split the code, but you have to keep those "shared variables", so there.
They are just parameters, you know. If you think of them this way, your architecture becomes clean and clear.
no subject
Date: 2014-05-04 07:32 pm (UTC)no subject
Date: 2014-05-04 07:39 pm (UTC)no subject
Date: 2014-05-04 08:27 pm (UTC)no subject
Date: 2014-05-04 09:53 pm (UTC)no subject
Date: 2014-05-04 09:57 pm (UTC)no subject
Date: 2014-05-04 10:24 pm (UTC)no subject
Date: 2014-05-05 01:41 am (UTC)no subject
Date: 2014-05-05 02:10 am (UTC)After I left that company I heard they abandoned their DSP started using normal ARM processor (closed to the one in modern gadgets). Their capital is the intellectual property, the code developed for DSP which is now the base for the product with normal computing architecture. I lately asked the man who still works there if they refactored the code so it is not as ridden with stateful variables. The guy stared at me ad asked "Why? It works well".
So, I guess, global variables are just a historical burden in the code, mostly. And nothing prevents not to use them now in C/C++ though, if we know that that program code operates with precisely ONE instance in the system, it gives a chance to implement the singleton with all precautions for concurrent use. Otherwise... m... you need to somehow maintain the logic state correctly?
no subject
Date: 2014-05-05 03:58 am (UTC)no subject
Date: 2014-05-05 03:50 am (UTC)no subject
Date: 2014-05-05 03:58 am (UTC)no subject
Date: 2014-05-05 04:05 am (UTC)no subject
Date: 2014-05-05 04:19 am (UTC)no subject
Date: 2014-05-05 04:35 am (UTC)no subject
Date: 2014-05-05 07:05 pm (UTC)no subject
Date: 2014-05-05 07:09 pm (UTC)no subject
Date: 2014-05-05 08:02 pm (UTC)no subject
Date: 2014-05-05 10:02 pm (UTC)no subject
Date: 2014-05-05 10:25 pm (UTC)no subject
Date: 2014-05-05 10:26 pm (UTC)no subject
Date: 2014-05-05 10:37 pm (UTC)no subject
Date: 2014-05-05 10:43 pm (UTC)no subject
Date: 2014-05-05 10:47 pm (UTC)no subject
Date: 2014-05-05 10:52 pm (UTC)Не очень внимательно пока читал, но показалось, что банальный цикл, и вуаля, имеем висящий в памяти синглтончик на Scala. :) Он отвечает на запросы. Всё как у людей.
no subject
Date: 2014-05-06 12:20 am (UTC)на хаскеле всяких стейт машин написано два миллиона, а может и больше. скала гораздо ближе к промышленности, на ней академические задачи мало кто решает
no subject
Date: 2014-05-05 04:06 am (UTC)no subject
Date: 2014-05-05 04:11 am (UTC)no subject
Date: 2014-05-05 10:27 pm (UTC)Единственно что еще до Вадлера был такой Трахтман, в одной конторе на Васильевском; он впаривал монады в программировании, ссылаясь именно на Лейбница, но описывая именно наши, программистские, монады. Он написал об этом письмо в обком, которое, по неписаным законам природы, попало мне для рецензии. Ну и т.д.
no subject
Date: 2014-05-06 12:29 am (UTC)no subject
Date: 2014-05-06 03:33 am (UTC)no subject
Date: 2014-05-04 11:55 pm (UTC)If your function has too many parameters, you probably forgot to add some (c)
no subject
Date: 2014-05-04 11:57 pm (UTC)A Scala style guide suggests to have not more than one, and curry it if you have more.
no subject
Date: 2014-05-05 10:23 am (UTC)нет решения этой проблемы
Date: 2014-05-05 10:19 am (UTC)или стопиццот параметров функции, во всех функциях те же (лог хэндлер, конфиг, окно наше, аппликейшн)
или объект или структура (context, ага) - якобы мы передаем один аргумент, на самом деле в нем вся каша
или кложуры, которые суть те же объекты с состоянием внутри
У Тойоты всё честно и проще.
no subject
Date: 2014-05-06 07:37 am (UTC)The parameter stack is much harder to screw up.