Questions tagged [static]
The static tag has no summary.
70 questions
0 votes
1 answer
194 views
IOC life cycle and static class
Does discussing the behavior of static classes make sense for IOC? It seems that in the case of a life cycle transient such a description is misleading and untrue: However, it is guaranteed to be ...
-3 votes
2 answers
533 views
Why would I use Gatsby instead of Manual HTML / CSS when creating a static site?
These days, I see people always extolling the benefits of using Static Site Generators (SSG) for building static sites. Why would I not just write the HTML/CSS myself? What's the advantage of using an ...
0 votes
6 answers
1k views
Is a static class full of static methods a code smell?
I have to create custom buttons but in order to encapsulate the logic of button creation I've this class (VB.net): Public Class ButtonCreator Public Shared Function CreateBaseButton(Optional ...
0 votes
1 answer
311 views
Why exactly was the C++ convenience of not requiring a second declaration, removed?
See "Note" on second page: This convenience gave rise to serious inconsistencies and was removed several years ago The book was authored in 2003. What exactly does it mean by "Serious ...
2 votes
2 answers
5k views
Dependency Injection vs Static Dependencies
I am building a wrapper for a library that requires little complex logic. The whole project is 8 builder classes, 4 classes for doing some pre-processing, and a couple visitor classes. Essentially I ...
3 votes
2 answers
2k views
File scope static variables with non-trivial destructors
I am coming from the Google C++ guidelines, specifically the section on Static and Global variables. It advises against having global variables of types that aren't trivially destructible. I'm unsure ...
3 votes
3 answers
1k views
Is there any performance hit associated by the definition of a static constructor or due to availability of it?
This question is mostly related to the way language implementer do implements static class initalization (pretty specialized question). It is for curiosity and also to potentially improve my code to ...
1 vote
1 answer
466 views
Identifying Risks/Gotchas When Using Static
I am intending to come from the perspective of development choices, code reviews, and general testing against defined environments (Development, Test, Production, etc.). I will be using C# as the ...