Tag Info

Hot answers tagged

41

Why? Because, although consistent terminology is generally good for the entire profession, language designers don't always respect the language use of other language designers, particularly if those other languages are perceived as competitors. But really, neither use of 'reference' was a very good choice. "References" in C++ are simply a language construct ...


8

A reference is a thing that refers to another thing. Various languages have ascribed a more specific meaning to the word “reference”, usually to “some thing like a pointer without all the bad aspects”. C++ ascribes a specific meaning, as do Java or Perl. In C++, references are more like aliases (which can be implemented via a pointer). This allows pass by ...


7

In the C++ view of the world, a literal does not occupy any memory. A literal just exists. This view makes that there is no address for a pointer to refer to when it would point to a literal and for that reason, pointers to literals are forbidden. Const references are actually the exception here in that they allow apparent indirect access to a literal. ...


6

Not sure what you mean with reference driven programming. From what I gather, you're wondering what the advantages of event-driven programming are as opposed to writing code, and then using a bunch of branches to determine when to call a given method. Before I set off, allow me to be pedantic and point out that: a module can't listen for any event, nor can ...


5

In C++, literals exist only in the compiler. They are used in expressions, assignments and initialisations. The value of a literal may be found in the running program if it has been used to initialise a variable or temporary, but the literal itself is not. A name that is a reference to a literal has meaning, because a reference is a value, so that wherever ...


4

Members of reference types can only be initialized in the initializer list in constructor, because references cannot be rebound. So they have to be initialized in constructor like you wrote. It's the only way. Which brings up two points: Isn't the class too big? Are they really all injected dependencies to be held by reference? A "Player" class looks more ...


3

It largely goes back to Algol 68, and partly to a reaction against the way C defines pointers. Algol 68 defined a concept called a reference. It was pretty much the same as (for one example) a pointer in Pascal. It was a cell that contained either NIL or the address of some other cell of some specified type. You could assign to a reference, so a reference ...


3

Not 100% sure I know what you're asking. But, I get the sense you're at a point where event-driven programming doesn't feel "real" enough -- or like you're at the mercy of someone else's event system. Or like your application isn't really "doing" anything. Or like it's just a bunch of disparate methods that you're feeding another application. So. Suppose a ...


2

What is inside the ready function is encapsulated in a separate scope from everything globally. Put your test cases in the same scope to work. There other approaches to be taken, is to do with closures, wrapping the anonymous function (in the ready event handler), putting it in a variable and then passing it to ready.. And then using that variable to pass ...


1

It looks like Bouncy Castle has a NuGet package. You could set up your VS2013 solution for package restore, and then reference Bouncy Castle through NuGet. By doing so, you don't actually store the referenced files in your repository at all, just the NuGet reference. Then, when somebody else builds your project, the package restore process will download the ...


1

From a C++ language standpoint, your code is fine. As a C++ user, it depends very much on the semantics of struct A if I would expect it to maintain a reference/pointer to B, make a copy of it or to use the constructor parameter only in the constructor. My general expectations are (all unless indicated otherwise): If a parameter is passed by (smart) ...


1

In practice Requirement gathering should occur first and then followed by use cases (and you could have a feedback loop to verify the requirements). The case that you describe of "should we include this" , "should this be a use case" comes up mostly in product development environments. Making this choice is tricky based on your appetite for risk and your ...


1

A simple example. You assist a user who tests your e-commerce product. At some point, the user wants to get every product matching given tags within a price range. Currently, this is impossible, because the product allows to filter products by tags or to filter products by price, but not both at the same time. The users' need would be: I want to filter ...


1

An overview of the standards can be found here. IEEE-Standard from 2009 can be found here. What I teach is: Consider who's the target audience, depending on who's going do use the document the contents will most likely need adaption. In any case the required level of details changes. Apart from describing the current design, the DD should include ...


1

in your code, domready calls an annonymous function. If we had a reference to this function, we could call it. var onReady = function(){ testVar = true; } $(document).ready(onReady); and in your tests it("Test Alert Box Message For Change Modal", function() { var testVar = false; onReady() ; expect(testVar).toEqual(true); }); your code ...


1

If you look at the Java Language Specification (http://docs.oracle.com/javase/specs/) you will find a distinction between the static type and the dynamic type of object references. The static type of any reference refers to the type declared in your program at development time. The dynamic type of the reference refers to the type of object which is ...


1

I use Bitbucket quite a lot, and I almost always enable the wiki. The nice thing about Bitbucket wikis is that they're actually just repositories of Markdown text files, so you can include the wiki documentation for a new function in the same commit as the function itself, and you can use the issue tracker to keep track of wiki errors or new articles in the ...



Only top voted, non community-wiki answers of a minimum length are eligible