Path: csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.lang.javascript Subject: Re: I don't get it Date: Mon, 12 Apr 2021 21:20:53 +0100 Organization: A noiseless patient Spider Lines: 37 Message-ID: <87a6q3p84a.fsf@bsb.me.uk> References: <1e965vkgenq7l$.hqmrkifgr4m5$.dlg@40tude.net> <586d1b88-77d5-42b0-ae5b-7506307df499n@googlegroups.com> <957a79db-946e-4f23-931a-ef7d4f0dbb3cn@googlegroups.com> <305fecc4-43da-4378-8430-ed10ac4dbe5bn@googlegroups.com> <20917gl3dv8shs6qqf1dqginq69e50aa54@4ax.com> <8735vytcwa.fsf@bsb.me.uk> <87lf9qrozz.fsf@bsb.me.uk> <875z0tq723.fsf@bsb.me.uk> <8b594439-379f-431f-8bf6-43c8066d3525n@googlegroups.com> <87o8ejpzv0.fsf@bsb.me.uk> <845c8b8e-d415-4b41-8327-6b31bc50825an@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: reader02.eternal-september.org; posting-host="120ddd2ae2a23c364f0a40468e351ead"; logging-data="16934"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19eBwsULlDAc+DdFsMjQimoAPZAWBr5uUw=" Cancel-Lock: sha1:V13XLgHqPH2XzpRhx0uq0IGfH8A= sha1:9hNI4INJZmszMUSAIYTqpetbq3I= X-BSB-Auth: 1.c67fcf8531f84a164aa2.20210412212053BST.87a6q3p84a.fsf@bsb.me.uk Xref: csiph.com comp.lang.javascript:39911 Jonas Thörnvall writes: > måndag 12 april 2021 kl. 12:21:45 UTC+2 skrev Ben Bacarisse: >> Jonas Thörnvall writes: >> >> > I still do not get it, so could someone comment on what goes wrong >> > with my approach "AND WHY LATENCY BUILDS UP" although i try to correct >> > it before each note played? Just give me a qualified guess. >> Your code is unmanagable. Almost any part of it can alter the behaviour >> of any other part. You might be sure what parts do what (though your >> repeated requests for help suggest you probably no longer know what the >> code is doing) but other people will find it almost impossible. >> >> Your best bet is to re-write it step by step making sure that functions >> are genuinely self-contained actions. Not only will the result be >> easier to modify, you will probably find the problem on your own. > You are dreaming Ben it is a single function with ten lines of code > and just two global arrays. The only code I've see here (it's in a direct ancestor post and is the code I was referring to) is at least twice that long and littered with references to non-local variables and arrays. In fact, there is not a single local reference in the twenty or more lines. You many know which of these are not used elsewhere, but I don't. That's simply not the sort of code I am going to spend time on anymore. I did that for pay in the late 1970s. Never again. We now know how to write proper code. You appear to keep hitting behaviour you don't understand in code you've written. That is the number one symptom of unmaintainable spaghetti code. My advice was not frivolous or intended to palm you off. There very best thing you can do is to re-write it all taking care to use proper, modern, programming practice. By doing that, you will almost certainly find and fix all the problems by yourself. -- Ben.