Skip to main content

Questions tagged [scope]

-1 votes
3 answers
250 views

I am working on a compiler in TypeScript, and currently am focused on how to pass around the "lexical scope" to the relevant objects. Essentially every time there is a conceptual major ...
Lance Pollard's user avatar
1 vote
2 answers
246 views

I like programming in such a way that every component/injectable of the applications I build, has a clearly defined scope, and it's easily tested. With years working as a Developer I've come to ensure ...
caeus's user avatar
  • 129
0 votes
0 answers
91 views

When working with functions that run a few short "procedures" in sequence that are not used anywhere else and it makes sense to keep it all inline, in a single function, a large part of the ...
Jake1234's user avatar
  • 129
10 votes
7 answers
2k views

I have a question regarding my general understanding of global state in software engineering. When I write an app I like to decompose it into little, manageable components and functions, that are ...
Angelica's user avatar
  • 109
0 votes
2 answers
63 views

In other words, should the raising of an HTTP 4xx code be considered an error, and should the job of sending an HTTP 4xx code to a client be delegated to an error handler? Or is it simpler to just ...
Asker's user avatar
  • 109
3 votes
3 answers
4k views

I often define variables that will never change, i.e. constants, at the top of a script/module. But recently I've been wondering if it makes sense to define them at the function scope level if they ...
pstatix's user avatar
  • 1,047
0 votes
1 answer
66 views

I am using a great deal of jquery. I have several "sub-pages" that are loaded into a main div by a menu click. Each of those sub pages has an associated javascript file. I have been loading the ...
Dave Davis's user avatar
1 vote
2 answers
110 views

In many languages there is a scope that is just less than public called internal. Wondering, Why none of the language, implemented a feature on internal such that one can specify Only what other ...
Saran's user avatar
  • 407
9 votes
2 answers
4k views

Variables in JavaScript are lexically scoped. But, I wonder, is the this keyword, referring to the receiver of a method, an example of dynamic scoping. Or is this unrelated to the lexical/dynamic ...
user1283776's user avatar
-1 votes
1 answer
214 views

I've got the following scenario: bool bWantToWait = getRandomBool(); if (bWantToWait){ std::future<bool> bSuccesfullWait = this->doStartWait(); } //lots of lines of code //even more ...
Daniël van den Berg's user avatar
2 votes
3 answers
98 views

tl;dr: I work at a small company with a development team of 5-10 people, lately we have been asked to present "scope documents" for effectively all of our work before we carry out the actual work, ...
user338717's user avatar
37 votes
8 answers
10k views

According to the accepted answer on "Rationale to prefer local variables over instance variables?", variables should live in the smallest scope possible. Simplify the problem into my interpretation, ...
ocomfd's user avatar
  • 5,760
1 vote
1 answer
74 views

For example, suppose my application have some sound files, now I define all sound file references in a single class: public class SoundHelper{ public static Sound buttonSound=new Sound("(some url)...
ocomfd's user avatar
  • 5,760
8 votes
7 answers
1k views

I'm a newbie coder. I find it troublesome to declare a variable in 1 function and not be able to access it in other functions. I have to make many of my variables global just to get my code to work. ...
clickbait's user avatar
  • 211
0 votes
2 answers
273 views

I've been coding in C++ professionally for six odd years, and it's my go-to language for performance-critical projects. When working to a deadline, the scope expands to fill the time available. ...
user avatar

15 30 50 per page
1
2 3 4 5 6