[erlang-questions] Process scope variable

Gordon Guthrie gguthrie@REDACTED
Tue Feb 17 19:01:11 CET 2015


Imants

> Quite simply, there is a lot of the code. It does a lot, too. The code
> is of a size normally produced by a team of coders. The fact that I
> work on it without help, and refactor it, and it works, may be a good
> indicator.

I have been in this situation - the answer is to refactor it into ‘pure’ and ‘impure’ functions and take the hit on common state up front.

Every time you dip into the process dictionary that is another hard-to-reason-about code complexity  - you are making it worse, not fixing it… (although it might seem that you are fixing it)

Gordon

> Le 17 févr. 2015 à 17:44, Imants Cekusins <imantc@REDACTED> a écrit :
> 
> Hi Gordon,
> 
> Most of the code I write is about logic, branching.
> 
> Despite what may appear (I am not afraid to write before I think
> carefully because I do not write  to impress, I write when I feel
> like, that's all), I did gain considerable experience in producing
> robust working code in situations when colleagues and sometimes
> managers had simply given up.
> 
> The state referred to could be inputs, an accumulated result of input
> processing, parent process info, current stage.
> 
> Quite simply, there is a lot of the code. It does a lot, too. The code
> is of a size normally produced by a team of coders. The fact that I
> work on it without help, and refactor it, and it works, may be a good
> indicator.
> 
> Frequent refactoring is caused by the code growing organically rather
> than carefully planned. The main reason being: I do not think twice
> before changing requirements, specs. Also, whenever I get an idea, I
> refactor as much as necessary.
> 
> Basically, there is a lot of work. Common state will help me speed it up.
> 
> I'll get there ;)




More information about the erlang-questions mailing list