[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setting global variables

From: Ian McCallion
Subject: Re: setting global variables
Date: Sat, 27 Oct 2018 11:56:04 +0100

On Sat, 27 Oct 2018, 09:31 Andreas Weber, <address@hidden> wrote:
Am 26.10.18 um 19:40 schrieb Fritz Sonnichsen:
> I have been using the "global" directive to set up some (around 50)
> global variables in a script. However in order to access them from

In my opinion global variables aren't needed and shouldn't be used. When
I've started using GNU Octave >15years ago I thought I have to use them
but after I got more familiar with the language and I discovered
anonymous functions and guidata, appdata (which is basically global) I
never had to use globals again.

I understand the general objections to globals but alternatives doing the same thing should help in terms of code clarity and/or compactness and/or performance and I can't see at the moment how your solution is better. What am I missing?

Cheers... Ian

reply via email to

[Prev in Thread] Current Thread [Next in Thread]