concepts

static concepts

class Trial { static int i; int getI() { return i;} void setI(int value) { i = value;} } public class ttest { public static void main(String args[]) { Trial t1 = new Trial(); t1.setI(10); System.out.println(t1.getI()); Trial t2 = new Trial(); t2.setI(100); ...

Concepts that surprised you when you read SICP?

SICP - "Structure and Interpretation of Computer Programs" Explanation for the same would be nice Can some one explain about Metalinguistic Abstraction ...

What is the necessity of IP-in-IP?

There is even a standard for IP in IP encapsulation. What is the use case here? I can understand stuff like TCP over DNS, where IP might be unavailable, but if you can do IP in IP, couldn't you simply do regular IP? ...

How Does Differential Execution Work?

I've seen a few mentions of this on SO, but staring at Wikipedia and at an MFC dynamic dialog demo did nothing to enlighten me. Can someone please explain this? Learning a fundamentally different concept sounds nice. Edit: I think I'm getting a better feel for it. I guess I just didn't look at the source code carefully enough the firs...

Method overloading behaviour

I have the following code sample : public class Base { public virtual void MyMethod(int param) { Console.WriteLine("Base:MyMethod - Int {0}", param); } } public class Derived1 : Base { public override void MyMethod(int param) { Console.WriteLine("Derived1:MyMethod - Int {0}", param); } public...

What are the different types of encapsulation?

This question came from the worst interview questions thread here So, what are the different types of encapsulation? Am I right in thinking this basically refers to central OO concepts such as Abstraction, Polymorphism and Inheritance? My understanding of encapsulation is that it is a method of hiding data / functionality, but I never...

What's wrong with Copy Constructors? Why use Cloneable interface?

When programming C++ we used to create copy constructors when needed (or so we were taught). When switching to Java a few years ago, I noticed that the Cloneable interface is now being used instead. C# followed the same route defining the ICloneable interface. It seems to me that cloning is part of the definition of OOP. But I wonder, wh...

What is Map/Reduce

I hear a lot of noise about map/reduce, esp in the context of Google's massively parallel compute system. What exactly is it, and why is it "cool"? ...

Why is Java's Cloneable Interface Not Generic?

Java 5 introduced generics, and they were added to many interfaces in the java.lang package. However, Cloneable did not get generics. I wonder why? Edit: In reply to the answers of @Jon and @litb, and the comment of @Earwicker, I was thinking Cloneable might be: public interface Cloneable<T> { public T clone(); } Here T clone()...

Main concepts in OOP

I was once asked in an interview 'What are the 3 main concepts of OOP?'. I answered by saying that in my opinion there were 4 which are as follows: Inheritance Encapsulation Abstraction Polymorphism Was I correct? ...

What are the best resources if you wanted to create an application with modularization?

In my analysis of the newer web platforms/applications, such as Drupal, Wordpress, and Salesforce, many of them create their software based on the concept of modularization: Where developers can create new extensions and applications without needing to change code in the "core" system maintained by the lead developers. In particular, I ...

What are core concept differences between C++ and C#?

Let assume one knows C++, what are the main concepts that can confuse them/that work differently when using C#? I do not mean the syntax differences but for example how references works, what "replaces" pointers, etc. or how the idea of managed code affects developer experience? EDIT: Thanks to Chris for pointing out this great blog po...

Which book would you recommend as a reference on computing paradigms?

I'm looking for a book that introduces one to the various computing paradigms in existence and then goes in depth into each. What I'd like to take away from the end is a basic understanding of each and the ability to make a much more informed decision on which ones to get deeper into. ...

What steps would you recommend to move from TDD to BDD?

If you want to move your development process from Test-Driven Development to Behavior-Driven Development what path would you take or recommend? What are the possible challenges that you might face? Moving the development process will be a huge task itself as the paradigm changes, a shift happens in the thought process and the outlook o...

Books on Prototypal Inheritance

My work in JavaScript and Ajax programming has stimulated a renewed interest in prototypal inheritance. Can anyone recommend any good books on the subject? In particular, books that deal with languages that predate JavaScript. This seems to be a very poorly documented subject matter, which is why I'm asking here. ...

What is the difference between c++0x concepts and c# constraints?

C++0x introduces concepts, that let you define, basically, a type of a type. It specifies the properties required of a type. C# let you specify constraints of a generic with the "where" clause. Is there any semantic difference between them? Thank you. ...

Methods for storing metadata associated with individual files?

Given a collection of files which will have associated metadata, what are the recommended methods for storing this metadata? Some files formats support storing metadata internally (EXIF,ID3,etc), but not all file formats support this, so what are more general options? Some of the metadata would almost certainly be unique (titles/descri...

Which recursive functions cannot be rewritten using loops?

As far as I know, most recursive functions can be rewritten using loops. Some maybe harder than others, but most of them can be rewritten. So the question is, under which conditions does it become impossible to rewrite a recursive function using a loop (if such conditions exist)? Clarification: I know how to convert a recursive functi...

ASP.net MVC = Classic ASP with .net class library. Really???

This blogpost and one of our senior developers at work believe that web development has come full circle with ASP.net MVC. Its not really a question about VB script vs VB9/10 or whatever is the latest. Besides routing engine, helper classes and methods. What are some strong arguments you can make to say ASP.net MVC != Classic ASP + ...

What is the quickest way from a concept to a site?

I've got a bunch of website ideas and I was wondering what is the quickest way to get from a pretty thorough concept definition (idea mind-maps, use-cases, architecture diagrams ) to a working website. The only point is to get to something that's functional, not worrying about performance. The idea is to get something out to showcase a f...