Questions tagged [implementations]

103 questions
101
votes
3 answers

Why is Python written in C and not in C++?

In Python's tutorial one can read that Python's original implementation is in C; On the other hand, the Python implementation, written in C, (...) I'm very curious why was Python written in C and not C++? I'd like to know the reasoning behind…
Piotr Dobrogost
  • 1,145
  • 2
  • 8
  • 10
96
votes
13 answers

How to warn other programmers of class implementation

I'm writing classes that "must be used in a specific way" (I guess all classes must...). For example, I create the fooManager class, which requires a call to, say, Initialize(string,string). And, to push the example a little further, the class would…
Gil Sand
  • 2,173
  • 3
  • 18
  • 22
74
votes
5 answers

Why are there so few C compilers?

C is one of the most widely-used languages in the world. It accounts for a huge proportion of existing code and continues to be used for a vast amount of new code. It's beloved by its users, it's so widely ported that being able to run C is to many…
anon
62
votes
6 answers

Why was C# made with "new" and "virtual+override" keywords unlike Java?

In Java there are no virtual, new, override keywords for method definition. So the working of a method is easy to understand. Cause if DerivedClass extends BaseClass and has a method with same name and same signature of BaseClass then the overriding…
56
votes
3 answers

What's is the point of PImpl pattern while we can use interface for the same purpose in C++?

I see a lot of source code that uses PImpl idiom in C++. I assume Its purpose is to hide the private data/type/implementation, so it can remove dependence, and then reduce compile time and header include issue. But interface/pure-abstract classes in…
ZijingWu
  • 1,047
  • 1
  • 9
  • 15
48
votes
2 answers

Which Common Lisp implementation to use?

There seems to be an immediate problem with starting to develop in Common Lisp: choosing an implementation. What should one take into account, and how much weight should it bear when considering a CL implementation? Should it conform to the ANSI…
anonymous
  • 597
  • 1
  • 4
  • 3
39
votes
5 answers

Implementing an interface when you don't need one of the properties

Pretty straight-forward. I'm implementing an interface, but there's one property that is unnecessary for this class and, in fact, shouldn't be used. My initial idea was to just do something like: int IFoo.Bar { get { raise new…
Chris Pratt
  • 6,374
  • 3
  • 14
  • 13
36
votes
3 answers

Implementing DDD: users and permissions

I am working on a small application trying to grasp the principles of domain-driven design. If successful, this might be a pilot for a larger project. I'm trying to follow the book "Implementing Domain-Driven Design" (by Vaughn Vernon) and trying to…
36
votes
2 answers

What is the proper way to do REST?

Everybody nowadays does SOA, even if some don't actually understand what is all about. So they do it wrong. Using that as an analogy I know what REST is (or at least I think I do) and want to do some of it. But I want to do it right. So my question…
JohnDoDo
  • 2,309
  • 2
  • 18
  • 32
20
votes
6 answers

What advantage was gained by implementing LINQ in a way that does not cache the results?

This is a known pitfall for people who are getting their feet wet using LINQ: public class Program { public static void Main() { IEnumerable originalCollection = GenerateRecords(new[] {"Jesse"}); var newCollection =…
Panzercrisis
  • 3,145
  • 4
  • 19
  • 34
17
votes
6 answers

What does the author mean by casting the interface reference to any implementation?

I am currently in the process of trying to master C#, so I am reading Adaptive Code via C# by Gary McLean Hall. He writes about patterns and anti-patterns. In the implementations versus interfaces part he writes the following: Developers who are…
Marshall
  • 289
  • 2
  • 7
16
votes
1 answer

In general how do Event Handlers work?

This is a general topic, How do Event Handlers work? This means behind the scenes - what happens when they are created. I have a rough idea - but would like to have it confirmed.
JHarley1
  • 701
  • 3
  • 8
  • 13
15
votes
3 answers

What is the difference between ref and out in runtime?

C# provides the ref and the out keyword to make arguments to be passed by reference. The semantic of the two is very similar. The only difference is in the initialization of the flaged variable: ref requires the variable to be initialized before…
Gábor Angyal
  • 1,079
  • 6
  • 18
14
votes
4 answers

Is it permissible to use explicit interface implementation to hide members in C#?

I understand how to work with interfaces and explicit interface implementation in C#, but I was wondering if it's considered bad form to hide away certain members that would not be used frequently. For example: public interface IMyInterface { …
Kyle Baran
  • 436
  • 7
  • 14
12
votes
4 answers

Ways to organize interface and implementation in C++

I've seen that there are several different paradigms in C++ concerning what goes into the header file and what to the cpp file. AFAIK, most people, especially those from a C background, do: foo.h class foo { private: int mem; int bar(); …
Felix Dombek
  • 2,109
  • 1
  • 16
  • 24
1
2 3 4 5 6 7