A short, to-the-point, document summarizing a topic (i.e. programming language)

learn more… | top users | synonyms

-1
votes
1answer
225 views

In which cases and examples String in Java is not immutable? [duplicate]

If Strings are immutable in Java, why is the output of this code 2GB, instead of 1GB? class Laptop { String memory = "1GB"; } class Workshop { public static void main(String args[]) { ...
3
votes
3answers
82 views

Is it odd if Nodes in a LinkedList held references to the List object?

Its like, I want to call .moveToBefore(Node) on a Node object and have the node relocate to before the node passed in. The problem arises if the node passed in is the head node. The List object will ...
1
vote
2answers
106 views

Use a hash character or a dot when referring to methods and fields in software documentation? [closed]

Assuming I have this class (Java code only for the sake of example): class Person { private String name; public void setName(String name) { this.name = name; } } When I write ...
4
votes
3answers
220 views

C++ returning persistent objects

I'm currently trying to learn best practices in C++ after coming from a C# background. I understand that there are three ways of handling objects: By value (objects are copied or moved when passed ...
3
votes
3answers
330 views

Polymorphic template container: shared_ptr vs reference_wrapper

Assuming we have two classes: class A { ... } class B : public A { ... } Would it be better to write std::deque<shared_ptr<A> > container; or ...
74
votes
4answers
40k views

How is a Java reference different from a C pointer?

C has pointers and Java has what is called references. They have some things in common in the sense that they all point to something. I know that pointers in C store the addresses they point to. Do ...
0
votes
1answer
62 views

Licensing - Restrictive Open Source License OR Custom License [closed]

I have some source code I want to release but I'm unsure of the best license to put on it. From my research such licenses as MIT and GNU are horrible as they offer little to no protection towards ...
4
votes
1answer
94 views

How is atomicity of reference operations enforced?

In managed languages how is atomicity of reference operations enforced? On some platforms references have to be at least 64 bit, so it cannot rely on usually atomic 32 bit word operations... Is it ...
3
votes
5answers
1k views

Storing a pointer to an argument passed by (non-const) reference

When designing an interface for passing objects which are meant to be stored for later use and which should not be 'null', I am always a bit uncertain if the argument should be passed by reference or ...
2
votes
3answers
2k views

What should I do in C++ when implementing a container class: storing objects by value or by reference?

I'm new to C++, coming from Java. In Java, all variables (except for primitives) are essentially pointers. They hold the address of whatever they're 'holding'. So any Java data structure stores it's ...
0
votes
2answers
250 views

Value of passing by reference [duplicate]

In C++, we have the option to pass by reference or pass by value. The client code does not need to know which one a parent function uses; that is, int func(int param) and int func(int &param) are ...
2
votes
1answer
89 views

Do objects maintain identity under all non-cloning conditions in PHP?

PHP 5.5 I'm doing a bunch of passing around of objects with the assumption that they will all maintain their identities - that any changes made to their states from inside other objects' methods will ...
2
votes
1answer
374 views

Is there a Design Pattern for preventing dangling references?

I was thinking about a design for custom handles. The thought is to prevent clients from copying around large objects. Now a regular handle class would probably suffice for that, but it doesn't solve ...
2
votes
2answers
1k views

Why function returning by Address can not be a Lvalue?

Why it is not possible to make it LValue if a function return by address (while possible in case of reference)? int* returnByAdress() { int x =20; return &x; } int& ...
2
votes
3answers
560 views

Why are pointers to literals not possible?

Reference to a literal is possible only if the reference is declared as constant. But why is a pointer to a const object not possible in case of literals? i.e. int const& ref = 5;// But why ...
0
votes
1answer
118 views

How do I properly add a reference from my Github project to someone elses in VS2013 on Windows 8?

I need to reference the latest version of Bouncy Castle in a project I intend to publish to Github. In my first posting of the code to Github, someone complained that I downloaded the entire Bouncy ...
1
vote
1answer
93 views

How to convey lifetime requirements?

Usually I use std::unique_ptr to convey ownership and pass in raw pointers as parameters when no ownership is implied. However, I almost never consider a nullptr to be acceptable as an argument, so it ...
-1
votes
2answers
252 views

Difference between a pointer and a reference? [duplicate]

In Java and other high-level languages, a reference leads to an object. In C++, as far as I know, a pointer can also lead to an object. So what's the difference between a reference leading to an ...
24
votes
4answers
4k views

Why do C++ and Java both use the notion of “reference” but not in the same sense?

In C++ a reference argument to a function allows the function to make the reference refer to something else: int replacement = 23; void changeNumberReference(int& reference) { reference = ...
4
votes
2answers
5k views

How to test functions or the code inside $(document).ready() using Jasmine?

I have multiple functions and a lot of code inside $(document).ready(function()). I am using jasmine to test the functions inside the ready function as well as the code inside ready() but when the ...
4
votes
2answers
2k views

Event-driven vs. 'reference'-driven programming (i.e. in JavaScript)

I haven't been able to find the appropriate terminology to search for content on the web related to what I'm asking, so I'm hoping someone on here can at least point me in the right direction. I'm a ...
0
votes
3answers
2k views

Requirement gathering and use cases examples [closed]

I've heard a lot about requirement gathering and use cases in theory, but in practice often happens that we ask ourselves "should we include this? should this be a use case? in which language should ...
3
votes
3answers
5k views

How to initialize all your references?

I have recently taken a project with another developer, and he has a certain way of initializing his references. class Player { private: Console &console; Armor &armor1, ...
0
votes
2answers
919 views

Overriding - Access to Members with Reference Reassignment

I have recently been moving through a couple of books in order to teach myself Java and have, fortunately, mostly due to luck, encountered very few difficulties. That has just changed. I read a ...
5
votes
6answers
2k views

Stroustrup and the C++ complexity admission [closed]

I heard from a friend that Bjarne Stroustroup admitted that he doesn't know entirely the C++ programming language due to its vast complexity Is it true and there's some referrable sources or is it ...
18
votes
7answers
4k views

Why are references rarely used in PHP?

I have some C++ knowledge and know that pointers are commonly used there, but I've started to look at PHP open source code and I never see code using references in methods. Instead, the code always ...
0
votes
1answer
112 views

Scrum got specific ways for testing software?

When reading Scrum Guide, as the official text for scrum, I find out there is no specific solution to provide software testing in scrum. (the only hint is on page15) I'm a little vague on whether ...
3
votes
1answer
698 views

Brief material on C++ object-lifetime management and on passing and returning values/references [closed]

I was wondering if anybody can point to a post, pdf, or excerpt of a book containing the rules for C++ variable life-times and best practices for passing and returning function parameters. Things like ...
0
votes
2answers
333 views

Deploying a very simple application

I have a very simple working console application written in C++ linked with a light static library. It is just for testing purposes. Now that the coding part is done, I would like to know the process ...
6
votes
2answers
1k views

How do document-oriented databases implement references?

In relational world we have Foreign Keys to reference other entities. But how do document-oriented databases like MongoDb, CouchDb, RavenDb implement references among entities? Update. StackExchange ...
14
votes
4answers
1k views

Writing a company-wide developer's handbook

I work for a small company. The software development arm of the company before I was hired consisted of one self-taught overworked guy. Now that I've been writing software for the company for a few ...
4
votes
2answers
660 views

Is there a canonical reference on GUI programming in Java?

I'm practicing Java in Netbeans. Is there a reference out there that's the de-facto standard for describing best practices, design methodologies, and other helpful information on GUI programming in ...
2
votes
4answers
4k views

Need help understanding reference operator(C++) in specific functions

In the current semester at the university we are working on OOP with C++. I would like to understand the difference between a pointer and a reference operator. The differences that I understand ...
5
votes
5answers
15k views

Is it possible for two DLLs to conflict , preventing solution to build

Though I have a specific case, but I was wondering about the general situation. Can two DLLs, when added as Reference to a Visual C# project collide with each other to prevent the solution from ...
5
votes
4answers
451 views

TekPub Feedback

Following on from a previous thread that had a link to TekPub, I have just had a quick look and I think it looks pretty impressive. Are any of you guys subscribers and if so would you recommend it? ...
6
votes
2answers
379 views

Which books or references cover design of domain specific languages? [closed]

There are a lot of books on domain specific languages (DSLs). Such books talk about compilers, interpreters, parsing, lexing, semantic analysis, and other various bits someone needs to implement a ...
2
votes
3answers
683 views

What are pros and cons of using temporary “references”?

In C and C++ (and I guess other languages that allow taking a "reference" to an array element or something similar), when you have an array like type, accessing individual elements of such an array ...
-1
votes
1answer
128 views

Has anyone collated a comprehensive list of all the prototype-programming style javascript work? [closed]

I'm looking for a comprehensive (or as close as possible) list of all the prototype-programming style javascript work done to date. Does anyone know of such a list somewhere, or have the knowledge to ...