tagged [global-variables]

Default values and initialization in Java

Default values and initialization in Java Based on [my reference](http://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html), primitive types have default values and Objects are null. I ...

Global variables in AngularJS

Global variables in AngularJS I have a problem where i'm initialising a variable on the scope in a controller. Then it gets changed in another controller when a user logs in. This variable is used to ...

28 Jul at 15:55

Global Variables in Dart

Global Variables in Dart I try to create a Dart single page application. I have created a first custom element (`custom-application`) which contains the whole application. It has a container in it whi...

21 Mar at 12:21

How to modify a global variable within a function in bash?

How to modify a global variable within a function in bash? I'm working with this: I have a script like below: Which returns: But if I assign the result of the function to a variable, the global variab...

20 Mar at 10:4

If a "Utilities" class is evil, where do I put my generic code?

If a "Utilities" class is evil, where do I put my generic code? I generally live by the rule that Global variables / functions are evil and that every piece of code should live in the class to which i...

Thread Local Storage For C# Class Library

Thread Local Storage For C# Class Library I have a very old but very large library which I am considering converting to a C# class library. The existing library uses a lot of global variables stored i...

21 Oct at 14:26

Is it bad practice to have state in a static class?

Is it bad practice to have state in a static class? I would like to do something like this: ``` public class Foo { // Probably really a Guid, but I'm using a string here for simplicity's sake. str...

23 May at 10:28

How do you keep the value of global variables between different Action Methods calls in MVC3?

How do you keep the value of global variables between different Action Methods calls in MVC3? I am developing an ASP.NET MVC 3 web application using Razor and C#. I just discovered that I have some pr...

9 May at 15:51

Best practices to using global variables in C#

Best practices to using global variables in C# [Someone once said](http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/071dc2fb-76c3-4484-8418-6b37664995f7/): > [That might be true](htt...

23 May at 10:28

filedialog, tkinter and opening files

filedialog, tkinter and opening files I'm working for the first time on coding a Browse button for a program in Python3. I've been searching the internet and this site, and even python standard librar...

C# : So if a static class is bad practice for storing global state info, what's a good alternative that offers the same convenience?

C# : So if a static class is bad practice for storing global state info, what's a good alternative that offers the same convenience? I've been noticing static classes getting a lot of bad rep on SO in...

11 Aug at 23:4

Most Pythonic way to provide global configuration variables in config.py?

Most Pythonic way to provide global configuration variables in config.py? In my endless quest in over-complicating simple stuff, I am researching the most 'Pythonic' way to provide global configuratio...

1 Jun at 12:9