3 ms·
The problem I have with this line, is it ignores the dealing with mutable state you already do on a daily basis. Are you confused that the listing on hackernew
by taeric 11y ago
The problem I have with this line, is it ignores the dealing with mutable state you already do on a daily basis.
Are you confused that the listing on hackernews changes depending on time of day? Why would you be confused that a call to "incrementCounter" changes the value of the counter? Or that a call to "printf" adds to the output?
I agree that having a large function where the value of something changes at the top and at the bottom can be confusing. But so can a function where you have two variables of type String because you had to sanitize the input and assign it to a new variable.
Are there ways to avoid that particular error. Certainly. Yet I have encountered that about as many times lately as I have encountered "mutable" based errors.